From a9eda2cc4251c0c7f3f14b02bd40873f26300c54 Mon Sep 17 00:00:00 2001 From: Obada Khalili Date: Thu, 30 Jan 2025 18:06:28 +0200 Subject: [PATCH] pass model and cost so that langfuse can show cost --- api/models/model.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/models/model.py b/api/models/model.py index d6f73c5ede8bf7..2780b79c98e2b6 100644 --- a/api/models/model.py +++ b/api/models/model.py @@ -1066,8 +1066,10 @@ def to_dict(self) -> dict: "id": self.id, "app_id": self.app_id, "conversation_id": self.conversation_id, + "model_id": self.model_id, "inputs": self.inputs, "query": self.query, + "total_price": self.total_price, "message": self.message, "answer": self.answer, "status": self.status, @@ -1088,7 +1090,9 @@ def from_dict(cls, data: dict): id=data["id"], app_id=data["app_id"], conversation_id=data["conversation_id"], + model_id=data["model_id"], inputs=data["inputs"], + total_price=data["total_price"], query=data["query"], message=data["message"], answer=data["answer"],