assistant: Fix Gemini 1.5 Pro throwing "missing field 'index' at line N column M" (#20200)

Closes https://github.com/zed-industries/zed/issues/20033

- Fixed deserialization error of `GenerateContentCandidate` where `index` is unexpectedly nil
This commit is contained in:
Patrick Sy 2024-11-04 23:01:08 +01:00 committed by GitHub
parent 2c7e71028d
commit 966b18e142
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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>,