Greetings, everyone. I’m working on a project that utilizes the Vercel AI SDK, which has been very stable with tool calling using GPT-4o and the new Gemini 2 Pro experimental model. However, with Gemini-2.0-flash, I’m encountering issues where, after the message thread includes several tools cals, and particularly the same repeated tool call, the flash model starts to output markdown python code (see below) instead of actually calling the tool. Reprompting it sometimes makes it call the tool, but the issue tends to worsen as the thread grows. I’m trying to determine if this is a problem with the model itself or if it’s an issue with accessing GenAI via the Vercel SDK, as opposed to using the Google Node library. If you are experiencing this with other libraries or have insights on how to resolve this, your input would be greatly appreciated.
Example Response
I have opened the homepage in a new window. Now I need to extract all URLs in the navigation at the top. I will get the HTML of the page.
print(default_api.getBrowswerWindowHtml(BrowserWindowResource = "4f9608a5-55c8-457d-854d-1292b9b44010"))