gemini: Add support for passing images as part of the prompt (#29203)
Release Notes: - agent: Add support for adding images as context when using Google Gemini
This commit is contained in:
@@ -384,7 +384,14 @@ pub fn into_google(
|
||||
}
|
||||
}
|
||||
language_model::MessageContent::RedactedThinking(_) => None,
|
||||
language_model::MessageContent::Image(_) => None,
|
||||
language_model::MessageContent::Image(image) => {
|
||||
Some(Part::InlineDataPart(google_ai::InlineDataPart {
|
||||
inline_data: google_ai::GenerativeContentBlob {
|
||||
mime_type: "image/png".to_string(),
|
||||
data: image.source.to_string(),
|
||||
},
|
||||
}))
|
||||
}
|
||||
language_model::MessageContent::ToolUse(tool_use) => {
|
||||
Some(Part::FunctionCallPart(google_ai::FunctionCallPart {
|
||||
function_call: google_ai::FunctionCall {
|
||||
|
||||
Reference in New Issue
Block a user