forked from pengxiaoo/llama-index-fastapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredoc.html
25 lines (25 loc) · 7.89 KB
/
redoc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Api Definitions for Traveler's App</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="https://fastapi.tiangolo.com/img/favicon.png">
<style>
body {
margin: 0;
padding: 0;
}
</style>
<style data-styled="" data-styled-version="4.4.1"></style>
</head>
<body>
<div id="redoc-container"></div>
<script src="https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js"> </script>
<script>
var spec = {"openapi": "3.1.0", "info": {"title": "Api Definitions for Question Answering", "version": "0.0.1"}, "servers": [{"url": "http://127.0.0.1:8081", "description": "Local test environment"}], "paths": {"/api/v1/qa/query": {"post": {"tags": ["question answering"], "summary": "Answer Question", "description": "ask questions related to the knowledge base, return the answer if there is a good match, otherwise turn to chatgpt for answer", "operationId": "answer_question_api_v1_qa_query_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuestionAnsweringRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuestionAnsweringResponse"}}}}}}}, "/api/v1/qa/document": {"post": {"tags": ["question answering"], "summary": "Get Document", "description": "check what's inside the document. mainly for testing", "operationId": "get_document_api_v1_qa_document_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/DocumentRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DocumentResponse"}}}}}}}, "/api/v1/admin/documents/{doc_id}": {"delete": {"tags": ["(admin) high priority admin operations, usually for testing and debugging"], "summary": "Delete Doc", "description": "delete a document by doc_id. only for testing", "operationId": "delete_doc_api_v1_admin_documents__doc_id__delete", "parameters": [{"name": "doc_id", "in": "path", "required": true, "schema": {"type": "string", "title": "The ID of the document to delete"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DeleteDocumentResponse"}}}}}}}, "/api/v1/admin/cleanup": {"post": {"tags": ["(admin) high priority admin operations, usually for testing and debugging"], "summary": "Cleanup For Test", "description": "cleanup all the user query meta data in mongodb. only for testing", "operationId": "cleanup_for_test_api_v1_admin_cleanup_post", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DeleteDocumentResponse"}}}}}}}}, "components": {"schemas": {"Answer": {"properties": {"category": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Category", "description": "Category of the question, if it can be recognized"}, "question": {"type": "string", "title": "Question", "description": "the original question"}, "matched_question": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Matched Question", "description": "matched question, if any"}, "source": {"allOf": [{"$ref": "#/components/schemas/Source"}], "description": "Source of the answer"}, "answer": {"type": "string", "title": "Answer", "description": "answer to the question"}}, "type": "object", "required": ["question", "source", "answer"], "title": "Answer"}, "DeleteDocumentResponse": {"properties": {"status_code": {"allOf": [{"$ref": "#/components/schemas/StatusCode"}], "default": "SUCCEEDED"}, "msg": {"type": "string", "title": "Msg", "default": "success"}}, "type": "object", "title": "DeleteDocumentResponse", "description": "DeleteDocumentResponse"}, "DocumentRequest": {"properties": {"doc_id": {"type": "string", "title": "Doc Id", "description": "document id"}, "fuzzy": {"type": "boolean", "title": "Fuzzy", "description": "whether to use fuzzy search", "default": false}}, "type": "object", "required": ["doc_id"], "title": "DocumentRequest"}, "DocumentResponse": {"properties": {"status_code": {"allOf": [{"$ref": "#/components/schemas/StatusCode"}], "default": "SUCCEEDED"}, "msg": {"type": "string", "title": "Msg", "default": "success"}, "data": {"anyOf": [{"$ref": "#/components/schemas/LlamaIndexDocumentMetaReadable"}, {"type": "null"}], "description": "document data"}}, "type": "object", "title": "DocumentResponse"}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "LlamaIndexDocumentMetaReadable": {"properties": {"doc_id": {"type": "string", "title": "Doc Id", "description": "Global unique id of the document"}, "question": {"type": "string", "title": "Question", "description": "the original question"}, "matched_question": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Matched Question", "description": "matched question, if any"}, "category": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Category", "description": "Category of the question, if it can be recognized"}, "source": {"allOf": [{"$ref": "#/components/schemas/Source"}], "description": "Source of the answer"}, "answer": {"type": "string", "title": "Answer", "description": "answer to the question"}, "insert_timestamp": {"type": "integer", "title": "Insert Timestamp", "description": "The timestamp when the document is inserted, in milliseconds"}, "query_timestamps": {"items": {"type": "integer"}, "type": "array", "title": "Query Timestamps", "description": "The timestamps when the document is queried", "default": []}, "insert_time": {"type": "string", "title": "Insert Time", "description": "The time when the document is inserted, in human readable format"}, "last_query_time": {"type": "string", "title": "Last Query Time", "description": "The time when the document is last queried", "default": ""}, "query_count_7_days": {"type": "integer", "title": "Query Count 7 Days", "description": "How many times the document is queried in last 7 days", "default": 0}}, "type": "object", "required": ["doc_id", "question", "source", "answer", "insert_timestamp", "insert_time"], "title": "LlamaIndexDocumentMetaReadable"}, "QuestionAnsweringRequest": {"properties": {"question": {"type": "string", "title": "Question", "description": "question to be answered"}}, "type": "object", "required": ["question"], "title": "QuestionAnsweringRequest"}, "QuestionAnsweringResponse": {"properties": {"status_code": {"allOf": [{"$ref": "#/components/schemas/StatusCode"}], "default": "SUCCEEDED"}, "msg": {"type": "string", "title": "Msg", "default": "success"}, "data": {"anyOf": [{"$ref": "#/components/schemas/Answer"}, {"type": "null"}], "description": "answer to the question"}}, "type": "object", "title": "QuestionAnsweringResponse"}, "Source": {"type": "string", "enum": ["knowledge-base", "user-asked", "gpt-3.5-turbo", "gpt-4", "claude-2"], "title": "Source"}, "StatusCode": {"type": "string", "enum": ["SUCCEEDED", "ERROR_INPUT_FORMAT", "ERROR_ALREADY_EXISTS"], "title": "StatusCode", "description": "\"status_code\" in the response is a high level descriptive string indicating the status of the request.\n\"msg\" in the response gives more low level details."}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}}}};
Redoc.init(spec, {}, document.getElementById("redoc-container"));
</script>
</body>
</html>