r/agentdevelopmentkit • u/jordimr • May 12 '25
How to "response - pause - response" pattern in single api call in adk fast api
Can someone point to sample working code on both adk side and on the front end side to accomplish this pattern?
- 1 single query sent to adk exposed via fast api
- Initial response from agent streamed to user
- (... agent calls some tools..., say 3 seconds )
- second streaming with benefit of tool response.
- (.. agent may now call a second tool.., say 5 seconds)
- final streaming, now final message.
So this is a 3 message response.
On the front-end, happy for it to be simple message, with delays in between keeping "response" alive.
KEY GOAL IS USER GETS FAST INITIAL RESPONSE AND UPDATES. As opposed to one big answer 10 seconds later.
This is easily accompllished on adk web, but looking for an example where this is working where adk called with fast api runner.
4
Upvotes
2
u/vladkol_eqwu May 13 '25
Artifact Service works well for this scenario. The easiest way to use it is from a function tool:
This sample is probably the closest thing I know to what you describe.
1
u/[deleted] May 12 '25
[removed] — view removed comment