File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
examples/python/snippets/tools/built-in-tools Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ to use built-in tools with other tools by using multiple agents:
117
117
instruction="""
118
118
You're a specialist in Code Execution
119
119
""",
120
- code_executor=[ BuiltInCodeExecutor] ,
120
+ code_executor=BuiltInCodeExecutor() ,
121
121
)
122
122
root_agent = Agent(
123
123
name="RootAgent",
@@ -204,7 +204,7 @@ to use built-in tools with other tools by using multiple agents:
204
204
model="gemini-2.0-flash",
205
205
description="Root Agent",
206
206
tools=[custom_function],
207
- executor=[ BuiltInCodeExecutor] # <-- not supported when used with tools
207
+ code_executor= BuiltInCodeExecutor() # <-- not supported when used with tools
208
208
)
209
209
```
210
210
@@ -244,7 +244,7 @@ is **not** currently supported:
244
244
instruction="""
245
245
You're a specialist in Code Execution
246
246
""",
247
- executor=[ BuiltInCodeExecutor] ,
247
+ code_executor= BuiltInCodeExecutor() ,
248
248
)
249
249
root_agent = Agent(
250
250
name="RootAgent",
Original file line number Diff line number Diff line change 29
29
code_agent = LlmAgent (
30
30
name = AGENT_NAME ,
31
31
model = GEMINI_MODEL ,
32
- executor = [ BuiltInCodeExecutor ] ,
32
+ code_executor = BuiltInCodeExecutor () ,
33
33
instruction = """You are a calculator agent.
34
34
When given a mathematical expression, write and execute Python code to calculate the result.
35
35
Return only the final numerical result as plain text, without markdown or code blocks.
39
39
40
40
# Session and Runner
41
41
session_service = InMemorySessionService ()
42
- session = session_service .create_session (
42
+ session = asyncio . run ( session_service .create_session (
43
43
app_name = APP_NAME , user_id = USER_ID , session_id = SESSION_ID
44
- )
44
+ ))
45
45
runner = Runner (agent = code_agent , app_name = APP_NAME , session_service = session_service )
46
46
47
47
You can’t perform that action at this time.
0 commit comments