diff --git a/adapters/llm/anthropic.py b/adapters/llm/anthropic.py index e18214c..4b4a2ec 100644 --- a/adapters/llm/anthropic.py +++ b/adapters/llm/anthropic.py @@ -22,7 +22,6 @@ class AnthropicAdapter(LLMAdapter): Reads model configuration from the loaded team.yaml config dict:: models: - provider: anthropic default_max_tokens: 4096 # fallback max_tokens for all calls default_temperature: 0 # fallback temperature for all calls capability_map: @@ -33,6 +32,10 @@ class AnthropicAdapter(LLMAdapter): fast-cheap: anthropic: claude-haiku-3-5 + The provider key used when looking up ``capability_map`` is hardcoded to + ``"anthropic"`` — the adapter knows its own provider; there is no need for + a separate ``models.provider`` config field. + Both ``default_max_tokens`` and ``default_temperature`` can be overridden per-call via the ``context`` dict passed to :meth:`complete`. @@ -116,15 +119,15 @@ class AnthropicAdapter(LLMAdapter): ------- Anthropic model identifier (e.g. "claude-opus-4-6"). """ - provider: str = self._models_cfg.get("provider", "anthropic") + # The adapter knows its own provider — no need to read it from config. cap_map: dict = self._models_cfg.get("capability_map", {}) - if capability in cap_map and provider in cap_map[capability]: - return cap_map[capability][provider] + if capability in cap_map and "anthropic" in cap_map[capability]: + return cap_map[capability]["anthropic"] # Fall back to "capable" tier - if "capable" in cap_map and provider in cap_map["capable"]: - return cap_map["capable"][provider] + if "capable" in cap_map and "anthropic" in cap_map["capable"]: + return cap_map["capable"]["anthropic"] # Hard-coded last resort return "claude-sonnet-4-6" diff --git a/config/team.yaml b/config/team.yaml index bc3b0b6..ba12e05 100644 --- a/config/team.yaml +++ b/config/team.yaml @@ -10,7 +10,6 @@ adapters: runtime: openclaw models: - provider: anthropic default_max_tokens: 4096 default_temperature: 0 capability_map: