feat(v2 managed agents): add AgentList and SessionList typed models

Used by the new GET /v2/agents and GET /v2/agents/:agent_id/sessions
listing endpoints. Each list response carries data + next_cursor + has_more
for simple offset-based pagination.
This commit is contained in:
Ishaan Jaffer 2026-05-07 12:01:09 -07:00
parent e00a6e92b2
commit ef9bfa6f68
No known key found for this signature in database

View file

@ -63,6 +63,19 @@ class AgentRow(BaseModel):
updated_at: datetime
class AgentList(BaseModel):
"""Paginated list response for `GET /v2/agents`.
`config.litellm_api_key` is masked on each row in `data`.
"""
model_config = ConfigDict(extra="allow")
data: List[AgentRow]
next_cursor: Optional[str] = None
has_more: bool = False
# ---------------------------------------------------------------------------
# Sandbox / session
# ---------------------------------------------------------------------------
@ -137,6 +150,16 @@ class SessionRow(BaseModel):
terminated_at: Optional[datetime] = None
class SessionList(BaseModel):
"""Paginated list response for `GET /v2/agents/:id/sessions`."""
model_config = ConfigDict(extra="allow")
data: List[SessionRow]
next_cursor: Optional[str] = None
has_more: bool = False
# ---------------------------------------------------------------------------
# Message
# ---------------------------------------------------------------------------