feat! Update session service interface to be async.

Also keep the sync version in the InMemorySessionService as create_session_sync() as a temporary migration option.

PiperOrigin-RevId: 759224250
This commit is contained in:
Shangjie Chen
2025-05-15 11:16:43 -07:00
committed by Copybara-Service
parent d161a2c3f7
commit 5b3204c356
23 changed files with 264 additions and 268 deletions

View File

@@ -31,7 +31,7 @@ async def test_no_examples():
config=types.GenerateContentConfig(system_instruction=""),
)
agent = Agent(model="gemini-1.5-flash", name="agent", examples=[])
invocation_context = utils.create_invocation_context(
invocation_context = await utils.create_invocation_context(
agent=agent, user_content=""
)
@@ -69,7 +69,7 @@ async def test_agent_examples():
name="agent",
examples=example_list,
)
invocation_context = utils.create_invocation_context(
invocation_context = await utils.create_invocation_context(
agent=agent, user_content="test"
)
@@ -122,7 +122,7 @@ async def test_agent_base_example_provider():
name="agent",
examples=provider,
)
invocation_context = utils.create_invocation_context(
invocation_context = await utils.create_invocation_context(
agent=agent, user_content="test"
)