Files
google__adk-docs/docs/tools/gemini-api/code-execution.md
Joe Fernandez 90ef1a65dc Reorganize Built-In tools, Cloud, and Gemini tools pages (#1085)
* Reorg third-party tools pages (#1084)

* respond to review comments

---------

Co-authored-by: Kristopher Overholt <koverholt@google.com>
2025-12-19 09:59:23 -08:00

28 lines
959 B
Markdown

# Code Execution with Gemini API
<div class="language-support-tag">
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python v0.1.0</span><span class="lst-java">Java v0.2.0</span>
</div>
The `built_in_code_execution` tool enables the agent to execute code,
specifically when using Gemini 2 and higher models. This allows the model to
perform tasks like calculations, data manipulation, or running small scripts.
!!! warning "Warning: Single tool per agent limitation"
This tool can only be used ***by itself*** within an agent instance.
For more information about this limitation and workarounds, see
[Limitations for ADK tools](/adk-docs/tools/limitations/#one-tool-one-agent).
=== "Python"
```py
--8<-- "examples/python/snippets/tools/built-in-tools/code_execution.py"
```
=== "Java"
```java
--8<-- "examples/java/snippets/src/main/java/tools/CodeExecutionAgentApp.java:full_code"
```