feat: Support return all sessions when user id is none

PiperOrigin-RevId: 819884236
This commit is contained in:
Shangjie Chen
2025-10-15 13:14:24 -07:00
committed by Copybara-Service
parent b650181384
commit a985cc38ec
6 changed files with 147 additions and 40 deletions
@@ -83,9 +83,18 @@ class BaseSessionService(abc.ABC):
@abc.abstractmethod
async def list_sessions(
self, *, app_name: str, user_id: str
self, *, app_name: str, user_id: Optional[str] = None
) -> ListSessionsResponse:
"""Lists all the sessions."""
"""Lists all the sessions for a user.
Args:
app_name: The name of the app.
user_id: The ID of the user. If not provided, lists all sessions for all
users.
Returns:
A ListSessionsResponse containing the sessions.
"""
@abc.abstractmethod
async def delete_session(