Skip to content

fix: add missing __all__ in init file #32

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sroze
Copy link

@sroze sroze commented Apr 10, 2025

Without it the user will see the following error:

2025-04-10 12:13:29,627 - ERROR - fast_api.py:616 - Error in event_generator: module 'multi_tool_agent.agent' has no attribute 'root_agent'
Traceback (most recent call last):
  File "/Users/sroze/git/adk-agent-test/.venv/lib/python3.13/site-packages/google/adk/cli/fast_api.py", line 604, in event_generator
    runner = _get_runner(req.app_name)
  File "/Users/sroze/git/adk-agent-test/.venv/lib/python3.13/site-packages/google/adk/cli/fast_api.py", line 756, in _get_runner
    root_agent = _get_root_agent(app_name)
  File "/Users/sroze/git/adk-agent-test/.venv/lib/python3.13/site-packages/google/adk/cli/fast_api.py", line 748, in _get_root_agent
    root_agent: Agent = agent_module.agent.root_agent
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Without it the user will see the following error:
```
2025-04-10 12:13:29,627 - ERROR - fast_api.py:616 - Error in event_generator: module 'multi_tool_agent.agent' has no attribute 'root_agent'
Traceback (most recent call last):
  File "/Users/sroze/git/adk-agent-test/.venv/lib/python3.13/site-packages/google/adk/cli/fast_api.py", line 604, in event_generator
    runner = _get_runner(req.app_name)
  File "/Users/sroze/git/adk-agent-test/.venv/lib/python3.13/site-packages/google/adk/cli/fast_api.py", line 756, in _get_runner
    root_agent = _get_root_agent(app_name)
  File "/Users/sroze/git/adk-agent-test/.venv/lib/python3.13/site-packages/google/adk/cli/fast_api.py", line 748, in _get_root_agent
    root_agent: Agent = agent_module.agent.root_agent
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
@polong-lin polong-lin assigned polong-lin and hangfei and unassigned polong-lin Apr 10, 2025
@polong-lin
Copy link
Collaborator

@hangfei is this an issue with the SDK, the docs, or intended behaviour?

@@ -53,7 +53,7 @@ mkdir multi_tool_agent/
Now create an `__init__.py` file in the folder:

```shell
echo "from . import agent" > multi_tool_agent/__init__.py
echo "from . import agent\n\n__all__ = [\"agent\"]" > multi_tool_agent/__init__.py

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better readability, can we split this line into 2-3 lines? (use echo multiple times)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants