Перейти к содержимому

Patch Chat

PATCH
/v1/chats/{chat_id}
curl --request PATCH \
--url https://api.cloud.agentums.ru/v1/chats/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "clear_collection": false, "collection_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "pinned": true, "title": "example" }'

Правка сессии: переименование, закрепление и/или перенос в проект (папку).

Незаданные поля не трогаем. Владение папкой проверяем ЗДЕСЬ: без этого чужой collection_id записался бы в строку чата — сама svc.update папку не знает и проверить её не может.

chat_id
required
Chat Id
string format: uuid
Media typeapplication/json
ChatPatch

Частичная правка сессии: незаданное поле не трогаем. Пустой заголовок не принимаем — переименование на пустое смысла не имеет; закрепление — независимый флаг.

collection_id — перенести чат в проект (папку). У него NULL значащий («без проекта»), поэтому «снять проект» нельзя выразить тем же None, что и «не трогать»: для снятия заведён отдельный флаг clear_collection.

object
clear_collection
Clear Collection
boolean
collection_id
Any of:
string format: uuid
pinned
Any of:
boolean
title
Any of:
string
>= 1 characters <= 200 characters

Successful Response

Media typeapplication/json
ChatSessionOut
object
collection_id
Any of:
string format: uuid
created_at
required
Created At
string format: date-time
id
required
Id
string format: uuid
kind
Kind
string
default: ask
last_file
Last File
string
""
pinned
Pinned
boolean
preview
Preview
string
""
title
required
Title
string
updated_at
required
Updated At
string format: date-time
Example
{
"kind": "ask",
"last_file": "",
"pinned": false,
"preview": ""
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
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"
}
]
}