fix: filter empty content blocks for Bedrock provider (#14586)
This commit is contained in:
parent
8f8c74cfb8
commit
4a2a046d79
1 changed files with 33 additions and 1 deletions
|
|
@ -51,7 +51,7 @@ export namespace ProviderTransform {
|
|||
): ModelMessage[] {
|
||||
// Anthropic rejects messages with empty content - filter out empty string messages
|
||||
// and remove empty text/reasoning parts from array content
|
||||
if (model.api.npm === "@ai-sdk/anthropic") {
|
||||
if (model.api.npm === "@ai-sdk/anthropic" || model.api.npm === "@ai-sdk/amazon-bedrock") {
|
||||
msgs = msgs
|
||||
.map((msg) => {
|
||||
if (typeof msg.content === "string") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue