🐛 fix(manager.py): remove unnecessary exception handling and logging for JSON decoding error
🐛 fix(manager.py): fix condition for clearing chat history to only clear if "clear_history" key is present and its value is truthy
This commit is contained in:
parent
bc421d7557
commit
aec14bd250
1 changed files with 1 additions and 3 deletions
|
|
@ -204,11 +204,9 @@ class ChatService(Service):
|
||||||
json_payload = await websocket.receive_json()
|
json_payload = await websocket.receive_json()
|
||||||
try:
|
try:
|
||||||
payload = orjson.loads(json_payload)
|
payload = orjson.loads(json_payload)
|
||||||
# except TypeError or JSONDecodeError how?
|
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
logger.error(f"Error decoding JSON: {exc}")
|
|
||||||
payload = json_payload
|
payload = json_payload
|
||||||
if "clear_history" in payload:
|
if "clear_history" in payload and payload["clear_history"]:
|
||||||
self.chat_history.history[client_id] = []
|
self.chat_history.history[client_id] = []
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue