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
This commit is contained in:
dayuan.jiang
2025-11-30 16:12:12 +09:00
parent 00af87edbe
commit de910bdf6c
3 changed files with 48 additions and 92 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: {