diff --git a/src/google/adk/cli/cli.py b/src/google/adk/cli/cli.py index 6d267de..d23cd7e 100644 --- a/src/google/adk/cli/cli.py +++ b/src/google/adk/cli/cli.py @@ -96,6 +96,7 @@ async def run_interactively( if event.content and event.content.parts: if text := ''.join(part.text or '' for part in event.content.parts): click.echo(f'[{event.author}]: {text}') + await runner.close() async def run_cli( @@ -145,7 +146,7 @@ async def run_cli( input_path=input_file, ) elif saved_session_file: - with open(saved_session_file, 'r') as f: + with open(saved_session_file, 'r', encoding='utf-8') as f: loaded_session = Session.model_validate_json(f.read()) if loaded_session: @@ -184,7 +185,7 @@ async def run_cli( user_id=session.user_id, session_id=session.id, ) - with open(session_path, 'w') as f: + with open(session_path, 'w', encoding='utf-8') as f: f.write(session.model_dump_json(indent=2, exclude_none=True)) print('Session saved to', session_path)