zelk12 commited on
Commit
d819a44
·
verified ·
1 Parent(s): 1dc5b22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
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
- print("Start response")
99
- response = chat.send_message(message["text"])
100
- print(f"\nResponse\n{response}=========\n")
101
-
102
- return response.text
 
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)}")