Skip to content

Commit b28259b

Browse files
committed
LCORE-304: Update OpenAPI schema
1 parent 76dc1d2 commit b28259b

File tree

1 file changed

+207
-0
lines changed

1 file changed

+207
-0
lines changed

docs/openapi.json

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,127 @@
367367
}
368368
}
369369
},
370+
"/v1/conversations/{conversation_id}": {
371+
"get": {
372+
"tags": [
373+
"conversations"
374+
],
375+
"summary": "Get Conversation Endpoint Handler",
376+
"description": "Handle request to retrieve a conversation by ID.",
377+
"operationId": "get_conversation_endpoint_handler_v1_conversations__conversation_id__get",
378+
"parameters": [
379+
{
380+
"name": "conversation_id",
381+
"in": "path",
382+
"required": true,
383+
"schema": {
384+
"type": "string",
385+
"title": "Conversation Id"
386+
}
387+
}
388+
],
389+
"responses": {
390+
"200": {
391+
"description": "Successful Response",
392+
"content": {
393+
"application/json": {
394+
"schema": {
395+
"$ref": "#/components/schemas/ConversationResponse"
396+
}
397+
}
398+
},
399+
"conversation_id": "123e4567-e89b-12d3-a456-426614174000",
400+
"session_data": {
401+
"session_id": "123e4567-e89b-12d3-a456-426614174000",
402+
"turns": [],
403+
"started_at": "2024-01-01T00:00:00Z"
404+
}
405+
},
406+
"404": {
407+
"detail": {
408+
"response": "Conversation not found",
409+
"cause": "The specified conversation ID does not exist."
410+
},
411+
"description": "Not Found"
412+
},
413+
"503": {
414+
"detail": {
415+
"response": "Unable to connect to Llama Stack",
416+
"cause": "Connection error."
417+
},
418+
"description": "Service Unavailable"
419+
},
420+
"422": {
421+
"description": "Validation Error",
422+
"content": {
423+
"application/json": {
424+
"schema": {
425+
"$ref": "#/components/schemas/HTTPValidationError"
426+
}
427+
}
428+
}
429+
}
430+
}
431+
},
432+
"delete": {
433+
"tags": [
434+
"conversations"
435+
],
436+
"summary": "Delete Conversation Endpoint Handler",
437+
"description": "Handle request to delete a conversation by ID.",
438+
"operationId": "delete_conversation_endpoint_handler_v1_conversations__conversation_id__delete",
439+
"parameters": [
440+
{
441+
"name": "conversation_id",
442+
"in": "path",
443+
"required": true,
444+
"schema": {
445+
"type": "string",
446+
"title": "Conversation Id"
447+
}
448+
}
449+
],
450+
"responses": {
451+
"200": {
452+
"description": "Successful Response",
453+
"content": {
454+
"application/json": {
455+
"schema": {
456+
"$ref": "#/components/schemas/ConversationDeleteResponse"
457+
}
458+
}
459+
},
460+
"conversation_id": "123e4567-e89b-12d3-a456-426614174000",
461+
"success": true,
462+
"message": "Conversation deleted successfully"
463+
},
464+
"404": {
465+
"detail": {
466+
"response": "Conversation not found",
467+
"cause": "The specified conversation ID does not exist."
468+
},
469+
"description": "Not Found"
470+
},
471+
"503": {
472+
"detail": {
473+
"response": "Unable to connect to Llama Stack",
474+
"cause": "Connection error."
475+
},
476+
"description": "Service Unavailable"
477+
},
478+
"422": {
479+
"description": "Validation Error",
480+
"content": {
481+
"application/json": {
482+
"schema": {
483+
"$ref": "#/components/schemas/HTTPValidationError"
484+
}
485+
}
486+
}
487+
}
488+
}
489+
}
490+
},
370491
"/readiness": {
371492
"get": {
372493
"tags": [
@@ -642,6 +763,81 @@
642763
"title": "Configuration",
643764
"description": "Global service configuration."
644765
},
766+
"ConversationDeleteResponse": {
767+
"properties": {
768+
"conversation_id": {
769+
"type": "string",
770+
"title": "Conversation Id"
771+
},
772+
"success": {
773+
"type": "boolean",
774+
"title": "Success"
775+
},
776+
"response": {
777+
"type": "string",
778+
"title": "Response"
779+
}
780+
},
781+
"type": "object",
782+
"required": [
783+
"conversation_id",
784+
"success",
785+
"response"
786+
],
787+
"title": "ConversationDeleteResponse",
788+
"description": "Model representing a response for deleting a conversation.\n\nAttributes:\n conversation_id: The conversation ID (UUID) that was deleted.\n success: Whether the deletion was successful.\n response: A message about the deletion result.\n\nExample:\n ```python\n delete_response = ConversationDeleteResponse(\n conversation_id=\"123e4567-e89b-12d3-a456-426614174000\",\n success=True,\n response=\"Conversation deleted successfully\"\n )\n ```",
789+
"examples": [
790+
{
791+
"conversation_id": "123e4567-e89b-12d3-a456-426614174000",
792+
"response": "Conversation deleted successfully",
793+
"success": true
794+
}
795+
]
796+
},
797+
"ConversationResponse": {
798+
"properties": {
799+
"conversation_id": {
800+
"type": "string",
801+
"title": "Conversation Id"
802+
},
803+
"chat_history": {
804+
"items": {
805+
"additionalProperties": true,
806+
"type": "object"
807+
},
808+
"type": "array",
809+
"title": "Chat History"
810+
}
811+
},
812+
"type": "object",
813+
"required": [
814+
"conversation_id",
815+
"chat_history"
816+
],
817+
"title": "ConversationResponse",
818+
"description": "Model representing a response for retrieving a conversation.\n\nAttributes:\n conversation_id: The conversation ID (UUID).\n chat_history: The simplified chat history as a list of conversation turns.\n\nExample:\n ```python\n conversation_response = ConversationResponse(\n conversation_id=\"123e4567-e89b-12d3-a456-426614174000\",\n chat_history=[\n {\n \"messages\": [\n {\"content\": \"Hello\", \"type\": \"user\"},\n {\"content\": \"Hi there!\", \"type\": \"assistant\"}\n ],\n \"started_at\": \"2024-01-01T00:01:00Z\",\n \"completed_at\": \"2024-01-01T00:01:05Z\"\n }\n ]\n )\n ```",
819+
"examples": [
820+
{
821+
"chat_history": [
822+
{
823+
"completed_at": "2024-01-01T00:01:05Z",
824+
"messages": [
825+
{
826+
"content": "Hello",
827+
"type": "user"
828+
},
829+
{
830+
"content": "Hi there!",
831+
"type": "assistant"
832+
}
833+
],
834+
"started_at": "2024-01-01T00:01:00Z"
835+
}
836+
],
837+
"conversation_id": "123e4567-e89b-12d3-a456-426614174000"
838+
}
839+
]
840+
},
645841
"Customization": {
646842
"properties": {
647843
"disable_query_system_prompt": {
@@ -1080,6 +1276,17 @@
10801276
}
10811277
],
10821278
"title": "Attachments"
1279+
},
1280+
"media_type": {
1281+
"anyOf": [
1282+
{
1283+
"type": "string"
1284+
},
1285+
{
1286+
"type": "null"
1287+
}
1288+
],
1289+
"title": "Media Type"
10831290
}
10841291
},
10851292
"additionalProperties": false,

0 commit comments

Comments
 (0)