feat: Add --session_id option to adk run:

--session_id : The session ID to save the session to on exit when --save_session is set to true. User will be prompted to enter a session ID if not set.

PiperOrigin-RevId: 756335619
This commit is contained in:
Google Team Member
2025-05-08 09:06:38 -07:00
committed by Copybara-Service
parent 41564de689
commit a61d20e3df
2 changed files with 14 additions and 1 deletions
+11
View File
@@ -122,6 +122,15 @@ def validate_exclusive(ctx, param, value):
default=False,
help="Optional. Whether to save the session to a json file on exit.",
)
@click.option(
"--session_id",
type=str,
help=(
"Optional. The session ID to save the session to on exit when"
" --save_session is set to true. User will be prompted to enter a"
" session ID if not set."
),
)
@click.option(
"--replay",
type=click.Path(
@@ -156,6 +165,7 @@ def validate_exclusive(ctx, param, value):
def cli_run(
agent: str,
save_session: bool,
session_id: Optional[str],
replay: Optional[str],
resume: Optional[str],
):
@@ -179,6 +189,7 @@ def cli_run(
input_file=replay,
saved_session_file=resume,
save_session=save_session,
session_id=session_id,
)
)