mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-15 23:31:29 +00:00
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:
parent
e00a6e92b2
commit
ef9bfa6f68
1 changed files with 23 additions and 0 deletions
|
|
@ -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
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue