feat(ai): support PDF inputs (#38253)

This commit is contained in:
Aiden Cline 2026-07-22 13:42:29 -05:00 committed by GitHub
commit 2271f9b222
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 1063 additions and 96 deletions

View file

@ -52,6 +52,7 @@ const BedrockToolResultContentItem = Schema.Union([
Schema.Struct({ text: Schema.String }),
Schema.Struct({ json: Schema.Unknown }),
BedrockMedia.ImageBlock,
BedrockMedia.DocumentBlock,
])
const BedrockToolResultBlock = Schema.Struct({
@ -283,8 +284,6 @@ const lowerToolResultContent = Effect.fn("BedrockConverse.lowerToolResultContent
data: item.uri,
filename: item.name,
})
if (!("image" in media))
return yield* ProviderShared.invalidRequest("Bedrock Converse only supports image media in tool results")
content.push(media)
}
return content