fix(providers): clamp max_tokens to >= 1 before calling LiteLLM (#523)
This commit is contained in:
parent
bc045fae1f
commit
10e9e0cdc9
@ -122,6 +122,10 @@ class LiteLLMProvider(LLMProvider):
|
||||
"""
|
||||
model = self._resolve_model(model or self.default_model)
|
||||
|
||||
# Clamp max_tokens to at least 1 — negative or zero values cause
|
||||
# LiteLLM to reject the request with "max_tokens must be at least 1".
|
||||
max_tokens = max(1, max_tokens)
|
||||
|
||||
kwargs: dict[str, Any] = {
|
||||
"model": model,
|
||||
"messages": messages,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user