Gemini原生格式
POST /v1beta/models/{model}:generateContent/
请求参数
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
model (path) | string | 必选 | 模型名称 |
contents | array<object> | 必选 | - |
contents[].role | string | 可选 | - |
contents[].parts | array<object> | 可选 | - |
contents[].parts[].text | string | 可选 | - |
generationConfig | object | 必选 | - |
generationConfig.thinkingConfig | object | 可选 | - |
generationConfig.thinkingConfig.includeThoughts | boolean | 必选 | 是否返回思考内容 |
generationConfig.responseModalities | array<string> | 必选 | - |
generationConfig.imageConfig | object | 必选 | - |
generationConfig.imageConfig.aspectRatio | string | 必选 | - |
generationConfig.imageConfig.imageSize | string | 必选 | - |
请求示例
{
"path": {
"model": "string"
},
"body": {
"contents": [
{}
],
"generationConfig": {
"responseModalities": [
"string"
],
"imageConfig": {
"aspectRatio": "string",
"imageSize": "string"
}
}
}
}
响应字段(200)
| 字段名 | 类型 | 说明 |
|---|---|---|
| 无结构化响应字段(可能为二进制或无响应体) |