chore:add in memory session service to in memory runner.

PiperOrigin-RevId: 759206471
This commit is contained in:
Ankur Sharma 2025-05-15 10:34:44 -07:00 committed by Copybara-Service
parent 3ea9eca929
commit 95f994d7ca

View File

@ -481,6 +481,8 @@ class InMemoryRunner(Runner):
agent: The root agent to run. agent: The root agent to run.
app_name: The application name of the runner. Defaults to app_name: The application name of the runner. Defaults to
'InMemoryRunner'. 'InMemoryRunner'.
_in_memory_session_service: Deprecated. Please don't use. The in-memory
session service for the runner.
""" """
def __init__(self, agent: LlmAgent, *, app_name: str = 'InMemoryRunner'): def __init__(self, agent: LlmAgent, *, app_name: str = 'InMemoryRunner'):
@ -491,10 +493,11 @@ class InMemoryRunner(Runner):
app_name: The application name of the runner. Defaults to app_name: The application name of the runner. Defaults to
'InMemoryRunner'. 'InMemoryRunner'.
""" """
self._in_memory_session_service = InMemorySessionService()
super().__init__( super().__init__(
app_name=app_name, app_name=app_name,
agent=agent, agent=agent,
artifact_service=InMemoryArtifactService(), artifact_service=InMemoryArtifactService(),
session_service=InMemorySessionService(), session_service=self._in_memory_session_service,
memory_service=InMemoryMemoryService(), memory_service=InMemoryMemoryService(),
) )