Skip to content

Commit

Permalink
assistant: Fix Gemini 1.5 Pro throwing "missing field 'index' at line…
Browse files Browse the repository at this point in the history
… N column M" (#20200)

Closes #20033

- Fixed deserialization error of `GenerateContentCandidate` where `index` is unexpectedly nil
  • Loading branch information
zeitlings authored and notpeter committed Nov 4, 2024
1 parent 86e7561 commit de1e2d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/google_ai/src/google_ai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub struct GenerateContentResponse {
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GenerateContentCandidate {
pub index: usize,
pub index: Option<usize>,
pub content: Content,
pub finish_reason: Option<String>,
pub finish_message: Option<String>,
Expand Down

0 comments on commit de1e2d0

Please sign in to comment.