assistant: Only push text content if not empty with image content (#16270)
If you submit an image with empty space above it and text below, it will fail with this error:  Now instead it fails with an error about needing a message. <img width="640" alt="image" src="https://github.com/user-attachments/assets/72b267eb-b288-40a5-a829-750121ff16cc"> It will however work with text above and empty text below the image now. Release Notes: - Improved conformance with Anthropic Images in Chat Completions API
This commit is contained in:
parent
46fb917e02
commit
bac39d7743
2 changed files with 26 additions and 18 deletions
|
@ -307,7 +307,6 @@ impl LanguageModelRequest {
|
|||
let anthropic_message_content: Vec<anthropic::Content> = message
|
||||
.content
|
||||
.into_iter()
|
||||
// TODO: filter out the empty messages in the message construction step
|
||||
.filter_map(|content| match content {
|
||||
MessageContent::Text(t) if !t.is_empty() => {
|
||||
Some(anthropic::Content::Text {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue