Makes Error details optional
- Makes Error details option, as many types don't return the field. - Removes dangling println statement.
This commit is contained in:
@@ -191,7 +191,6 @@ impl<T: TokenProvider + Clone> GeminiClient<T> {
|
|||||||
.send()
|
.send()
|
||||||
.await?;
|
.await?;
|
||||||
let txt_json = resp.text().await?;
|
let txt_json = resp.text().await?;
|
||||||
println!("{}", txt_json);
|
|
||||||
Ok(serde_json::from_str::<TextEmbeddingResponse>(&txt_json)?)
|
Ok(serde_json::from_str::<TextEmbeddingResponse>(&txt_json)?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ pub struct Error {
|
|||||||
pub code: i32,
|
pub code: i32,
|
||||||
pub message: String,
|
pub message: String,
|
||||||
pub status: String,
|
pub status: String,
|
||||||
pub details: Vec<ErrorType>,
|
pub details: Option<Vec<ErrorType>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
|||||||
Reference in New Issue
Block a user