How can I use the Code Execution feature of the Gemini API with the OpenAI Library in Python? Please provide step-by-step instructions and a working code example. Additionally, confirm whether Gemini supports plotting graphs (e.g., using Matplotlib) via Code Execution and highlight any limitations or requirements to be aware of.
Hey @ratchanonth_plumanut , currently, code execution tool is not available in OpenAI compatibility. To use this feature, you will need to utilize the google genai sdk. We have a cookbook available for code_execution, which also supports graph plotting with matplotlib.
For more details on limitations, please refer the doc.
Thank you
Hi, listen carefully — this thread is actually super helpful. I’ve been exploring how to integrate AI into my own work too, and seeing examples like this using OpenAI’s library in Python gives me real hope that it’s doable even outside the traditional tech space.
Right now, I’m working in **[Property Asset Management] “Modified by moderator”, but I seriously want to bring AI into it — whether it’s automating valuations, analyzing trends, or streamlining client communications. I’m not a full-on developer, but I’m learning fast, and posts like this really connect the dots.
Appreciate you sharing this — looking forward to experimenting more with Gemini and OpenAI APIs!