文本生成+思考-流
接口: POST https://4zapi.com/v1beta/models/gemini-3.8-flash:streamGenerateContent
官方文档:https://ai.google.dev/gemini-api/docs/text-generation?hl=zh-cn#multi-turn-conversations
参数
key(query, string, 必填)alt(query, string)Content-Type(header, string, 必填)
请求体 (application/json)
contents(array<object>, 必填)
请求示例
{
"contents": [
{
"parts": [
{
"text": "1+2+3+4+5+....+999?"
}
],
"role": "user"
}
],
"generationConfig": {
"temperature": 1,
"thinkingConfig": {
"includeThoughts": true,
"thinkingBudget": 26240
},
"topP": 1
},
"safetySettings": [
{
"category": "HARM_CATEGORY_HATE_SPEECH",
"threshold": "OFF"
},
{
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
"threshold": "OFF"
},
{
"category": "HARM_CATEGORY_HARASSMENT",
"threshold": "OFF"
},
{
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"threshold": "OFF"
},
{
"category": "HARM_CATEGORY_CIVIC_INTEGRITY",
"threshold": "BLOCK_NONE"
}
],
"systemInstruction": {
"parts": [
{
"text": "hi"
}
],
"role": "user"
},
"tools": []
}