Skip to content

Commit

Permalink
Fix cost addition to chat_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
sabaimran committed Nov 24, 2024
1 parent caaa127 commit 914ff99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/khoj/routers/api_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ def collect_telemetry():
chat_metadata["agent"] = conversation.agent.slug if conversation and conversation.agent else None
chat_metadata["latency"] = f"{latency:.3f}"
chat_metadata["ttft_latency"] = f"{ttft:.3f}"
chat_metadata["usage"] = tracer.get("usage")
chat_metadata["cost"] = f"{cost:.5f}"

logger.info(f"Chat response time to first token: {ttft:.3f} seconds")
logger.info(f"Chat response total time: {latency:.3f} seconds")
Expand Down

0 comments on commit 914ff99

Please sign in to comment.