mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 09:25:06 +01:00
Skip adding agent to chat metadata when chat unset to avoids null ref
This commit is contained in:
parent
4da0499cd7
commit
9ab76ccaf1
1 changed files with 1 additions and 1 deletions
|
@ -682,7 +682,7 @@ async def chat(
|
||||||
cmd_set = set([cmd.value for cmd in conversation_commands])
|
cmd_set = set([cmd.value for cmd in conversation_commands])
|
||||||
chat_metadata = chat_metadata or {}
|
chat_metadata = chat_metadata or {}
|
||||||
chat_metadata["conversation_command"] = cmd_set
|
chat_metadata["conversation_command"] = cmd_set
|
||||||
chat_metadata["agent"] = conversation.agent.slug if conversation.agent else None
|
chat_metadata["agent"] = conversation.agent.slug if conversation and conversation.agent else None
|
||||||
chat_metadata["latency"] = f"{latency:.3f}"
|
chat_metadata["latency"] = f"{latency:.3f}"
|
||||||
chat_metadata["ttft_latency"] = f"{ttft:.3f}"
|
chat_metadata["ttft_latency"] = f"{ttft:.3f}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue