Sometimes when my app used Gemini 2.0 Flash to search for online articles, it failed to get the search results and gave this error message in the terminal: ValueError: GenerateContentResponse.text only supports text parts, but got executable_code. How can I fix this issue? Previously, the search part in my code worked well. It was not until yesterday that I began encountering this issue.
Hi @Daozheng_Lin, Welcome to Forum!!!
Are you using old SDK or New SDK?? If possible, Can you share your piece of code where you are using grounding to repro the issue.
Thanks.
Thanks for the reply. It’s no longer a problem now. Later I realized that some of the error messages contain the error code 500, which denotes a server stability issue according to the API docs. Now the search functionality returns to normal.
2 Likes