I am using Gemini’s1.5 streaming interface with Function Calling, the request is as follows:
{
"contents" : [
{
"role" : "user",
"parts" : [
{
"text" : "What is the weather like in London"
}
]
}
],
"tools" : [
{
"function_declarations" : [
{
"name" : "get_current_weather",
"description" : "Get the current weather in a given location",
"parameters" : {
"type" : "object",
"properties" : {
"location" : {
"type" : "string",
"description" : "The city and state, e.g. San Francisco, CA"
},
"unit" : {
"type" : "string",
"enum" : [
"celsius",
"fahrenheit"
]
}
},
"required" : [
"location"
]
}
}
]
}
],
"generationConfig" : {
"maxOutputTokens" : 1024
}
}
URI: /v1beta/models/gemini-1.5-pro:streamGenerateContent
The response result is throwing an error:
[{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
]
type or paste code here
It works fine with the non-streaming interface, is there something misconfigured somewhere?