8000 fix: Use await to wait for the full list rather than async for which… · luaifei/adk-python@f96cdc6 · GitHub
[go: up one dir, main page]

Skip to content

Commit f96cdc6

Browse files
DeanChensjcopybara-github
authored andcommitted
fix: Use await to wait for the full list rather than async for which only works for async iterable.
PiperOrigin-RevId: 755541004
1 parent 1393965 commit f96cdc6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/google/adk/tools/agent_tool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ async def run_async(
146146

147147
if runner.artifact_service:
148148
# Forward all artifacts to parent session.
149-
async for artifact_name in runner.artifact_service.list_artifact_keys(
149+
artifact_names = await runner.artifact_service.list_artifact_keys(
150150
app_name=session.app_name,
151151
user_id=session.user_id,
152152
session_id=session.id,
153-
):
153+
)
154+
for artifact_name in artifact_names:
154155
if artifact := await runner.artifact_service.load_artifact(
155156
app_name=session.app_name,
156157
user_id=session.user_id,

0 commit comments

Comments
 (0)
0