跳到主要内容

Gemini媒体识别

POST /v1beta/models/{model}:generateContent

请求参数​

参数名类型必选说明
model (path)string必选模型名称
contentsarray<object>可选-
contents[].rolestring可选-
contents[].partsarray<object>可选-
contents[].parts[].textstring可选-
contents[].parts[].inlineDataobject可选-
generationConfigobject可选-
generationConfig.temperaturenumber可选-
generationConfig.topPnumber可选-
generationConfig.topKinteger可选-
generationConfig.maxOutputTokensinteger可选-
generationConfig.stopSequencesarray<string>可选-
safetySettingsarray<object>可选-
safetySettings[].categorystring可选-
safetySettings[].thresholdstring可选-
toolsarray<object>可选-
systemInstructionobject可选-
systemInstruction.partsarray<object>可选-

请求示例​

{
"path": {
"model": "string"
},
"body": {}
}

响应字段(200)​

字段名类型说明
无结构化响应字段(可能为二进制或无响应体)