From a7157d9e7a0d7c3cbf3a248e32d18ebec2c90fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Tue, 22 Aug 2023 19:56:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20CostManager=E6=94=B9pydantic=E7=BB=93?= =?UTF-8?q?=E6=9E=84=EF=BC=8C=E4=BB=A5=E5=A4=87RPC=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metagpt/provider/openai_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/metagpt/provider/openai_api.py b/metagpt/provider/openai_api.py index abfb796f3..f0b692f46 100644 --- a/metagpt/provider/openai_api.py +++ b/metagpt/provider/openai_api.py @@ -62,9 +62,9 @@ class CostManager(BaseModel): total_prompt_tokens: int = 0 total_completion_tokens: int = 0 - total_budget: int = 0 - max_budget: int - total_cost: int = 0 + total_budget: float = 0 + max_budget: float + total_cost: float = 0 def update_cost(self, prompt_tokens, completion_tokens, model): """