From bf2c3a1a81fdc11034f6d29fa8441285b1ce536f Mon Sep 17 00:00:00 2001 From: Rt39 Date: Thu, 20 Feb 2025 21:15:07 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=B9=E6=8D=AECodacy=20Production=20?= =?UTF-8?q?/=20Codacy=20Static=20Code=20Analysis=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/provider/sources/anthropic_source.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/astrbot/core/provider/sources/anthropic_source.py b/astrbot/core/provider/sources/anthropic_source.py index 2685a6818..c90d15af9 100644 --- a/astrbot/core/provider/sources/anthropic_source.py +++ b/astrbot/core/provider/sources/anthropic_source.py @@ -1,6 +1,3 @@ -import json -import os -import base64 from typing import List from mimetypes import guess_type @@ -19,10 +16,10 @@ from .openai_source import ProviderOpenAIOfficial @register_provider_adapter("anthropic_chat_completion", "Anthropic Claude API 提供商适配器") class ProviderAnthropic(ProviderOpenAIOfficial): def __init__( - self, - provider_config: dict, + self, + provider_config: dict, provider_settings: dict, - db_helper: BaseDatabase, + db_helper: BaseDatabase, persistant_history = True, default_persona: Personality = None ) -> None: @@ -92,9 +89,9 @@ class ProviderAnthropic(ProviderOpenAIOfficial): async def text_chat( self, prompt: str, - session_id: str=None, - image_urls: List[str]=[], - func_tool: FuncCall=None, + session_id: str = None, + image_urls: List[str] = [], + func_tool: FuncCall = None, contexts=[], system_prompt=None, **kwargs