Skip to content

Documentation: StoryFlowAgent example is not runnable due to missing async/await #379

@merdandt

Description

@merdandt

Page: https://google.github.io/adk-docs/agents/custom-agents/#full-code-example

Description:

The "Full runnable code for the StoryFlowAgent example" is not runnable as provided because it incorrectly mixes synchronous and asynchronous code.

The session_service methods (create_session, get_session) are asynchronous and need to be awaited. This requires the functions calling them to be defined as async def and awaited at the top level to function correctly.

Required Fixes:

  1. The call_agent function signature should be async def call_agent(...).
  2. The session_service.create_session(...) call must be awaited.
  3. All session_service.get_session(...) calls must be awaited.
  4. The final execution call must be changed to await call_agent(...).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions