From 578f70817e69a2dd2d1b6a87da0d6ef993ab44d9 Mon Sep 17 00:00:00 2001 From: writinwaters <93570324+writinwaters@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:37:13 +0800 Subject: [PATCH] Fixed a docusaurus display issue (#3120) ### What problem does this PR solve? ### Type of change - [x] Documentation Update --- docs/references/http_api_reference.md | 100 ++++++++++++------------ docs/references/python_api_reference.md | 10 +-- 2 files changed, 52 insertions(+), 58 deletions(-) diff --git a/docs/references/http_api_reference.md b/docs/references/http_api_reference.md index 9af64aa21..f4f802715 100644 --- a/docs/references/http_api_reference.md +++ b/docs/references/http_api_reference.md @@ -27,7 +27,7 @@ Creates a dataset. - URL: `/api/v1/datasets` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"name"`: `string` - `"avatar"`: `string` @@ -44,7 +44,7 @@ Creates a dataset. curl --request POST \ --url http://{address}/api/v1/datasets \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --data '{ "name": "test_1" }' @@ -175,7 +175,7 @@ Deletes datasets by ID. - URL: `/api/v1/datasets` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"ids"`: `list[string]` @@ -185,7 +185,7 @@ Deletes datasets by ID. curl --request DELETE \ --url http://{address}/api/v1/datasets \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --data '{"ids": ["test_1", "test_2"]}' ``` @@ -227,7 +227,7 @@ Updates configurations for a specified dataset. - URL: `/api/v1/datasets/{dataset_id}` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"name"`: `string` - `"embedding_model"`: `string` @@ -239,7 +239,7 @@ Updates configurations for a specified dataset. curl --request PUT \ --url http://{address}/api/v1/datasets/{dataset_id} \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --data ' { "name": "updated_dataset", @@ -301,14 +301,14 @@ Lists datasets. - Method: GET - URL: `/api/v1/datasets?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}` - Headers: - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` #### Request example ```bash curl --request GET \ --url http://{address}/api/v1/datasets?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id} \ - --header 'Authorization: Bearer {YOUR_API_KEY}' + --header 'Authorization: Bearer ' ``` #### Request parameters @@ -402,7 +402,7 @@ Uploads documents to a specified dataset. - URL: `/api/v1/datasets/{dataset_id}/documents` - Headers: - `'Content-Type: multipart/form-data'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Form: - `'file=@{FILE_PATH}'` @@ -412,7 +412,7 @@ Uploads documents to a specified dataset. curl --request POST \ --url http://{address}/api/v1/datasets/{dataset_id}/documents \ --header 'Content-Type: multipart/form-data' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --form 'file=@./test1.txt' \ --form 'file=@./test2.pdf' ``` @@ -480,7 +480,7 @@ Updates configurations for a specified document. - URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"name"`:`string` - `"chunk_method"`:`string` @@ -491,7 +491,7 @@ Updates configurations for a specified document. ```bash curl --request PUT \ --url http://{address}/api/v1/datasets/{dataset_id}/info/{document_id} \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { @@ -572,7 +572,7 @@ Downloads a document from a specified dataset. - Method: GET - URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}` - Headers: - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Output: - `'{PATH_TO_THE_FILE}'` @@ -581,7 +581,7 @@ Downloads a document from a specified dataset. ```bash curl --request GET \ --url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id} \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --output ./ragflow.txt ``` @@ -623,14 +623,14 @@ Lists documents in a specified dataset. - URL: `/api/v1/datasets/{dataset_id}/documents?keywords={keyword}&page={page}&page_size={limit}&orderby={orderby}&desc={desc}&name={name}` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` #### Request example ```bash curl --request GET \ --url http://{address}/api/v1/datasets/{dataset_id}/documents?keywords={keywords}&offset={offset}&limit={limit}&orderby={orderby}&desc={desc}&id={document_id} \ - --header 'Authorization: Bearer {YOUR_API_KEY}' + --header 'Authorization: Bearer ' ``` #### Request parameters @@ -720,7 +720,7 @@ Deletes documents by ID. - URL: `/api/v1/datasets/{dataset_id}/documents` - Headers: - `'Content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"ids"`: `list[string]` @@ -730,7 +730,7 @@ Deletes documents by ID. curl --request DELETE \ --url http://{address}/api/v1/datasets/{dataset_id}/documents \ --header 'Content-Type: application/json' \ - --header 'Authorization: {YOUR_API_KEY}' \ + --header 'Authorization: ' \ --data ' { "ids": ["id_1","id_2"] @@ -777,7 +777,7 @@ Parses documents in a specified dataset. - URL: `/api/v1/datasets/{dataset_id}/chunks` - Headers: - `'content-Type: application/json'` - - 'Authorization: Bearer {YOUR_API_KEY}' + - 'Authorization: Bearer ' - Body: - `"document_ids"`: `list[string]` @@ -787,7 +787,7 @@ Parses documents in a specified dataset. curl --request POST \ --url http://{address}/api/v1/datasets/{dataset_id}/chunks \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --data ' { "document_ids": ["97a5f1c2759811efaa500242ac120004","97ad64b6759811ef9fc30242ac120004"] @@ -834,7 +834,7 @@ Stops parsing specified documents. - URL: `/api/v1/datasets/{dataset_id}/chunks` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"document_ids"`: `list[string]` @@ -844,7 +844,7 @@ Stops parsing specified documents. curl --request DELETE \ --url http://{address}/api/v1/datasets/{dataset_id}/chunks \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --data ' { "document_ids": ["97a5f1c2759811efaa500242ac120004","97ad64b6759811ef9fc30242ac120004"] @@ -891,7 +891,7 @@ Adds a chunk to a specified document in a specified dataset. - URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"content"`: `string` - `"important_keywords"`: `list[string]` @@ -902,7 +902,7 @@ Adds a chunk to a specified document in a specified dataset. curl --request POST \ --url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --data ' { "content": "" @@ -965,14 +965,14 @@ Lists chunks in a specified document. - Method: GET - URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&offset={offset}&limit={limit}&id={chunk_id}` - Headers: - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` #### Request example ```bash curl --request GET \ --url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&offset={offset}&limit={limit}&id={chunk_id} \ - --header 'Authorization: Bearer {YOUR_API_KEY}' + --header 'Authorization: Bearer ' ``` #### Request parameters @@ -1073,7 +1073,7 @@ Deletes chunks by ID. - URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"chunk_ids"`: `list[string]` @@ -1083,7 +1083,7 @@ Deletes chunks by ID. curl --request DELETE \ --url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --data ' { "chunk_ids": ["test_1", "test_2"] @@ -1132,7 +1132,7 @@ Updates content or configurations for a specified chunk. - URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"content"`: `string` - `"important_keywords"`: `string` @@ -1144,7 +1144,7 @@ Updates content or configurations for a specified chunk. curl --request PUT \ --url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id} \ --header 'Content-Type: application/json' \ - --header 'Authorization: {YOUR_API_KEY}' \ + --header 'Authorization: ' \ --data ' { "content": "ragflow123", @@ -1202,7 +1202,7 @@ Retrieves chunks from specified datasets. - URL: `/api/v1/retrieval` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"question"`: `string` - `"dataset_ids"`: `list[string]` @@ -1222,7 +1222,7 @@ Retrieves chunks from specified datasets. curl --request POST \ --url http://{address}/api/v1/retrieval \ --header 'Content-Type: application/json' \ - --header 'Authorization: {YOUR_API_KEY}' \ + --header 'Authorization: ' \ --data ' { "question": "What is advantage of ragflow?", @@ -1330,7 +1330,7 @@ Creates a chat assistant. - URL: `/api/v1/chats` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"name"`: `string` - `"avatar"`: `string` @@ -1344,7 +1344,7 @@ Creates a chat assistant. curl --request POST \ --url http://{address}/api/v1/chats \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' + --header 'Authorization: Bearer ' --data '{ "dataset_ids": ["0b2cbc8c877f11ef89070242ac120005"], "name":"new_chat_1" @@ -1466,7 +1466,7 @@ Updates configurations for a specified chat assistant. - URL: `/api/v1/chats/{chat_id}` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"name"`: `string` - `"avatar"`: `string` @@ -1480,7 +1480,7 @@ Updates configurations for a specified chat assistant. curl --request PUT \ --url http://{address}/api/v1/chats/{chat_id} \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --data ' { "name":"Test" @@ -1562,7 +1562,7 @@ Deletes chat assistants by ID. - URL: `/api/v1/chats` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"ids"`: `list[string]` @@ -1572,7 +1572,7 @@ Deletes chat assistants by ID. curl --request DELETE \ --url http://{address}/api/v1/chats \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --data ' { "ids": ["test_1", "test_2"] @@ -1616,14 +1616,14 @@ Lists chat assistants. - Method: GET - URL: `/api/v1/chats?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}` - Headers: - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` #### Request example ```bash curl --request GET \ --url http://{address}/api/v1/chats?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id} \ - --header 'Authorization: Bearer {YOUR_API_KEY}' + --header 'Authorization: Bearer ' ``` #### Request parameters @@ -1716,7 +1716,7 @@ Creates a chat session. - URL: `/api/v1/chats/{chat_id}/sessions` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"name"`: `string` @@ -1726,7 +1726,7 @@ Creates a chat session. curl --request POST \ --url http://{address}/api/v1/chats/{chat_id}/sessions \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --data ' { "name": "new session" @@ -1788,7 +1788,7 @@ Updates a chat session. - URL: `/api/v1/chats/{chat_id}/sessions/{session_id}` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"name`: string @@ -1797,7 +1797,7 @@ Updates a chat session. curl --request PUT \ --url http://{address}/api/v1/chats/{chat_id}/sessions/{session_id} \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --data ' { "name": "" @@ -1845,14 +1845,14 @@ Lists sessions associated with a specified chat assistant. - Method: GET - URL: `/api/v1/chats/{chat_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id}` - Headers: - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` #### Request example ```bash curl --request GET \ --url http://{address}/api/v1/chats/{chat_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id} \ - --header 'Authorization: Bearer {YOUR_API_KEY}' + --header 'Authorization: Bearer ' ``` #### Request Parameters @@ -1924,7 +1924,7 @@ Deletes sessions by ID. - URL: `/api/v1/chats/{chat_id}/sessions` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"ids"`: `list[string]` @@ -1935,7 +1935,7 @@ Deletes sessions by ID. curl --request DELETE \ --url http://{address}/api/v1/chats/{chat_id}/sessions \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bear {YOUR_API_KEY}' \ + --header 'Authorization: Bear ' \ --data ' { "ids": ["test_1", "test_2"] @@ -1982,7 +1982,7 @@ Asks a question to start an AI-powered conversation. - URL: `/api/v1/chats/{chat_id}/completions` - Headers: - `'content-Type: application/json'` - - `'Authorization: Bearer {YOUR_API_KEY}'` + - `'Authorization: Bearer '` - Body: - `"question"`: `string` - `"stream"`: `boolean` @@ -1994,7 +1994,7 @@ Asks a question to start an AI-powered conversation. curl --request POST \ --url http://{address}/api/v1/chats/{chat_id}/completions \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {YOUR_API_KEY}' \ + --header 'Authorization: Bearer ' \ --data-binary ' { "question": "What is RAGFlow?", diff --git a/docs/references/python_api_reference.md b/docs/references/python_api_reference.md index a27a0a4eb..569c912b0 100644 --- a/docs/references/python_api_reference.md +++ b/docs/references/python_api_reference.md @@ -961,10 +961,7 @@ Instructions for the LLM to follow. A `Prompt` object contains the following at - `empty_response`: `str` If nothing is retrieved in the dataset for the user's question, this will be used as the response. To allow the LLM to improvise when nothing is found, leave this blank. Defaults to `None`. - `opener`: `str` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`. - `show_quote`: `bool` Indicates whether the source of text should be displayed. Defaults to `True`. -- `prompt`: `str` The prompt content. Defaults to `You are an intelligent assistant. Please summarize the content of the dataset to answer the question. Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, your answer must include the sentence "The answer you are looking for is not found in the knowledge base!" Answers need to consider chat history. - Here is the knowledge base: - {knowledge} - The above is the knowledge base.` +- `prompt`: `str` The prompt content. ### Returns @@ -1022,10 +1019,7 @@ A dictionary representing the attributes to update, with the following keys: - `"empty_response"`: `str` If nothing is retrieved in the dataset for the user's question, this will be used as the response. To allow the LLM to improvise when nothing is retrieved, leave this blank. Defaults to `None`. - `"opener"`: `str` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`. - `"show_quote`: `bool` Indicates whether the source of text should be displayed Defaults to `True`. - - `"prompt"`: `str` The prompt content. Defaults to `You are an intelligent assistant. Please summarize the content of the knowledge base to answer the question. Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, your answer must include the sentence "The answer you are looking for is not found in the knowledge base!" Answers need to consider chat history. - Here is the knowledge base: - {knowledge} - The above is the knowledge base.`. + - `"prompt"`: `str` The prompt content. ### Returns