I encountered unexpected behavior with the generateContent endpoint in Gemini 2.5 Pro.
I sent a request including: file_search tool and a list of function_declarations
Instead of performing file_search, the model returned:
“functionCall”: { “name”: “query”, … }
Note that “query” is not in my list of function_declarations.
Interestingly, when I send the same request without function_declarations, the model executes file_search correctly.
My questions:
-
Why does the model return a function_call (
query) that I did not define in my request - function_declarations, instead of using thefile_searchtool? -
Currently, Code Execution is not supported together with
function_declarationsin a single request. Will this be supported in the future?