fix(adapter/llm): make max_tokens configurable via team.yaml models.default_max_tokens
This commit is contained in:
@@ -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", "")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user