Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/google/adk/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,18 @@ async def run_async(

Yields:
The events generated by the agent.

Raises:
ValueError: If `new_message` does not have a role of "user" or has no
parts.
ValueError: If the session is not found.
"""

if new_message.role != 'user':
raise ValueError(
f'new_message must have a role of "user", got {new_message.role}'
)

async def _run_with_trace(
new_message: types.Content,
) -> AsyncGenerator[Event, None]:
Expand Down
Loading