原生Gemini格式
POST /v1beta/models/{model}:generateContent
请求参数
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
model (path) | string | 必选 | 模型名称 |
contents | array<object> | 必选 | - |
contents[].parts | array<object> | 可选 | - |
contents[].parts[].text | string | 可选 | - |
generationConfig | object | 必选 | - |
generationConfig.responseModalities | array<string> | 必选 | - |
generationConfig.speechConfig | object | 必选 | - |
generationConfig.speechConfig.voiceConfig | object | 必选 | - |
请求示例
{
"path": {
"model": "string"
},
"body": {
"contents": [
{}
],
"generationConfig": {
"responseModalities": [
"string"
],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "string"
}
}
}
}
}
}
响应字段(200)
| 字段名 | 类型 | 说明 |
|---|---|---|
| 无结构化响应字段(可能为二进制或无响应体) |