curl --location --request POST 'https://router.shengsuanyun.com/api/v1/models/:streamGenerateContent?alt=sse&key=<api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "string",
"inlineData": {
"mimeType": "image/jpeg",
"data": "string"
},
"fileData": {
"mimeType": "string",
"fileUri": "https://generativelanguage.googleapis.com/v1beta/files/abc123"
},
"functionCall": {
"name": "string",
"args": {}
},
"functionResponse": {
"name": "string",
"response": {}
},
"thought": true,
"executableCode": {
"language": "PYTHON",
"code": "string"
},
"codeExecutionResult": {
"outcome": "OUTCOME_OK",
"output": "string"
}
}
]
}
],
"systemInstruction": {
"role": "user",
"parts": [
{
"text": "string",
"inlineData": {
"mimeType": "image/jpeg",
"data": "string"
},
"fileData": {
"mimeType": "string",
"fileUri": "https://generativelanguage.googleapis.com/v1beta/files/abc123"
},
"functionCall": {
"name": "string",
"args": {}
},
"functionResponse": {
"name": "string",
"response": {}
},
"thought": true,
"executableCode": {
"language": "PYTHON",
"code": "string"
},
"codeExecutionResult": {
"outcome": "OUTCOME_OK",
"output": "string"
}
}
]
},
"generationConfig": {
"temperature": 0.9,
"topP": 1,
"topK": 40,
"maxOutputTokens": 2048,
"candidateCount": 1,
"stopSequences": [
"string"
],
"responseMimeType": "text/plain",
"responseSchema": {},
"presencePenalty": -2,
"frequencyPenalty": -2,
"responseLogprobs": false,
"logprobs": 0,
"seed": 0,
"responseModalities": [
"TEXT"
],
"thinkingConfig": {
"includeThoughts": false,
"thinkingBudget": 5000
}
},
"safetySettings": [
{
"category": "HARM_CATEGORY_HARASSMENT",
"threshold": "HARM_BLOCK_THRESHOLD_UNSPECIFIED"
}
],
"tools": [
{
"functionDeclarations": [
{
"name": "string",
"description": "string",
"parameters": {}
}
],
"googleSearch": {},
"googleSearchRetrieval": {},
"codeExecution": {}
}
],
"toolConfig": {
"functionCallingConfig": {
"mode": "AUTO",
"allowedFunctionNames": [
"string"
]
}
},
"cachedContent": "cachedContents/abc123"
}'