google_ai: Parse thought parts in Gemini responses (#31925)
Fixes thinking Gemini models. Closes #31902 Release Notes: - Updated Google Gemini client to match the latest API
This commit is contained in:
parent
07dab4e94a
commit
3077abf9cf
2 changed files with 9 additions and 0 deletions
|
@ -202,6 +202,7 @@ pub enum Part {
|
||||||
InlineDataPart(InlineDataPart),
|
InlineDataPart(InlineDataPart),
|
||||||
FunctionCallPart(FunctionCallPart),
|
FunctionCallPart(FunctionCallPart),
|
||||||
FunctionResponsePart(FunctionResponsePart),
|
FunctionResponsePart(FunctionResponsePart),
|
||||||
|
ThoughtPart(ThoughtPart),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
@ -235,6 +236,13 @@ pub struct FunctionResponsePart {
|
||||||
pub function_response: FunctionResponse,
|
pub function_response: FunctionResponse,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct ThoughtPart {
|
||||||
|
pub thought: bool,
|
||||||
|
pub thought_signature: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct CitationSource {
|
pub struct CitationSource {
|
||||||
|
|
|
@ -620,6 +620,7 @@ impl GoogleEventMapper {
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
Part::FunctionResponsePart(_) => {}
|
Part::FunctionResponsePart(_) => {}
|
||||||
|
Part::ThoughtPart(_) => {}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue