🐛 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
a2e7a910ae
commit
df8dd44a16
1 changed files with 1 additions and 3 deletions
|
|
@ -204,11 +204,9 @@ class ChatService(Service):
|
|||
json_payload = await websocket.receive_json()
|
||||
try:
|
||||
payload = orjson.loads(json_payload)
|
||||
# except TypeError or JSONDecodeError how?
|
||||
except Exception as exc:
|
||||
logger.error(f"Error decoding JSON: {exc}")
|
||||
payload = json_payload
|
||||
if "clear_history" in payload:
|
||||
if "clear_history" in payload and payload["clear_history"]:
|
||||
self.chat_history.history[client_id] = []
|
||||
continue
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue