curl --location -g --request POST '{{base_url}}/v1beta/models/{{model}}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"inlineData": {
"mimeType": "application/pdf",
"data": pdf_b64 # 使用读取的PDF数据,而不是硬编码
}
},
{
"text": "这个pdf是什么,已json的格式返回"
}
]
}
],
"generationConfig": {
"topK": 32,
"responseSchema": {
"type": "object",
"properties": {
"result": {
"type": "string"
}
},
"required": [
"result"
]
},
"thinkingConfig": {
"thinkingBudget": 0
},
"temperature": 0.1,
"responseMimeType": "application/json",
"maxOutputTokens": 65535,
"topP": 0.95
}
}'