Skip to content

Fix bedrock empty content error - #7177

Merged
10 commits merged into
BerriAI:litellm_dev_12_11_2024_v2from
enyst:fix/bedrock-content-block-error
Dec 12, 2024
Merged

Fix bedrock empty content error#7177
10 commits merged into
BerriAI:litellm_dev_12_11_2024_v2from
enyst:fix/bedrock-content-block-error

Conversation

@enyst

@enyst enyst commented Dec 11, 2024

Copy link
Copy Markdown
Contributor

Title

This PR proposes a fix for Bedrock empty content error.

Relevant issues

Fixes #7169

Type

🐛 Bug Fix

Unit tests added.

@vercel

vercel Bot commented Dec 11, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 0:02am

@ghost
ghost merged commit 8a7bb97 into BerriAI:litellm_dev_12_11_2024_v2 Dec 12, 2024
@enyst
enyst deleted the fix/bedrock-content-block-error branch December 12, 2024 02:32
ghost pushed a commit that referenced this pull request Dec 13, 2024
* feat(bedrock/): add bedrock converse top k param

Closes #7087

* Fix bedrock empty content error (#7177)

* add resolver

* handle empty content on bedrock with default content

* use existing default message, tests

* Update tests/llm_translation/test_bedrock_completion.py

* fix tests

* Revert "add resolver"

This reverts commit c717e37.

* fallback to empty

---------

Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>

* fix(factory.py): handle empty content blocks in messages

Fixes #7169

* feat(router.py): add stripped model check to model fallback search

if model_name="openai/gpt-3.5-turbo" and fallback=[{"gpt-3.5-turbo"..}] the fallback should just work as expected

* fix: fix linting error

* fix(factory.py): fix linting error

* fix(factory.py): in base case still support skip empty text blocks

---------

Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
* feat(bedrock/): add bedrock converse top k param

Closes BerriAI#7087

* Fix bedrock empty content error (BerriAI#7177)

* add resolver

* handle empty content on bedrock with default content

* use existing default message, tests

* Update tests/llm_translation/test_bedrock_completion.py

* fix tests

* Revert "add resolver"

This reverts commit c717e37.

* fallback to empty

---------

Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>

* fix(factory.py): handle empty content blocks in messages

Fixes BerriAI#7169

* feat(router.py): add stripped model check to model fallback search

if model_name="openai/gpt-3.5-turbo" and fallback=[{"gpt-3.5-turbo"..}] the fallback should just work as expected

* fix: fix linting error

* fix(factory.py): fix linting error

* fix(factory.py): in base case still support skip empty text blocks

---------

Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
This pull request was closed.
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.

[Bug]: Bedrock throws 400 on empty content

1 participant