Gemini Code Execution
Last updated
Last updated
The Gemini API code execution feature enables the model to generate and run Python code and learn iteratively from the results until it arrives at a final output. Learn more...
No configuration is required for this plugin. However this plugin can only be used with the Gemini model from Google AI.
Start a new chat with Google AI provider. Select a model that supports Function Calling. Gemini 1.5 Pro performs the best according to Google
Enable the plugin.
Enter your prompt.
It should look something like this
These are limitations from the official Google documentation
The model can only generate and execute code. It can't return other artifacts like media files.
The feature doesn't support file I/O or use cases that involve non-text output (for example, data plots or a CSV file upload).
Code execution can run for a maximum of 30 seconds before timing out.
In some cases, enabling code execution can lead to regressions in other areas of model output (for example, writing a story).
There is some variation in the ability of the different models to use code execution successfully. Gemini 1.5 Pro is the best performing model, based on our testing.