feat(providers): Add Anthropic extended thinking and adapt providers to new streaming/file APIs; bump dependencies and update docs, tests and configuration

This commit is contained in:
2026-01-18 16:26:16 +00:00
parent e8a2a3ff1b
commit b4ced080f2
27 changed files with 2262 additions and 3339 deletions

View File

@@ -317,7 +317,11 @@ export class AnthropicProvider extends MultiModalModel {
const maxTokens = optionsArg.searchDepth === 'deep' ? 20000 :
optionsArg.searchDepth === 'advanced' ? 20000 : 20000;
// Add thinking configuration if enabled
const thinkingConfig = this.getThinkingConfig();
// Create the research request
// Note: When thinking is enabled, temperature must be 1 (or omitted)
const requestParams: any = {
model: 'claude-sonnet-4-5-20250929',
system: systemMessage,
@@ -328,7 +332,8 @@ export class AnthropicProvider extends MultiModalModel {
}
],
max_tokens: maxTokens,
temperature: 0.7
// Only set temperature when thinking is NOT enabled
...(thinkingConfig ? {} : { temperature: 0.7 })
};
// Add tools if web search is enabled
@@ -337,7 +342,6 @@ export class AnthropicProvider extends MultiModalModel {
}
// Add thinking configuration if enabled
const thinkingConfig = this.getThinkingConfig();
if (thinkingConfig) {
requestParams.thinking = thinkingConfig;
}