diff --git a/src/client.rs b/src/client.rs index ebd6f0a..d69d61c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -137,8 +137,8 @@ impl GeminiClient { let txt_json = resp.text().await?; tracing::debug!("generate_content response: {:?}", txt_json); - match serde_json::from_str(&txt_json) { - Ok(response) => Ok(response), + match serde_json::from_str::(&txt_json) { + Ok(response) => Ok(response.into_result()?), Err(e) => { tracing::error!("Failed to parse response: {} with error {}", txt_json, e); Err(e.into())