diff --git a/api-reference/chat/segment.mdx b/api-reference/chat/segment.mdx new file mode 100644 index 0000000..5ef6ce9 --- /dev/null +++ b/api-reference/chat/segment.mdx @@ -0,0 +1,4 @@ +--- +title: "Get Chat Segment" +openapi: "/api-reference/openapi.json GET /api/chats/{id}/segment" +--- diff --git a/api-reference/openapi.json b/api-reference/openapi.json index 7bc92b1..ed2ddb5 100644 --- a/api-reference/openapi.json +++ b/api-reference/openapi.json @@ -1380,6 +1380,65 @@ } } }, + "/api/chats/{id}/segment": { + "get": { + "description": "Retrieve the segment associated with a specific chat room. Returns 404 if the chat does not exist or is not accessible by the authenticated caller.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The unique identifier (UUID) of the chat room.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Chat segment resolved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetChatSegmentResponse" + } + } + } + }, + "400": { + "description": "Bad request - invalid chat id", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetChatSegmentErrorResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - invalid or missing credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "404": { + "description": "Not found - chat does not exist or is not accessible", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetChatSegmentErrorResponse" + } + } + } + } + } + } + }, "/api/chats/compact": { "post": { "description": "Compact one or more chat conversations into summarized versions. This reduces the size of chat history while preserving key information. Optionally provide a prompt to control what information gets preserved in the compacted summary.", @@ -6624,6 +6683,59 @@ } } }, + "GetChatSegmentResponse": { + "type": "object", + "required": [ + "status", + "room_id", + "segment_id", + "segment_exists" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ], + "description": "Status of the request" + }, + "room_id": { + "type": "string", + "format": "uuid", + "description": "UUID of the chat room" + }, + "segment_id": { + "type": "string", + "format": "uuid", + "nullable": true, + "description": "UUID of the segment associated with the chat, or null when no segment is linked" + }, + "segment_exists": { + "type": "boolean", + "description": "Whether a segment is linked to the chat room" + } + } + }, + "GetChatSegmentErrorResponse": { + "type": "object", + "required": [ + "status", + "error" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "description": "Status of the request" + }, + "error": { + "type": "string", + "description": "Error message describing what went wrong" + } + } + }, "CreateChatRequest": { "type": "object", "properties": { diff --git a/docs.json b/docs.json index a01aa84..058e75d 100644 --- a/docs.json +++ b/docs.json @@ -46,6 +46,7 @@ "pages": [ "api-reference/chat/chats", "api-reference/chat/artist", + "api-reference/chat/segment", "api-reference/chat/create", "api-reference/chat/update", "api-reference/chat/delete",