> For the complete documentation index, see [llms.txt](https://docs.boltai.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.boltai.com/docs/plugins/gemini-code-execution.md).

# Gemini Code Execution

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...](https://ai.google.dev/gemini-api/docs/code-execution?lang=python#limitations)

### How to set up the Gemini Code Execution plugin?

No configuration is required for this plugin. However this plugin can only be used with the Gemini model from Google AI.

### How to use the Gemini Code Execution plugin?

1. 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&#x20;
2. Enable the plugin.
3. Enter your prompt.

It should look something like this

<figure><img src="/files/tyiASEkyoJ3LZydKITVc" alt=""><figcaption><p>Gemini Code Execution in BoltAI</p></figcaption></figure>

### Limitation

These are limitations from the official [Google documentation](https://ai.google.dev/gemini-api/docs/code-execution?lang=python#limitations)

* 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.
