8000 chore: Fixes the main.py for memory/agent.py sample. · nag763/adk-python@3f21a52 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f21a52

Browse files
Jacksunweicopybara-github
authored andcommitted
chore: Fixes the main.py for memory/agent.py sample.
PiperOrigin-RevId: 760741263
1 parent 7445417 commit 3f21a52

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

contributing/samples/memory/asyncio_run.py renamed to contributing/samples/memory/main.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from datetime import datetime
1717
from datetime import timedelta
1818
from typing import cast
19-
import warnings
2019

2120
import agent
2221
from dotenv import load_dotenv
@@ -26,7 +25,6 @@
2625
from google.genai import types
2726

2827
load_dotenv(override=True)
29-
warnings.filterwarnings('ignore', category=UserWarning)
3028
logs.log_to_tmp_folder()
3129

3230

@@ -67,12 +65,12 @@ async def run_prompt(session: Session, new_message: str) -> Session:
6765

6866
return cast(
6967
Session,
70-
runner.session_service.get_session(
68+
await runner.session_service.get_session(
7169
app_name=app_name, user_id=user_id_1, session_id=session.id
7270
),
7371
)
7472

75-
session_1 = runner.session_service.create_session(
73+
session_1 = await runner.session_service.create_session(
7674
app_name=app_name, user_id=user_id_1
7775
)
7876

@@ -93,7 +91,7 @@ async def run_prompt(session: Session, new_message: str) -> Session:
9391
await runner.memory_service.add_session_to_memory(session_1)
9492
print('-------------------------------------------------------------------')
9593

96-
session_2 = runner.session_service.create_session(
94+
session_2 = await runner.session_service.create_session(
9795
app_name=app_name, user_id=user_id_1
9896
)
9997
print(f'----Session to use memory: {session_2.id} ----------------------')

0 commit comments

Comments
 (0)
0