Update Custom Agent
PATCH
/v1/agents/custom/{slug}
const url = 'https://api.cloud.agentums.ru/v1/agents/custom/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"description":"example","icon":"example","name":"example","persona":"example","toolsets":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.cloud.agentums.ru/v1/agents/custom/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "description": "example", "icon": "example", "name": "example", "persona": "example", "toolsets": [ "example" ] }'Поправить свою роль. Изменённая персона подхватывается следующим ходом.
Отдельного сброса кэша сборок не нужно: он ключуется отпечатком персоны и набора
(routers/agent._profile_fingerprint), поэтому правка сама даёт другой ключ.
Authorizations
Заголовок раздела «Authorizations»Parameters
Заголовок раздела «Parameters»Path Parameters
Заголовок раздела «Path Parameters»slug
required
Slug
string
Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
AgentProfileUpdateIn
Правка своей роли. None — поле не трогаем (частичное обновление).
object
Examplegenerated
{ "description": "example", "icon": "example", "name": "example", "persona": "example", "toolsets": [ "example" ]}Responses
Заголовок раздела «Responses»Successful Response
Media typeapplication/json
AgentProfileOut
Карточка роли для экрана «Главная».
object
Example
{ "locked": false, "persona": ""}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}