You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
** Please make sure you read the contribution guide and file the issues in the right place. ** Contribution guide.
Describe the bug
BuiltInCodeExecutor when imported from from google.adk.code_executors and added inside Agent declaration like below:
code_agent = LlmAgent(
name=AGENT_NAME,
model=GEMINI_MODEL,
executor=[BuiltInCodeExecutor],
instruction="""You are a calculator agent.
When given a mathematical expression, write and execute Python code to calculate the result.
Return only the final numerical result as plain text, without markdown or code blocks.
""",
description="Executes Python code to perform calculations.",
)
Its throwing the error: Extra inputs are not permitted [type=extra_forbidden, input_value=[<class 'google.adk.code_...r.BuiltInCodeExecutor'>], input_type=list]
For further information visit https://errors.pydantic.dev/2.10/v/extra_forbidden
To Reproduce
Steps to reproduce the behavior:
Install google-adk
Import BuiltInCodeExecutor from google.adk.code_executors and use it like mentioned in the description
Compile and Run
See error
Expected behavior
There should be no errors and should be able to use BuiltInCodeExecutor as mentioned in the adk docs.
Screenshots
Desktop (please complete the following information):
OS: Windows 11
Python version(python -V): 3.11.3
ADK version(pip show google-adk): 1.0.0
Additional context
Add any other context about the problem here.
Activity
boyangsvl commentedon May 23, 2025
Please look up the definition of the code_executor field here and correct your code: https://github.com/google/adk-python/blob/main/src/google/adk/agents/llm_agent.py#L197