Skip to content

Commit 748bb5e

Browse files
committed
LCORE-724: OpenAPI schema
1 parent e4d201e commit 748bb5e

File tree

3 files changed

+358
-0
lines changed

3 files changed

+358
-0
lines changed

docs/openapi.json

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,193 @@
724724
}
725725
}
726726
},
727+
"/v2/conversations": {
728+
"get": {
729+
"tags": [
730+
"conversations_v2"
731+
],
732+
"summary": "Get Conversations List Endpoint Handler",
733+
"description": "Handle request to retrieve all conversations for the authenticated user.",
734+
"operationId": "get_conversations_list_endpoint_handler_v2_conversations_get",
735+
"responses": {
736+
"200": {
737+
"description": "Successful Response",
738+
"content": {
739+
"application/json": {
740+
"schema": {
741+
"$ref": "#/components/schemas/ConversationsListResponseV2"
742+
}
743+
}
744+
},
745+
"conversations": [
746+
{
747+
"conversation_id": "123e4567-e89b-12d3-a456-426614174000"
748+
}
749+
]
750+
}
751+
}
752+
}
753+
},
754+
"/v2/conversations/{conversation_id}": {
755+
"get": {
756+
"tags": [
757+
"conversations_v2"
758+
],
759+
"summary": "Get Conversation Endpoint Handler",
760+
"description": "Handle request to retrieve a conversation by ID.",
761+
"operationId": "get_conversation_endpoint_handler_v2_conversations__conversation_id__get",
762+
"parameters": [
763+
{
764+
"name": "conversation_id",
765+
"in": "path",
766+
"required": true,
767+
"schema": {
768+
"type": "string",
769+
"title": "Conversation Id"
770+
}
771+
}
772+
],
773+
"responses": {
774+
"200": {
775+
"description": "Successful Response",
776+
"content": {
777+
"application/json": {
778+
"schema": {
779+
"$ref": "#/components/schemas/ConversationResponse"
780+
}
781+
}
782+
},
783+
"conversation_id": "123e4567-e89b-12d3-a456-426614174000",
784+
"chat_history": [
785+
{
786+
"messages": [
787+
{
788+
"content": "Hi",
789+
"type": "user"
790+
},
791+
{
792+
"content": "Hello!",
793+
"type": "assistant"
794+
}
795+
],
796+
"started_at": "2024-01-01T00:00:00Z",
797+
"completed_at": "2024-01-01T00:00:05Z",
798+
"provider": "provider ID",
799+
"model": "model ID"
800+
}
801+
]
802+
},
803+
"400": {
804+
"description": "Missing or invalid credentials provided by client",
805+
"content": {
806+
"application/json": {
807+
"schema": {
808+
"$ref": "#/components/schemas/UnauthorizedResponse"
809+
}
810+
}
811+
}
812+
},
813+
"401": {
814+
"description": "Unauthorized: Invalid or missing Bearer token",
815+
"content": {
816+
"application/json": {
817+
"schema": {
818+
"$ref": "#/components/schemas/UnauthorizedResponse"
819+
}
820+
}
821+
}
822+
},
823+
"404": {
824+
"detail": {
825+
"response": "Conversation not found",
826+
"cause": "The specified conversation ID does not exist."
827+
},
828+
"description": "Not Found"
829+
},
830+
"422": {
831+
"description": "Validation Error",
832+
"content": {
833+
"application/json": {
834+
"schema": {
835+
"$ref": "#/components/schemas/HTTPValidationError"
836+
}
837+
}
838+
}
839+
}
840+
}
841+
},
842+
"delete": {
843+
"tags": [
844+
"conversations_v2"
845+
],
846+
"summary": "Delete Conversation Endpoint Handler",
847+
"description": "Handle request to delete a conversation by ID.",
848+
"operationId": "delete_conversation_endpoint_handler_v2_conversations__conversation_id__delete",
849+
"parameters": [
850+
{
851+
"name": "conversation_id",
852+
"in": "path",
853+
"required": true,
854+
"schema": {
855+
"type": "string",
856+
"title": "Conversation Id"
857+
}
858+
}
859+
],
860+
"responses": {
861+
"200": {
862+
"description": "Successful Response",
863+
"content": {
864+
"application/json": {
865+
"schema": {
866+
"$ref": "#/components/schemas/ConversationDeleteResponse"
867+
}
868+
}
869+
},
870+
"conversation_id": "123e4567-e89b-12d3-a456-426614174000",
871+
"success": true,
872+
"message": "Conversation deleted successfully"
873+
},
874+
"400": {
875+
"description": "Missing or invalid credentials provided by client",
876+
"content": {
877+
"application/json": {
878+
"schema": {
879+
"$ref": "#/components/schemas/UnauthorizedResponse"
880+
}
881+
}
882+
}
883+
},
884+
"401": {
885+
"description": "Unauthorized: Invalid or missing Bearer token",
886+
"content": {
887+
"application/json": {
888+
"schema": {
889+
"$ref": "#/components/schemas/UnauthorizedResponse"
890+
}
891+
}
892+
}
893+
},
894+
"404": {
895+
"detail": {
896+
"response": "Conversation not found",
897+
"cause": "The specified conversation ID does not exist."
898+
},
899+
"description": "Not Found"
900+
},
901+
"422": {
902+
"description": "Validation Error",
903+
"content": {
904+
"application/json": {
905+
"schema": {
906+
"$ref": "#/components/schemas/HTTPValidationError"
907+
}
908+
}
909+
}
910+
}
911+
}
912+
}
913+
},
727914
"/readiness": {
728915
"get": {
729916
"tags": [
@@ -1440,6 +1627,23 @@
14401627
}
14411628
]
14421629
},
1630+
"ConversationsListResponseV2": {
1631+
"properties": {
1632+
"conversations": {
1633+
"items": {
1634+
"type": "string"
1635+
},
1636+
"type": "array",
1637+
"title": "Conversations"
1638+
}
1639+
},
1640+
"type": "object",
1641+
"required": [
1642+
"conversations"
1643+
],
1644+
"title": "ConversationsListResponseV2",
1645+
"description": "Model representing a response for listing conversations of a user.\n\nAttributes:\n conversations: List of conversation IDs associated with the user."
1646+
},
14431647
"CustomProfile": {
14441648
"properties": {
14451649
"path": {

docs/openapi.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,69 @@ Returns:
348348
| 404 | Not Found | |
349349
| 503 | Service Unavailable | |
350350
| 422 | Validation Error | [HTTPValidationError](#httpvalidationerror) |
351+
## GET `/v2/conversations`
352+
353+
> **Get Conversations List Endpoint Handler**
354+
355+
Handle request to retrieve all conversations for the authenticated user.
356+
357+
358+
359+
360+
361+
### ✅ Responses
362+
363+
| Status Code | Description | Component |
364+
|-------------|-------------|-----------|
365+
| 200 | Successful Response | [ConversationsListResponseV2](#conversationslistresponsev2) |
366+
## GET `/v2/conversations/{conversation_id}`
367+
368+
> **Get Conversation Endpoint Handler**
369+
370+
Handle request to retrieve a conversation by ID.
371+
372+
373+
374+
### 🔗 Parameters
375+
376+
| Name | Type | Required | Description |
377+
|------|------|----------|-------------|
378+
| conversation_id | string | True | |
379+
380+
381+
### ✅ Responses
382+
383+
| Status Code | Description | Component |
384+
|-------------|-------------|-----------|
385+
| 200 | Successful Response | [ConversationResponse](#conversationresponse) |
386+
| 400 | Missing or invalid credentials provided by client | [UnauthorizedResponse](#unauthorizedresponse) |
387+
| 401 | Unauthorized: Invalid or missing Bearer token | [UnauthorizedResponse](#unauthorizedresponse) |
388+
| 404 | Not Found | |
389+
| 422 | Validation Error | [HTTPValidationError](#httpvalidationerror) |
390+
## DELETE `/v2/conversations/{conversation_id}`
391+
392+
> **Delete Conversation Endpoint Handler**
393+
394+
Handle request to delete a conversation by ID.
395+
396+
397+
398+
### 🔗 Parameters
399+
400+
| Name | Type | Required | Description |
401+
|------|------|----------|-------------|
402+
| conversation_id | string | True | |
403+
404+
405+
### ✅ Responses
406+
407+
| Status Code | Description | Component |
408+
|-------------|-------------|-----------|
409+
| 200 | Successful Response | [ConversationDeleteResponse](#conversationdeleteresponse) |
410+
| 400 | Missing or invalid credentials provided by client | [UnauthorizedResponse](#unauthorizedresponse) |
411+
| 401 | Unauthorized: Invalid or missing Bearer token | [UnauthorizedResponse](#unauthorizedresponse) |
412+
| 404 | Not Found | |
413+
| 422 | Validation Error | [HTTPValidationError](#httpvalidationerror) |
351414
## GET `/readiness`
352415

353416
> **Readiness Probe Get Method**
@@ -712,6 +775,20 @@ Example:
712775
| conversations | array | |
713776

714777

778+
## ConversationsListResponseV2
779+
780+
781+
Model representing a response for listing conversations of a user.
782+
783+
Attributes:
784+
conversations: List of conversation IDs associated with the user.
785+
786+
787+
| Field | Type | Description |
788+
|-------|------|-------------|
789+
| conversations | array | |
790+
791+
715792
## CustomProfile
716793

717794

docs/output.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,69 @@ Returns:
348348
| 404 | Not Found | |
349349
| 503 | Service Unavailable | |
350350
| 422 | Validation Error | [HTTPValidationError](#httpvalidationerror) |
351+
## GET `/v2/conversations`
352+
353+
> **Get Conversations List Endpoint Handler**
354+
355+
Handle request to retrieve all conversations for the authenticated user.
356+
357+
358+
359+
360+
361+
### ✅ Responses
362+
363+
| Status Code | Description | Component |
364+
|-------------|-------------|-----------|
365+
| 200 | Successful Response | [ConversationsListResponseV2](#conversationslistresponsev2) |
366+
## GET `/v2/conversations/{conversation_id}`
367+
368+
> **Get Conversation Endpoint Handler**
369+
370+
Handle request to retrieve a conversation by ID.
371+
372+
373+
374+
### 🔗 Parameters
375+
376+
| Name | Type | Required | Description |
377+
|------|------|----------|-------------|
378+
| conversation_id | string | True | |
379+
380+
381+
### ✅ Responses
382+
383+
| Status Code | Description | Component |
384+
|-------------|-------------|-----------|
385+
| 200 | Successful Response | [ConversationResponse](#conversationresponse) |
386+
| 400 | Missing or invalid credentials provided by client | [UnauthorizedResponse](#unauthorizedresponse) |
387+
| 401 | Unauthorized: Invalid or missing Bearer token | [UnauthorizedResponse](#unauthorizedresponse) |
388+
| 404 | Not Found | |
389+
| 422 | Validation Error | [HTTPValidationError](#httpvalidationerror) |
390+
## DELETE `/v2/conversations/{conversation_id}`
391+
392+
> **Delete Conversation Endpoint Handler**
393+
394+
Handle request to delete a conversation by ID.
395+
396+
397+
398+
### 🔗 Parameters
399+
400+
| Name | Type | Required | Description |
401+
|------|------|----------|-------------|
402+
| conversation_id | string | True | |
403+
404+
405+
### ✅ Responses
406+
407+
| Status Code | Description | Component |
408+
|-------------|-------------|-----------|
409+
| 200 | Successful Response | [ConversationDeleteResponse](#conversationdeleteresponse) |
410+
| 400 | Missing or invalid credentials provided by client | [UnauthorizedResponse](#unauthorizedresponse) |
411+
| 401 | Unauthorized: Invalid or missing Bearer token | [UnauthorizedResponse](#unauthorizedresponse) |
412+
| 404 | Not Found | |
413+
| 422 | Validation Error | [HTTPValidationError](#httpvalidationerror) |
351414
## GET `/readiness`
352415

353416
> **Readiness Probe Get Method**
@@ -712,6 +775,20 @@ Example:
712775
| conversations | array | |
713776

714777

778+
## ConversationsListResponseV2
779+
780+
781+
Model representing a response for listing conversations of a user.
782+
783+
Attributes:
784+
conversations: List of conversation IDs associated with the user.
785+
786+
787+
| Field | Type | Description |
788+
|-------|------|-------------|
789+
| conversations | array | |
790+
791+
715792
## CustomProfile
716793

717794

0 commit comments

Comments
 (0)