diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index 7a6b68b3e..8378a9479 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -420,6 +420,18 @@ CONFIG_METADATA_2 = { "model": "grok-2-latest", }, }, + "claude": { + "id": "claude", + "type": "anthropic_chat_completion", + "enable": True, + "key": [], + "api_base": "https://api.anthropic.com/v1", + "timeout": 120, + "model_config": { + "model": "claude-3-5-sonnet-latest", + "max_tokens": 4096, + }, + }, "ollama": { "id": "ollama_default", "type": "openai_chat_completion", diff --git a/astrbot/core/provider/sources/anthropic_source.py b/astrbot/core/provider/sources/anthropic_source.py index c90d15af9..fc67bd085 100644 --- a/astrbot/core/provider/sources/anthropic_source.py +++ b/astrbot/core/provider/sources/anthropic_source.py @@ -25,7 +25,7 @@ class ProviderAnthropic(ProviderOpenAIOfficial): ) -> None: # Skip OpenAI's __init__ and call Provider's __init__ directly Provider.__init__(self, provider_config, provider_settings, persistant_history, db_helper, default_persona) - + self.chosen_api_key = None self.api_keys: List = provider_config.get("key", []) self.chosen_api_key = self.api_keys[0] if len(self.api_keys) > 0 else None