Skip to content

Fix long running tool to handle list objects #68

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

ShyamSathish005
Copy link

Fixes #63

Fix the TypeError: cannot pickle 'generator' object by updating the LongRunningFunctionTool and Runner class to handle list objects instead of generator objects.

  • src/google/adk/tools/long_running_tool.py

    • Update LongRunningFunctionTool to handle list objects instead of generator objects.
    • Add run_async method to convert generator results to list.
  • src/google/adk/tests/unittests/tools/test_long_running_tool.py

    • Add unit tests for LongRunningFunctionTool to ensure it handles list objects and generator objects properly.
  • src/google/adk/tests/unittests/runners/test_runner.py

    • Add unit tests for Runner class to ensure it accounts for list objects in its run_async method.

Fixes google#63

Fix the `TypeError: cannot pickle 'generator' object` by updating the `LongRunningFunctionTool` and `Runner` class to handle list objects instead of generator objects.

* **src/google/adk/tools/long_running_tool.py**
  - Update `LongRunningFunctionTool` to handle list objects instead of generator objects.
  - Add `run_async` method to convert generator results to list.

* **src/google/adk/tests/unittests/tools/test_long_running_tool.py**
  - Add unit tests for `LongRunningFunctionTool` to ensure it handles list objects and generator objects properly.

* **src/google/adk/tests/unittests/runners/test_runner.py**
  - Add unit tests for `Runner` class to ensure it accounts for list objects in its `run_async` method.
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.

TypeError: cannot pickle 'generator' object
1 participant