Get json with live internet search [Gemini 2.5 Pro)

Hi, when I enable web search - then using structured api answer is not possible. I accepted it and did it via instructions + promt. But sometimes it doesn’t listen to instructions (when it gives not what I need regarding information, for example, it abbreviates, and when it gives not in json format).

Has anyone encountered this? Maybe it is possible to implement something else on top of it? Some solution from github maybe