mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
managed agents: add mcp_servers to AgentCreate/Out/Update
mcp_servers is a list of MCP server identifiers an agent is bound to. On AgentUpdate it's replace-style: passing [] clears, omitting it is a no-op (matches the existing pfp_url empty-string-clears semantic).
This commit is contained in:
parent
33f508a6b6
commit
e4d2a1152b
1 changed files with 8 additions and 1 deletions
|
|
@ -81,17 +81,23 @@ class AgentCreate(BaseModel):
|
|||
litellm_api_key: Optional[str] = None
|
||||
litellm_api_base: Optional[str] = None
|
||||
pfp_url: Optional[str] = None
|
||||
mcp_servers: List[str] = Field(default_factory=list)
|
||||
|
||||
|
||||
class AgentUpdate(BaseModel):
|
||||
"""Partial update — every field is optional. Only provided fields are
|
||||
written. Setting a string field to "" clears it; null is treated as
|
||||
no-op (field absent in the request)."""
|
||||
no-op (field absent in the request).
|
||||
|
||||
mcp_servers is replace-style: passing an empty list clears the binding;
|
||||
omitting it leaves the existing list untouched.
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
name: Optional[str] = None
|
||||
pfp_url: Optional[str] = None
|
||||
mcp_servers: Optional[List[str]] = None
|
||||
|
||||
|
||||
class AgentOut(BaseModel):
|
||||
|
|
@ -104,6 +110,7 @@ class AgentOut(BaseModel):
|
|||
template_id: str
|
||||
branch: str
|
||||
pfp_url: Optional[str] = None
|
||||
mcp_servers: List[str] = Field(default_factory=list)
|
||||
created_at: Optional[datetime] = None
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue