Expand description
Gemini Generate API 驱动 — 实现 Google Gemini 特有的请求/响应格式转换
Google Gemini generateContent API driver. Key differences:
- Uses
contentsinstead ofmessages, withpartsinstead ofcontent. - Roles:
userandmodel(notassistant). System usessystem_instruction. generationConfigwraps temperature, max_tokens (→maxOutputTokens), etc.- Response:
candidates[0].content.parts[0].text. - Streaming uses NDJSON with the same structure (each line is a full response).
- API key is passed as
?key=query parameter, not in headers.
Structs§
- Gemini
Driver - Google Gemini generateContent API driver.