-
Notifications
You must be signed in to change notification settings - Fork 751
when i try to run it i get module 'multi_tool_agent.agent' has no attribute 'root_agent' #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
as of yet, the root agent should be named as root_agent, there's something wrong with the sample codes that google have documented. That's how I was able to rectify this issue. |
I've opened a PR to help with this documentation in the adk-docs repo: |
In the screen shot it looks like you have one called agent_ollama_gemma. the agent variable you reference in the init.py file needs to have the same name as the agent.py file has. In the sample app that we were using, the exported agent was called root_agent. In your case it looks to be agent_ollama_gemma, unless you have another agent you are trying to use. |
Thanks its working now :) , one more Question , why its soo slow , like i am running it on my M4 Pro mac book , i am running small model to test , and its taking ages to reply ? is it common ? is there a way to make it respond fast ? |
I haven't run your model so I can't say. I have noted the configuration and driver setup on a machine can impact how it uses your GPU or only runs on CPU. You can try searching for how to optimize running local models. https://www.arsturn.com/blog/tips-for-speeding-up-ollama-performance may help. Otherwise look at the other notes on ollama's site for help. |
I think the original issue is resolved. Closing now. Feel free to re-open. |
I'm getting a circular import error in this which is strange. Any idea what could be wrong?
|
I fixed the circular import by using an absolute import:
Instead of a relative import:
Note that my agent.py is inside the src/ folder in my repo root. |
i am running it on mac m4
python = 3.11
here is the log
(adk) u@us-MacBook-Pro adk % adk run multi_tool_agent
Log setup complete: /var/folders/fq/k9567j_n5tz59hz7_whwfdtm0000gn/T/agents_log/agent.20250411_080357.log
To access latest log: tail -F /var/folders/fq/k9567j_n5tz59hz7_whwfdtm0000gn/T/agents_log/agent.latest.log
Traceback (most recent call last):
File "/opt/anaconda3/envs/adk/bin/adk", line 8, in
sys.exit(main())
^^^^^^
File "/opt/anaconda3/envs/adk/lib/python3.11/site-packages/click/core.py", line 1161, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/adk/lib/python3.11/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/adk/lib/python3.11/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/adk/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/adk/lib/python3.11/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/adk/lib/python3.11/site-packages/google/adk/cli/cli_tools_click.py", line 78, in cli_run
asyncio.run(
File "/opt/anaconda3/envs/adk/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/adk/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/adk/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/adk/lib/python3.11/site-packages/google/adk/cli/cli.py", line 127, in run_cli
root_agent = agent_module.agent.root_agent
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'multi_tool_agent.agent' has no attribute 'root_agent'
The text was updated successfully, but these errors were encountered: