From a74c70e8a1d5b6a15b9281311c4f57d94b4704eb Mon Sep 17 00:00:00 2001 From: Roman Bug Date: Mon, 30 Oct 2023 00:59:17 +0300 Subject: [PATCH 1/6] Update README.md --- docs/README.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/docs/README.md b/docs/README.md index 4e41a0de7..4b90b5980 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,16 +4,15 @@ ### 1. Clone the DocsGPT repository: -``` +```bash git clone https://github.com/arc53/DocsGPT.git - ``` ### 2. Navigate to the docs folder: -``` +```bash cd DocsGPT/docs - ``` + The docs folder contains the markdown files that make up the documentation. The majority of the files are in the pages directory. Some notable files in this folder include: `index.mdx`: The main documentation file. @@ -22,30 +21,29 @@ The docs folder contains the markdown files that make up the documentation. The ### 3. Verify that you have Node.js and npm installed in your system. You can check by running: -``` +```bash node --version npm --version - ``` + ### 4. If not installed, download Node.js and npm from the respective official websites. ### 5. Once you have Node.js and npm running, proceed to install yarn - another package manager that helps to manage project dependencies: -``` +```bash npm install --global yarn - ``` + ### 6. Install the project dependencies using yarn: -``` +```bash yarn install - ``` + ### 7. After the successful installation of the project dependencies, start the local server: -``` +```bash yarn dev - ``` - Now, you should be able to view the docs on your local environment by visiting `http://localhost:5000`. You can explore the different markdown files and make changes as you see fit. From cf3aab9d386c941cd8909be42d0b7a974b38538c Mon Sep 17 00:00:00 2001 From: Roman Bug Date: Mon, 30 Oct 2023 01:06:24 +0300 Subject: [PATCH 2/6] Update Quickstart.md --- docs/pages/Deploying/Quickstart.md | 58 ++++++++++++++++++------------ 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/docs/pages/Deploying/Quickstart.md b/docs/pages/Deploying/Quickstart.md index 411e3234c..0b6019439 100644 --- a/docs/pages/Deploying/Quickstart.md +++ b/docs/pages/Deploying/Quickstart.md @@ -2,22 +2,28 @@ **Note**: Make sure you have Docker installed **On macOS or Linux:** -Just run the following command:: +Just run the following command: -`./setup.sh` +``` +./setup.sh +``` This command will install all the necessary dependencies and provide you with an option to download the local model or use OpenAI. If you prefer to follow manual steps, refer to this guide: 1. Open and download this repository with -`git clone https://github.com/arc53/DocsGPT.git`. + ``` + git clone https://github.com/arc53/DocsGPT.git`. + ``` 2. Create a `.env` file in your root directory and set your `API_KEY` with your [OpenAI API key](https://platform.openai.com/account/api-keys). 3. Run the following commands: -`docker-compose build && docker-compose up`. + ``` + docker-compose build && docker-compose up`. + ``` 4. Navigate to `http://localhost:5173/`. -To stop, simply press Ctrl + C. +To stop, simply press **Ctrl + C**. **For WINDOWS:** @@ -35,9 +41,11 @@ To run the setup on Windows, you have two options: using the Windows Subsystem f echo "VITE_API_STREAMING=true" >> .env ``` 4. Run the following command to start the setup with Docker Compose: - `./run-with-docker-compose.sh` -5. Open your web browser and navigate to (http://localhost:5173/). -6. To stop the setup, just press `Ctrl + C` in the WSL terminal + ``` + ./run-with-docker-compose.sh + ``` +6. Open your web browser and navigate to (http://localhost:5173/). +7. To stop the setup, just press **Ctrl + C** in the WSL terminal **Option 2: Using Git Bash or Command Prompt (CMD):** @@ -50,10 +58,12 @@ To run the setup on Windows, you have two options: using the Windows Subsystem f echo "API_KEY=Yourkey" > .env echo "VITE_API_STREAMING=true" >> .env ``` -4.Run the following command to start the setup with Docker Compose: - `./run-with-docker-compose.sh` -5.Open your web browser and navigate to (http://localhost:5173/). -6.To stop the setup, just press Ctrl + C in the Git Bash or Command Prompt terminal. +4. Run the following command to start the setup with Docker Compose: + ``` + ./run-with-docker-compose.sh + ``` +5. Open your web browser and navigate to (http://localhost:5173/). +6. To stop the setup, just press **Ctrl + C** in the Git Bash or Command Prompt terminal. These steps should help you set up and run the project on Windows using either WSL or Git Bash/Command Prompt. **Important:** Ensure that Docker is installed and properly configured on your Windows system for these steps to work. @@ -77,7 +87,7 @@ Option 1: Using Windows Subsystem for Linux (WSL): 4. Run the following command to start the setup with Docker Compose: `./run-with-docker-compose.sh` 5. Open your web browser and navigate to (http://localhost:5173/). -6. To stop the setup, just press `Ctrl + C` in the WSL terminal +6. To stop the setup, just press **Ctrl + C** in the WSL terminal. Option 2: Using Git Bash or Command Prompt (CMD): @@ -90,10 +100,12 @@ Option 2: Using Git Bash or Command Prompt (CMD): echo "API_KEY=Yourkey" > .env echo "VITE_API_STREAMING=true" >> .env ``` -4.Run the following command to start the setup with Docker Compose: - `./run-with-docker-compose.sh` -5.Open your web browser and navigate to (http://localhost:5173/). -6.To stop the setup, just press Ctrl + C in the Git Bash or Command Prompt terminal. +4. Run the following command to start the setup with Docker Compose: + ``` + ./run-with-docker-compose.sh + ``` +5. Open your web browser and navigate to (http://localhost:5173/). +6. To stop the setup, just press **Ctrl + C** in the Git Bash or Command Prompt terminal. These steps should help you set up and run the project on Windows using either WSL or Git Bash/Command Prompt. Make sure you have Docker installed and properly configured on your Windows system for this to work. @@ -103,12 +115,12 @@ These steps should help you set up and run the project on Windows using either W #### Installing the Chrome extension: To enhance your DocsGPT experience, you can install the DocsGPT Chrome extension. Here's how: -1. In the DocsGPT GitHub repository, click on the "Code" button and select "Download ZIP". +1. In the DocsGPT GitHub repository, click on the **Code** button and select **Download ZIP**. 2. Unzip the downloaded file to a location you can easily access. 3. Open the Google Chrome browser and click on the three dots menu (upper right corner). -4. Select "More Tools" and then "Extensions". -5. Turn on the "Developer mode" switch in the top right corner of the Extensions page. -6. Click on the "Load unpacked" button. -7. Select the "Chrome" folder where the DocsGPT files have been unzipped (docsgpt-main > extensions > chrome). +4. Select **More Tools** and then **Extensions**. +5. Turn on the **Developer mode** switch in the top right corner of the **Extensions page**. +6. Click on the **Load unpacked** button. +7. Select the **Chrome** folder where the DocsGPT files have been unzipped (docsgpt-main > extensions > chrome). 8. The extension should now be added to Google Chrome and can be managed on the Extensions page. -9. To disable or remove the extension, simply turn off the toggle switch on the extension card or click the "Remove" button. +9. To disable or remove the extension, simply turn off the toggle switch on the extension card or click the **Remove** button. From ceff618e5d19a41be2f47e0e535c9acdde98be44 Mon Sep 17 00:00:00 2001 From: Roman Bug Date: Mon, 30 Oct 2023 01:18:52 +0300 Subject: [PATCH 3/6] Update API-docs.md --- docs/pages/Developing/API-docs.md | 106 ++++++++++++++++-------------- 1 file changed, 58 insertions(+), 48 deletions(-) diff --git a/docs/pages/Developing/API-docs.md b/docs/pages/Developing/API-docs.md index e8ee521f1..b57f6b1bb 100644 --- a/docs/pages/Developing/API-docs.md +++ b/docs/pages/Developing/API-docs.md @@ -10,14 +10,16 @@ This endpoint is used to request answers to user-provided questions. **Request:** -Method: POST -Headers: Content-Type should be set to "application/json; charset=utf-8" -Request Body: JSON object with the following fields: -* **question:** The user's question -* **history:** (Optional) Previous conversation history -* **api_key:** Your API key -* **embeddings_key:** Your embeddings key -* **active_docs:** The location of active documentation +**Method**: `POST` + +**Headers**: Content-Type should be set to `application/json; charset=utf-8` + +**Request Body**: JSON object with the following fields: +* `question` — The user's question. +* `history` — (Optional) Previous conversation history. +* `api_key`— Your API key. +* `embeddings_key` — Your embeddings key. +* `active_docs` — The location of active documentation. Here is a JavaScript Fetch Request example: ```js @@ -36,7 +38,7 @@ fetch("http://127.0.0.1:5000/api/answer", { **Response** -In response, you will get a JSON document containing the answer,query and the result: +In response, you will get a JSON document containing the `answer`, `query` and `result`: ```json { "answer": "Hi there! How can I help you?\n", @@ -53,9 +55,10 @@ This endpoint will make sure documentation is loaded on the server (just run it **Request:** -Headers: Content-Type should be set to "application/json; charset=utf-8" -Request Body: JSON object with the field: -* **docs:** The location of the documentation +**Headers**: Content-Type should be set to `application/json; charset=utf-8` + +**Request Body**: JSON object with the field: +* `docs` — The location of the documentation: ```js // answer (POST http://127.0.0.1:5000/api/docs_check) fetch("http://127.0.0.1:5000/api/docs_check", { @@ -71,7 +74,7 @@ fetch("http://127.0.0.1:5000/api/docs_check", { **Response:** -In response, you will get a JSON document like this one indicating whether the documentation exists or not.: +In response, you will get a JSON document like this one indicating whether the documentation exists or not: ```json { "status": "exists" @@ -86,19 +89,25 @@ This endpoint provides information about available vectors and their locations w **Request:** -Method: GET +**Method**: `GET` **Response:** Response will include: -`date`, `description`, `docLink`, `fullName`, `language`, `location` (local or docshub), `model`, `name`, `version`. - +* `date` +* `description` +* `docLink` +* `fullName` +* `language` +* `location` (local or docshub) +* `model` +* `name` +* `version` Example of JSON in Docshub and local: image - ### 4. /api/upload **Description:** @@ -106,8 +115,8 @@ This endpoint is used to upload a file that needs to be trained, response is JSO **Request:** -Method: POST -Request Body: A multipart/form-data form with file upload and additional fields, including "user" and "name." +**Method**: `POST` +**Request Body**: A multipart/form-data form with file upload and additional fields, including `user` and `name`. HTML example: @@ -134,8 +143,8 @@ JSON response with a status and a task ID that can be used to check the task's p This endpoint is used to get the status of a task (`task_id`) from `/api/upload` **Request:** -Method: GET -Query Parameter: task_id (task ID to check) +**Method**: `GE`T +**Query Parameter**: `task_id` (task ID to check) **Sample JavaScript Fetch Request:** ```js @@ -155,33 +164,32 @@ fetch("http://localhost:5001/api/task_status?task_id=YOUR_TASK_ID", { There are two types of responses: 1. While the task is still running, the 'current' value will show progress from 0 to 100. - -```json -{ - "result": { - "current": 1 - }, - "status": "PROGRESS" -} -``` + ```json + { + "result": { + "current": 1 + }, + "status": "PROGRESS" + } + ``` 2. When task is completed: -```json -{ - "result": { - "directory": "temp", - "filename": "install.rst", - "formats": [ - ".rst", - ".md", - ".pdf" - ], - "name_job": "somename", - "user": "local" - }, - "status": "SUCCESS" -} -``` + ```json + { + "result": { + "directory": "temp", + "filename": "install.rst", + "formats": [ + ".rst", + ".md", + ".pdf" + ], + "name_job": "somename", + "user": "local" + }, + "status": "SUCCESS" + } + ``` ### 6. /api/delete_old **Description:** @@ -190,7 +198,8 @@ This endpoint is used to delete old Vector Stores. **Request:** -Method: GET +**Method**: `GET` + ```js // Task status (GET http://127.0.0.1:5000/api/docs_check) fetch("http://localhost:5001/api/task_status?task_id=b2d2a0f4-387c-44fd-a443-e4fe2e7454d1", { @@ -205,7 +214,8 @@ fetch("http://localhost:5001/api/task_status?task_id=b2d2a0f4-387c-44fd-a443-e4f ``` **Response:** -JSON response indicating the status of the operation. +JSON response indicating the status of the operation: + ```json { "status": "ok" } ``` From 8990e4666a3f6914d008853a56e233f46bbeb39d Mon Sep 17 00:00:00 2001 From: Roman Bug Date: Mon, 30 Oct 2023 01:46:06 +0300 Subject: [PATCH 4/6] Update Quickstart.md --- docs/pages/Deploying/Quickstart.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/Deploying/Quickstart.md b/docs/pages/Deploying/Quickstart.md index 0b6019439..89aea851f 100644 --- a/docs/pages/Deploying/Quickstart.md +++ b/docs/pages/Deploying/Quickstart.md @@ -14,12 +14,12 @@ If you prefer to follow manual steps, refer to this guide: 1. Open and download this repository with ``` - git clone https://github.com/arc53/DocsGPT.git`. + git clone https://github.com/arc53/DocsGPT.git. ``` 2. Create a `.env` file in your root directory and set your `API_KEY` with your [OpenAI API key](https://platform.openai.com/account/api-keys). 3. Run the following commands: ``` - docker-compose build && docker-compose up`. + docker-compose build && docker-compose up. ``` 4. Navigate to `http://localhost:5173/`. From 54ac2d33e247ee8a3f5b416cf7be236e2e711527 Mon Sep 17 00:00:00 2001 From: Roman Zhukov Date: Mon, 30 Oct 2023 13:06:37 +0300 Subject: [PATCH 5/6] Update Quickstart docs with bash language hl. --- docs/pages/Deploying/Quickstart.md | 36 ++++++++++++++++-------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/docs/pages/Deploying/Quickstart.md b/docs/pages/Deploying/Quickstart.md index 89aea851f..fb6cb7e09 100644 --- a/docs/pages/Deploying/Quickstart.md +++ b/docs/pages/Deploying/Quickstart.md @@ -4,7 +4,7 @@ **On macOS or Linux:** Just run the following command: -``` +```bash ./setup.sh ``` @@ -13,13 +13,13 @@ This command will install all the necessary dependencies and provide you with an If you prefer to follow manual steps, refer to this guide: 1. Open and download this repository with - ``` - git clone https://github.com/arc53/DocsGPT.git. + ```bash + git clone https://github.com/arc53/DocsGPT.git ``` 2. Create a `.env` file in your root directory and set your `API_KEY` with your [OpenAI API key](https://platform.openai.com/account/api-keys). 3. Run the following commands: - ``` - docker-compose build && docker-compose up. + ```bash + docker-compose build && docker-compose up ``` 4. Navigate to `http://localhost:5173/`. @@ -34,17 +34,17 @@ To run the setup on Windows, you have two options: using the Windows Subsystem f 1. Install WSL if you haven't already. You can follow the official Microsoft documentation for installation: (https://learn.microsoft.com/en-us/windows/wsl/install). 2. After setting up WSL, open the WSL terminal. 3. Clone the repository and create the `.env` file: - ``` + ```bash git clone https://github.com/arc53/DocsGPT.git cd DocsGPT echo "API_KEY=Yourkey" > .env echo "VITE_API_STREAMING=true" >> .env ``` 4. Run the following command to start the setup with Docker Compose: - ``` + ```bash ./run-with-docker-compose.sh ``` -6. Open your web browser and navigate to (http://localhost:5173/). +6. Open your web browser and navigate to http://localhost:5173/. 7. To stop the setup, just press **Ctrl + C** in the WSL terminal **Option 2: Using Git Bash or Command Prompt (CMD):** @@ -52,17 +52,17 @@ To run the setup on Windows, you have two options: using the Windows Subsystem f 1. Install Git for Windows if you haven't already. Download it from the official website: (https://gitforwindows.org/). 2. Open Git Bash or Command Prompt. 3. Clone the repository and create the `.env` file: - ``` + ```bash git clone https://github.com/arc53/DocsGPT.git cd DocsGPT echo "API_KEY=Yourkey" > .env echo "VITE_API_STREAMING=true" >> .env ``` 4. Run the following command to start the setup with Docker Compose: - ``` + ```bash ./run-with-docker-compose.sh ``` -5. Open your web browser and navigate to (http://localhost:5173/). +5. Open your web browser and navigate to http://localhost:5173/. 6. To stop the setup, just press **Ctrl + C** in the Git Bash or Command Prompt terminal. These steps should help you set up and run the project on Windows using either WSL or Git Bash/Command Prompt. @@ -78,15 +78,17 @@ Option 1: Using Windows Subsystem for Linux (WSL): 1. Install WSL if you haven't already. You can follow the official Microsoft documentation for installation: (https://learn.microsoft.com/en-us/windows/wsl/install). 2. After setting up WSL, open the WSL terminal. 3. Clone the repository and create the `.env` file: - ``` + ```bash git clone https://github.com/arc53/DocsGPT.git cd DocsGPT echo "API_KEY=Yourkey" > .env echo "VITE_API_STREAMING=true" >> .env ``` 4. Run the following command to start the setup with Docker Compose: - `./run-with-docker-compose.sh` -5. Open your web browser and navigate to (http://localhost:5173/). + ```bash + ./run-with-docker-compose.sh + ``` +5. Open your web browser and navigate to http://localhost:5173/. 6. To stop the setup, just press **Ctrl + C** in the WSL terminal. Option 2: Using Git Bash or Command Prompt (CMD): @@ -94,17 +96,17 @@ Option 2: Using Git Bash or Command Prompt (CMD): 1. Install Git for Windows if you haven't already. You can download it from the official website: (https://gitforwindows.org/). 2. Open Git Bash or Command Prompt. 3. Clone the repository and create the `.env` file: - ``` + ```bash git clone https://github.com/arc53/DocsGPT.git cd DocsGPT echo "API_KEY=Yourkey" > .env echo "VITE_API_STREAMING=true" >> .env ``` 4. Run the following command to start the setup with Docker Compose: - ``` + ```bash ./run-with-docker-compose.sh ``` -5. Open your web browser and navigate to (http://localhost:5173/). +5. Open your web browser and navigate to http://localhost:5173/. 6. To stop the setup, just press **Ctrl + C** in the Git Bash or Command Prompt terminal. These steps should help you set up and run the project on Windows using either WSL or Git Bash/Command Prompt. Make sure you have Docker installed and properly configured on your Windows system for this to work. From 560c063db43b026c4dc1264cc7462fba13702314 Mon Sep 17 00:00:00 2001 From: Roman Zhukov Date: Mon, 30 Oct 2023 13:20:19 +0300 Subject: [PATCH 6/6] Update Quickstart docs with bash language hl. --- docs/pages/Deploying/Quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/Deploying/Quickstart.md b/docs/pages/Deploying/Quickstart.md index fb6cb7e09..cb5fcf389 100644 --- a/docs/pages/Deploying/Quickstart.md +++ b/docs/pages/Deploying/Quickstart.md @@ -21,7 +21,7 @@ If you prefer to follow manual steps, refer to this guide: ```bash docker-compose build && docker-compose up ``` -4. Navigate to `http://localhost:5173/`. +4. Navigate to http://localhost:5173/. To stop, simply press **Ctrl + C**.