run_config.save_input_blobs_as_artifacts not respected.
Describe the bug Attempting to set the RunConfig.save_input_blobs_as_artifacts has no effect.
To Reproduce using an exact replica of fast_api.py, updating /run_see to use the RunConfig.save_input_blobs_as_artifacts = True has no effect.
`@app.post("/run_sse") async def agent_run_sse(req: AgentRunRequest) -> StreamingResponse: # Connect to managed session if agent_engine_id is set. app_id = agent_engine_id if agent_engine_id else req.app_name # SSE endpoint session = session_service.get_session( app_name=app_id, user_id=req.user_id, session_id=req.session_id ) if not session: raise HTTPException(status_code=404, detail="Session not found")
async def event_generator():
try:
stream_mode = StreamingMode.SSE if req.streaming else StreamingMode.NONE
runner = await _get_runner_async(req.app_name)
run_config = RunConfig(streaming_mode=stream_mode, save_input_blobs_as_artifacts=True)
async for event in runner.run_async(
user_id=req.user_id,
session_id=req.session_id,
new_message=req.new_message,
run_config=run_config
):
# Format as SSE data
sse_event = event.model_dump_json(exclude_none=True, by_alias=True)
logger.info("Generated event in agent run streaming: %s", sse_event)
yield f"data: {sse_event}\n\n"
except Exception as e:
logger.exception("Error in event_generator: %s", e)
# You might want to yield an error event here
yield f'data: {{"error": "{str(e)}"}}\n\n'
# Returns a streaming response with the proper media type for SSE
return StreamingResponse(
event_generator(),
media_type="text/event-stream",
)`
Expected behavior Blobs added as attachments are saved to artifacts when using adk web
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- Python version(python -V): 3.12
- ADK version(pip show google-adk): 0.5.0
They don't show up on the UI but they do get saved as artifacts in my experience? If you run a list_artifacts in, say, a callback you can see them.
Thanks @simond for your help. @Datise could you check if that works for you?
It does save the blob. Maybe this issue is more about the devUI since I can't see them even after page refresh. It would be nice to know since I forked the dev ui to jumpstart my own frontend and this confuses me all the time. Is there an event I can manually publish or something?
Feel free to do what you want with this.
Hi @wyf7107 , I don't have the permission to migrate this issue to adk-web, I think this ticket is more about adding Web UI support for showing all the artifacts.
@jfzeng00 help to take a look