managed agents: add pfp_url to AgentCreate/Out and AgentUpdate

AgentCreate accepts an optional pfp_url; AgentOut surfaces it on read.
New AgentUpdate model is the body shape for PATCH /agents/{id} —
extra='forbid' so unknown fields 422 instead of being silently
ignored. Both 'name' and 'pfp_url' use empty-string-as-clear semantics
(null/absent = no-op).
This commit is contained in:
Ishaan Jaffer 2026-05-07 16:52:56 -07:00
parent 8855bb7da4
commit 7ec15bd008
No known key found for this signature in database

View file

@ -80,6 +80,18 @@ class AgentCreate(BaseModel):
branch: Optional[str] = None
litellm_api_key: Optional[str] = None
litellm_api_base: Optional[str] = None
pfp_url: Optional[str] = None
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)."""
model_config = ConfigDict(extra="forbid")
name: Optional[str] = None
pfp_url: Optional[str] = None
class AgentOut(BaseModel):
@ -90,6 +102,7 @@ class AgentOut(BaseModel):
model: str
template_id: str
branch: str
pfp_url: Optional[str] = None
created_at: Optional[datetime] = None