From eed62caa78c60eb38938eba6d0195b0da00609e9 Mon Sep 17 00:00:00 2001 From: snaily Date: Thu, 10 Jul 2025 00:53:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=20ApiClient=20?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=20count=5Ftokens=20=E6=8A=BD=E8=B1=A1?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 从 ApiClient 类中删除了 count_tokens 方法的抽象定义,以简化接口。 --- app/service/client/api_client.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/service/client/api_client.py b/app/service/client/api_client.py index 2b672f9..dd297a5 100644 --- a/app/service/client/api_client.py +++ b/app/service/client/api_client.py @@ -21,10 +21,6 @@ class ApiClient(ABC): async def stream_generate_content(self, payload: Dict[str, Any], model: str, api_key: str) -> AsyncGenerator[str, None]: pass - @abstractmethod - async def count_tokens(self, payload: Dict[str, Any], model: str, api_key: str) -> Dict[str, Any]: - pass - class GeminiApiClient(ApiClient): """Gemini API客户端"""