Gemini 2 flash API returns raw markdown instead of function call

Sometimes, the gemini 2 flash API returns a raw markdown like the one below as a message content instead of a proper function call

```tool_code
print(default_api.some_tool(some_arg = "...")

This often happens during extended conversations that have many function calls. This same issue has also been reported by other users: https://www.reddit.com/r/Bard/comments/1isf7p5/problems_with_gemini20flash_tools/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

I use Vertex AI, so I’ve only personally encountered this issue on vertex AI