We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8baedb commit ef1331aCopy full SHA for ef1331a
rust/cocoindex/src/llm/gemini.rs
@@ -143,9 +143,14 @@ impl LlmGenerationClient for AiStudioClient {
143
}
144
145
let url = self.get_api_url(request.model, "generateContent");
146
- let resp = http::request(|| self.client.post(&url).json(&payload))
147
- .await
148
- .context("Gemini API error")?;
+ let resp = http::request(|| {
+ self.client
+ .post(&url)
149
+ .header("x-goog-api-key", &self.api_key)
150
+ .json(&payload)
151
+ })
152
+ .await
153
+ .context("Gemini API error")?;
154
let resp_json: Value = resp.json().await.context("Invalid JSON")?;
155
156
if let Some(error) = resp_json.get("error") {
0 commit comments