Skip to content

backport: skip content if assistant content string is empty#511

Merged
aabchoo merged 1 commit intorelease/v0.1from
aaron/add-bedrock-skip-empty-content
Mar 20, 2025
Merged

backport: skip content if assistant content string is empty#511
aabchoo merged 1 commit intorelease/v0.1from
aaron/add-bedrock-skip-empty-content

Conversation

@aabchoo
Copy link
Copy Markdown
Contributor

@aabchoo aabchoo commented Mar 20, 2025

Commit Message

Ref: (#508)

AWS Claude 3.5 v1 has cases when assistant returns empty content. Sending that back to AWS will result in a validation error. Will skip adding empty content if string is empty.

openai.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'ValidationException:http://internal.amazon.com/coral/com.amazon.bedrock/', 'code': '400', 'message': 'The text field in the ContentBlock object at messages.3.content.0 is blank. Add text to the text field, and try again.'}}

Related Issues/PRs (if applicable)
#486

…508)

**Commit Message**

AWS Claude 3.5 v1 has cases when assistant returns empty content.
Sending that back to AWS will result in a validation error. Will skip
adding empty content if string is empty.

```
openai.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'ValidationException:http://internal.amazon.com/coral/com.amazon.bedrock/', 'code': '400', 'message': 'The text field in the ContentBlock object at messages.3.content.0 is blank. Add text to the text field, and try again.'}}
```


**Related Issues/PRs (if applicable)**
#486

Signed-off-by: Aaron Choo <achoo30@bloomberg.net>
@aabchoo aabchoo changed the title backport: translator: skip adding content if assistant content string is empty … backport: translator: skip adding content if assistant content string is empty Mar 20, 2025
@mathetake
Copy link
Copy Markdown
Member

nice

@aabchoo aabchoo changed the title backport: translator: skip adding content if assistant content string is empty backport: skip adding content if assistant content string is empty Mar 20, 2025
@aabchoo aabchoo changed the title backport: skip adding content if assistant content string is empty backport: skip content if assistant content string is empty Mar 20, 2025
@aabchoo aabchoo marked this pull request as ready for review March 20, 2025 20:01
@aabchoo aabchoo requested a review from a team as a code owner March 20, 2025 20:01
@aabchoo aabchoo merged commit d00bf8c into release/v0.1 Mar 20, 2025
14 of 20 checks passed
@aabchoo aabchoo deleted the aaron/add-bedrock-skip-empty-content branch March 20, 2025 20:26
mathetake pushed a commit that referenced this pull request Mar 20, 2025
**Commit Message**

Update site to use v0.1.4 instead of v0.1.3 ref:
#511

---------

Signed-off-by: Aaron Choo <achoo30@bloomberg.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants