Spaces:
Runtime error
Runtime error
ricklamers
commited on
Commit
•
a939268
1
Parent(s):
6aa31f2
fix: on exception print error
Browse files
app.py
CHANGED
@@ -51,14 +51,19 @@ def call_function(tool_call, available_functions):
|
|
51 |
}
|
52 |
|
53 |
def get_model_response(messages):
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
def respond(message, history, system_message):
|
64 |
if not hasattr(respond, 'conversation'):
|
|
|
51 |
}
|
52 |
|
53 |
def get_model_response(messages):
|
54 |
+
try:
|
55 |
+
return client.chat.completions.create(
|
56 |
+
model=MODEL,
|
57 |
+
messages=messages,
|
58 |
+
tools=tools,
|
59 |
+
temperature=0.5,
|
60 |
+
top_p=0.65,
|
61 |
+
max_tokens=4096,
|
62 |
+
)
|
63 |
+
except Exception as e:
|
64 |
+
print(f"An error occurred while getting model response: {str(e)}")
|
65 |
+
print(messages)
|
66 |
+
return None
|
67 |
|
68 |
def respond(message, history, system_message):
|
69 |
if not hasattr(respond, 'conversation'):
|