fix(adapter/llm): make max_tokens configurable via team.yaml models.default_max_tokens

This commit is contained in:
2026-03-15 18:55:57 -04:00
parent e097f4be21
commit 6856f10c27
2 changed files with 3 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ class AnthropicAdapter(LLMAdapter):
)
self._client = anthropic.Anthropic(api_key=api_key)
self._models_cfg: dict = config.get("models", {})
self._default_max_tokens: int = self._models_cfg.get("default_max_tokens", 4096)
def complete(self, prompt: str, capability: str, context: dict) -> str:
"""
@@ -77,7 +78,7 @@ class AnthropicAdapter(LLMAdapter):
The model's text completion as a plain string.
"""
model = self.resolve_model(capability)
max_tokens: int = context.get("max_tokens", 4096)
max_tokens: int = context.get("max_tokens", self._default_max_tokens)
temperature: float = context.get("temperature", 0)
system_prompt: str = context.get("system_prompt", "")

View File

@@ -11,6 +11,7 @@ adapters:
models:
provider: anthropic
default_max_tokens: 4096
capability_map:
reasoning-heavy:
anthropic: claude-opus-4-6