fix: Adjust max tokens for Anthropic and improve Google tools handling

- Reduce default max tokens for Anthropic to 1/3 of model max
- Fix Google provider to properly handle empty tools array
- Ensure toolConfig is undefined when no tools are present
This commit is contained in:
Mario Zechner 2025-09-15 00:34:52 +02:00
parent 433b42ac91
commit 73d2119606
2 changed files with 7 additions and 4 deletions

View file

@ -261,7 +261,7 @@ function buildParams(
const params: MessageCreateParamsStreaming = {
model: model.id,
messages: convertMessages(context.messages, model),
max_tokens: options?.maxTokens || model.maxTokens,
max_tokens: options?.maxTokens || (model.maxTokens / 3) | 0,
stream: true,
};