Skip to content

translator: skip adding content if assistant content string is empty#508

Merged
mathetake merged 1 commit intomainfrom
aaron/skip-missing-content
Mar 18, 2025
Merged

translator: skip adding content if assistant content string is empty#508
mathetake merged 1 commit intomainfrom
aaron/skip-missing-content

Conversation

@aabchoo
Copy link
Copy Markdown
Contributor

@aabchoo aabchoo commented Mar 18, 2025

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 marked this pull request as ready for review March 18, 2025 15:36
@aabchoo aabchoo requested a review from a team as a code owner March 18, 2025 15:36
@aabchoo aabchoo changed the title bug: skip adding content if assistant content string is empty translator: skip adding content if assistant content string is empty Mar 18, 2025
@mathetake mathetake merged commit f3ab8bb into main Mar 18, 2025
15 of 21 checks passed
@mathetake mathetake deleted the aaron/skip-missing-content branch March 18, 2025 16:19
aabchoo added a commit that referenced this pull request Mar 20, 2025
…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 added a commit that referenced this pull request 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

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