Update app.py
Browse files
app.py
CHANGED
@@ -95,11 +95,12 @@ def model_response(message, history):
|
|
95 |
print("Create chat")
|
96 |
chat = client.chats.create(model=used_model, history=formated_history)
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
|
|
103 |
|
104 |
except Exception as e:
|
105 |
print(f"\n=== Error ===\n{str(e)}")
|
|
|
95 |
print("Create chat")
|
96 |
chat = client.chats.create(model=used_model, history=formated_history)
|
97 |
|
98 |
+
try:
|
99 |
+
print("Start response")
|
100 |
+
response = chat.send_message(message["text"])
|
101 |
+
print(f"\nResponse\n{response}=========\n")
|
102 |
+
|
103 |
+
return response.text
|
104 |
|
105 |
except Exception as e:
|
106 |
print(f"\n=== Error ===\n{str(e)}")
|