fix: correct anthropic beta header config for fine-grained tool streaming (#27)

* fix: correct anthropic beta header config for fine-grained tool streaming

- Use bedrock.anthropicBeta for Bedrock provider (not additionalModelRequestFields)
- Use top-level headers for direct Anthropic API
- Update @ai-sdk/amazon-bedrock to 3.0.62
- Add headers support to ModelConfig interface

* fix: update @ai-sdk/amazon-bedrock to 3.0.62 for tool streaming support
This commit is contained in:
Dayuan Jiang
2025-11-30 16:34:42 +09:00
committed by GitHub
parent 6e6de1eba6
commit 0d0d553e23
4 changed files with 42 additions and 53 deletions

View File

@@ -120,13 +120,14 @@ ${lastMessageText}
console.log("Enhanced messages:", enhancedMessages);
// Get AI model from environment configuration
const { model, providerOptions } = getAIModel();
const { model, providerOptions, headers } = getAIModel();
const result = streamText({
model,
system: systemMessage,
messages: enhancedMessages,
...(providerOptions && { providerOptions }),
...(headers && { headers }),
tools: {
// Client-side tool that will be executed on the client
display_diagram: {