mirror of
https://github.com/google/adk-docs.git
synced 2026-09-14 16:16:59 +08:00
7c8ffc080e
* docs: single source extensions listings * docs: add infrastructure and updates for catalog * updates: feedback responses, third party and gemini * fix: update Python code
1.1 KiB
1.1 KiB
catalog_title, catalog_description, catalog_icon
| catalog_title | catalog_description | catalog_icon |
|---|---|---|
| Code Execution | Execute code and debug using Gemini models | /adk-docs/assets/tools-gemini-spark.svg |
Code Execution with Gemini API
Supported in ADKPython v0.1.0Java v0.2.0
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"
```