feat: add support for session resumption(only transparent mode) config to run_config

This commit adds support for the session resumption configuration in the run_config.
The SessionResumptionConfig is added to RunConfig to allow the user to set up a configuration for session resumption(only transparent mode for now).

There are two modes of session resumption: manual and transparent. In manual mode, you have to manually bookkeeping the session information and restarts the session which is tricky to do right now. In transparent mode, the server does the bookkeeping for you and no hassle on ADK side. For now, the transparent mode should be enough.

Also, added the relevant unit tests to check that every possible configuration is set properly and the run_config is correctly populated.
This is needed for supporting the new session resumption feature.

PiperOrigin-RevId: 786549455
This commit is contained in:
Hangfei Lin
2025-07-23 21:37:00 -07:00
committed by Copybara-Service
parent 16392984c5
commit 5e8aa15a50
4 changed files with 595 additions and 0 deletions
+1
View File
@@ -309,6 +309,7 @@ class MockModel(BaseLlm):
@contextlib.asynccontextmanager
async def connect(self, llm_request: LlmRequest) -> BaseLlmConnection:
"""Creates a live connection to the LLM."""
self.requests.append(llm_request)
yield MockLlmConnection(self.responses)