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:
parent
eca6d5a04e
commit
b0b620af56
1 changed files with 8 additions and 1 deletions
|
@ -384,7 +384,14 @@ pub fn into_google(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
language_model::MessageContent::RedactedThinking(_) => None,
|
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) => {
|
language_model::MessageContent::ToolUse(tool_use) => {
|
||||||
Some(Part::FunctionCallPart(google_ai::FunctionCallPart {
|
Some(Part::FunctionCallPart(google_ai::FunctionCallPart {
|
||||||
function_call: google_ai::FunctionCall {
|
function_call: google_ai::FunctionCall {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue