Skip to content

Commit bf8b85d

Browse files
GWealecopybara-github
authored andcommitted
fix: save sessions with camelCase aliases
Make sure that the adk run --save_session writes session JSON using the Pydantic camelCase aliases (by_alias=True), matching ADK Web and keeping session files consistent Close #3558 Co-authored-by: George Weale <gweale@google.com> PiperOrigin-RevId: 834847209
1 parent caf23ac commit bf8b85d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/google/adk/cli/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ async def run_cli(
218218
session_id=session.id,
219219
)
220220
with open(session_path, 'w', encoding='utf-8') as f:
221-
f.write(session.model_dump_json(indent=2, exclude_none=True))
221+
f.write(
222+
session.model_dump_json(indent=2, exclude_none=True, by_alias=True)
223+
)
222224

223225
print('Session saved to', session_path)

0 commit comments

Comments
 (0)