Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -176,12 +176,11 @@ async def get_completion(client, event, user_id, prompt):
|
|
176 |
for chunk in completion:
|
177 |
if chunk.choices[0].delta.content is not None:
|
178 |
message += chunk.choices[0].delta.content
|
179 |
-
if message != prev_message:
|
180 |
await bot_message.edit(message)
|
181 |
prev_message = message
|
182 |
-
await asyncio.sleep(0.5) # Add delay to avoid spamming edits
|
183 |
except Exception as e:
|
184 |
-
message = "
|
185 |
print(e)
|
186 |
|
187 |
update_chat_history(user_id, "user", prompt)
|
|
|
176 |
for chunk in completion:
|
177 |
if chunk.choices[0].delta.content is not None:
|
178 |
message += chunk.choices[0].delta.content
|
179 |
+
if message != prev_message:
|
180 |
await bot_message.edit(message)
|
181 |
prev_message = message
|
|
|
182 |
except Exception as e:
|
183 |
+
message = "..........."
|
184 |
print(e)
|
185 |
|
186 |
update_chat_history(user_id, "user", prompt)
|