From fbb8feb7a05a86e3197af3df455694724468b4d9 Mon Sep 17 00:00:00 2001 From: Akshay Kumar BM <90820098+akshay-kumar-bm@users.noreply.github.com> Date: Fri, 27 Mar 2026 18:50:02 +0000 Subject: [PATCH 1/2] fix: Enhance session model with detailed field descriptions and examples --- src/google/adk/sessions/session.py | 38 +++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/src/google/adk/sessions/session.py b/src/google/adk/sessions/session.py index 24d200efdbd..8ec842d99d3 100644 --- a/src/google/adk/sessions/session.py +++ b/src/google/adk/sessions/session.py @@ -36,18 +36,44 @@ class Session(BaseModel): ) """The pydantic model config.""" - id: str + id: str = Field( + description="Unique identifier of the session.", + examples=["session-abc123"], + ) """The unique identifier of the session.""" - app_name: str + app_name: str = Field( + description="Application name that owns the session.", + examples=["hello_world"], + ) """The name of the app.""" - user_id: str + user_id: str = Field( + description="User ID that owns the session.", + examples=["user-123"], + ) """The id of the user.""" - state: dict[str, Any] = Field(default_factory=dict) + state: dict[str, Any] = Field( + default_factory=dict, + description="Current persisted session state.", + examples=[{"locale": "en-US"}], + ) """The state of the session.""" - events: list[Event] = Field(default_factory=list) + events: list[Event] = Field( + default_factory=list, + description=( + "Ordered event history for the session, including user, model, and" + " tool events." + ), + examples=[[]], + ) """The events of the session, e.g. user input, model response, function call/response, etc.""" - last_update_time: float = 0.0 + last_update_time: float = Field( + default=0.0, + description=( + "Unix timestamp in seconds for the most recent session update." + ), + examples=[1_742_000_000.0], + ) """The last update time of the session.""" _storage_update_marker: str | None = PrivateAttr(default=None) From 04ea27ea8ea2d893a97c72b100edaff46afca03d Mon Sep 17 00:00:00 2001 From: Akshay Kumar BM <90820098+akshay-kumar-bm@users.noreply.github.com> Date: Wed, 1 Apr 2026 15:53:06 +0000 Subject: [PATCH 2/2] docs(api): improve endpoint grouping and SSE docs rendering --- src/google/adk/sessions/session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/adk/sessions/session.py b/src/google/adk/sessions/session.py index 8ec842d99d3..34de18a27b2 100644 --- a/src/google/adk/sessions/session.py +++ b/src/google/adk/sessions/session.py @@ -29,7 +29,7 @@ class Session(BaseModel): """Represents a series of interactions between a user and agents.""" model_config = ConfigDict( - extra='forbid', + extra="forbid", arbitrary_types_allowed=True, alias_generator=alias_generators.to_camel, populate_by_name=True,