| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
AWS Bedrock rejects messages containing empty text content blocks with 'ValidationException: messages: text content blocks must be non-empty'. The empty-content filter in normalizeMessages() was only applied to the @ai-sdk/anthropic provider. Extend it to also cover @ai-sdk/amazon-bedrock which has the same API constraint. Fixes anomalyco#15715
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Sorry, something went wrong.
|
The following comment was made by an LLM, it may be inaccurate: I found a potentially related PR: Related PR:
This appears to be addressing the exact same issue as the current PR #15777. Both are about filtering empty content blocks for the Bedrock provider. You should verify whether #14586 was already merged or closed, and if so, whether the current PR (#15777) is based on or supersedes it. |
Sorry, something went wrong.
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Fixes #15715
Fixes #13811
Problem
AWS Bedrock rejects API requests that contain empty text content blocks with:
Root Cause
normalizeMessages() in transform.ts already filters out empty text/reasoning content blocks — but the guard only applied to @ai-sdk/anthropic. AWS Bedrock (@ai-sdk/amazon-bedrock) has the same constraint on the API level, so it was silently passing empty blocks through.
Fix
Extend the existing empty-content filter to cover @ai-sdk/amazon-bedrock as well:
Tests
Added a new describe block mirroring the Anthropic empty-content filtering tests for Bedrock, covering: