-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
bot triaged[Bot] This issue is triaged by ADK bot[Bot] This issue is triaged by ADK botcore[Component] This issue is related to the core interface and implementation[Component] This issue is related to the core interface and implementation
Description
Is your feature request related to a problem? Please describe.
- I save artifacts to tool context using
tool_context.save_artifact()
when within a tool - Then retrieve it back in the agent using artifact service with session
- The retrieval filters only artifacts for the current session (which is equivalent to conversation)
- But not for the current invocation (which is equivalent to current message within conversation)
Code
# save artifact from a tool
await tool_context.save_artifact(FILENAME, some_data)
# retrieve in agent (e.g. within agent stream fn)
await artifact_service.load_artifact(
app_name=app_name,
user_id=user_id,
session_id=session_id,
filename=FILENAME,
)
Describe the solution you'd like
tool context have invocation id when inside a particular invocation
Describe alternatives you've considered
- I can retrieve and save invocation id to state (using an session event update)
- Use this invocation id from tool call and add to metadata
- Then filter each retrieved artifact using metadata
- A better way would be have invocation id within the tool context
Additional context
N/A
Metadata
Metadata
Assignees
Labels
bot triaged[Bot] This issue is triaged by ADK bot[Bot] This issue is triaged by ADK botcore[Component] This issue is related to the core interface and implementation[Component] This issue is related to the core interface and implementation