Long running streaming (more than 10 minute) #3632
Replies: 1 comment
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: To handle long-running streaming beyond the 10-minute limit, you can leverage ADK's built-in session resumption feature. This allows clients to reconnect to an interrupted stream and continue the conversation seamlessly. Hello! The 10-minute limit you're encountering is a common timeout for long-lived connections to prevent them from hanging indefinitely. The recommended approach to handle this in ADK is to use the session resumption capability. [1] This feature is designed to make streaming conversations more reliable, especially for long-running scenarios or over unreliable network connections. When enabled, the Agent Engine preserves the session state, allowing a client to reconnect and resume the conversation from where it left off. To enable this feature, you need to set from adk.agent import run
from adk.config import RunConfig
# ... your agent definition ...
if __name__ == "__main__":
run(
run_config=RunConfig(
session_resumption=True
)
)On your client application, you would then need to implement logic to automatically re-establish the Server-Sent Events (SSE) connection if it's dropped. When the client reconnects to the same session, ADK will automatically resume the stream. This combination of client-side reconnection and server-side session resumption is the standard way to build robust, long-running streaming experiences with ADK. [1] https://google.github.io/adk-docs/streaming/custom-streaming/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a use case that I need extensive streaming to sustain UX experience on the app. But Agent Engine has 10 minute Sse streaming limit.
How to turnaround?
Beta Was this translation helpful? Give feedback.
All reactions