From e9c4b0dc0160e7be932f649d1534b5c814581a17 Mon Sep 17 00:00:00 2001 From: Aditya Aryaman Das <128703909+alienishi@users.noreply.github.com> Date: Fri, 6 Oct 2023 17:24:49 +0530 Subject: [PATCH 001/347] Updated README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98958c8d..be9ce41d 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize - Extensions - Chrome extension. -- Scripts - Script that creates similarity search index and stores for other libraries. +- Scripts - Script that creates similarity search index and storage for other libraries. - Frontend - Frontend uses Vite and React. From 4b1dad96cd4a7d90af5d85fc4aae0ac0dcc53343 Mon Sep 17 00:00:00 2001 From: Ayan Joshi Date: Sun, 8 Oct 2023 12:42:56 +0530 Subject: [PATCH 002/347] Commit --- application/prompts/custom_prompt.txt | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 application/prompts/custom_prompt.txt diff --git a/application/prompts/custom_prompt.txt b/application/prompts/custom_prompt.txt new file mode 100644 index 00000000..054da1e1 --- /dev/null +++ b/application/prompts/custom_prompt.txt @@ -0,0 +1,34 @@ +Welcome to the custom prompt file. You can use this file to create prompts for various tasks or experiments. Below are some examples of prompts you can use: + +1. *Summarization Task:* + + Prompt: Summarize the following article in 3-4 sentences. + Input: [Insert article here] + Output: Summarized article + +2. *Translation Task:* + + Prompt: Translate the English text into French. + Input: "Hello, how are you?" + Output: "Bonjour, comment Γ§a va ?" + +3. *Coding Task:* + + Prompt: Write a Python function that calculates the factorial of a given number. + Input: (Provide any specific number) + Output: (Gives factorial of the number) + +4. *Question-Answering Task:* + + Prompt: Answer the following question based on the given passage. + Input: [Insert passage here] + Question: [Insert question here] + Output: [Provided answer of the question] + +5. *Story Generation Task:* + + Prompt: Generate a short story about a detective solving a mystery. + Input: [Provide any additional context or details] + Output: [Gives short summary of the story] + +Feel free to customize and add your own prompts to this file. Each section includes a prompt and optional input. Happy Coding ! \ No newline at end of file From a8180bddadf8efd40c355c593a6760161719fc83 Mon Sep 17 00:00:00 2001 From: Harsh Mahajan <127186841+HarshMN2345@users.noreply.github.com> Date: Sun, 8 Oct 2023 18:02:54 +0530 Subject: [PATCH 003/347] Update API-docs.md done all the changes proposed in issue #508 --- docs/pages/Developing/API-docs.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/pages/Developing/API-docs.md b/docs/pages/Developing/API-docs.md index eabd29c0..4171f17f 100644 --- a/docs/pages/Developing/API-docs.md +++ b/docs/pages/Developing/API-docs.md @@ -91,7 +91,7 @@ Response: ### /api/task_status Gets task status (`task_id`) from `/api/upload`: ```js -// Task status (Get http://127.0.0.1:5000/api/task_status) +// Find task status (Get http://127.0.0.1:5000/api/task_status) fetch("http://localhost:5001/api/task_status?task_id=b2d2a0f4-387c-44fd-a443-e4fe2e7454d1", { "method": "GET", "headers": { @@ -104,7 +104,7 @@ fetch("http://localhost:5001/api/task_status?task_id=b2d2a0f4-387c-44fd-a443-e4f Responses: There are two types of responses: -1. while task it still running, where "current" will show progress from 0 to 100 +1. While the task is still running, the 'current' value will show progress from 0 to 100. ```json { "result": { @@ -134,6 +134,9 @@ There are two types of responses: ### /api/delete_old Deletes old vectorstores: + +In this section, you may come across the term "vectorstores". If you're unfamiliar with what Vector Stores are, you can find more information in this [article](https://python.langchain.com/docs/modules/data_connection/vectorstores/) that provides a detailed explanation. + ```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", { @@ -144,7 +147,6 @@ fetch("http://localhost:5001/api/task_status?task_id=b2d2a0f4-387c-44fd-a443-e4f }) .then((res) => res.text()) .then(console.log.bind(console)) -``` Response: From c688656607a6be2cbdf57038a75bf533556fb4ab Mon Sep 17 00:00:00 2001 From: Ayan Joshi Date: Mon, 9 Oct 2023 14:27:59 +0530 Subject: [PATCH 004/347] Commit --- application/prompts/custom_prompt.txt | 34 -------------------- docs/pages/Guides/Customising-prompts.md | 40 ++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 36 deletions(-) delete mode 100644 application/prompts/custom_prompt.txt diff --git a/application/prompts/custom_prompt.txt b/application/prompts/custom_prompt.txt deleted file mode 100644 index 054da1e1..00000000 --- a/application/prompts/custom_prompt.txt +++ /dev/null @@ -1,34 +0,0 @@ -Welcome to the custom prompt file. You can use this file to create prompts for various tasks or experiments. Below are some examples of prompts you can use: - -1. *Summarization Task:* - - Prompt: Summarize the following article in 3-4 sentences. - Input: [Insert article here] - Output: Summarized article - -2. *Translation Task:* - - Prompt: Translate the English text into French. - Input: "Hello, how are you?" - Output: "Bonjour, comment Γ§a va ?" - -3. *Coding Task:* - - Prompt: Write a Python function that calculates the factorial of a given number. - Input: (Provide any specific number) - Output: (Gives factorial of the number) - -4. *Question-Answering Task:* - - Prompt: Answer the following question based on the given passage. - Input: [Insert passage here] - Question: [Insert question here] - Output: [Provided answer of the question] - -5. *Story Generation Task:* - - Prompt: Generate a short story about a detective solving a mystery. - Input: [Provide any additional context or details] - Output: [Gives short summary of the story] - -Feel free to customize and add your own prompts to this file. Each section includes a prompt and optional input. Happy Coding ! \ No newline at end of file diff --git a/docs/pages/Guides/Customising-prompts.md b/docs/pages/Guides/Customising-prompts.md index 1d3a7d4a..e2e26133 100644 --- a/docs/pages/Guides/Customising-prompts.md +++ b/docs/pages/Guides/Customising-prompts.md @@ -1,4 +1,40 @@ -## To customize a main prompt navigate to `/application/prompt/combine_prompt.txt` +# Customizing the Main Prompt -You can try editing it to see how the model responses. +To customize the main prompt for DocsGPT, follow these steps: + +1. Navigate to `/application/prompt/combine_prompt.txt`. + +2. Edit the `combine_prompt.txt` file to modify the prompt text. You can experiment with different phrasings and structures to see how the model responds. + +## Example Prompt Modification + +**Original Prompt:** +```markdown +QUESTION: How to merge tables in pandas? +========= +Content: pandas provides various facilities for easily combining together Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. +Source: 28-pl +Content: pandas provides a single function, merge(), as the entry point for all standard database join operations between DataFrame or named Series objects: \n\npandas.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes=('_x', '_y'), copy=True, indicator=False, validate=None) +Source: 30-pl +========= +FINAL ANSWER: To merge two tables in pandas, you can use the pd.merge() function. The basic syntax is: \n\npd.merge(left, right, on, how) \n\nwhere left and right are the two tables to merge, on is the column to merge on, and how is the type of merge to perform. \n\nFor example, to merge the two tables df1 and df2 on the column 'id', you can use: \n\npd.merge(df1, df2, on='id', how='inner') +SOURCES: 28-pl 30-pl + + +## Modified Prompt (for illustration): + +QUESTION: Explain the concept of pandas merge in Python. +========= +Content: The pandas merge function in Python allows you to combine DataFrame objects by performing SQL-style joins. It is a powerful tool for data manipulation and analysis. +Source: Official pandas documentation +Content: You can use the merge function with various options such as 'how,' 'on,' 'left_on,' and 'right_on' to control how the merging is done. +Source: Data science tutorial blog +========= +FINAL ANSWER: To perform a pandas merge in Python, use the `pd.merge()` function. This function takes two DataFrames as input and merges them based on the specified columns. For example, to merge DataFrames `df1` and `df2` on the 'key' column, you can use: `pd.merge(df1, df2, on='key', how='inner')`. +SOURCES: Official pandas documentation, Data science tutorial blog + + +## Conclusion + +Customizing the main prompt for DocsGPT allows you to tailor the AI's responses to your unique requirements. Whether you need in-depth explanations, code examples, or specific insights, you can achieve it by modifying the main prompt. Remember to experiment and fine-tune your prompts to get the best results. From e1dc0a576dcad0813891b4880e1e224d42052168 Mon Sep 17 00:00:00 2001 From: Harsh Mahajan <127186841+HarshMN2345@users.noreply.github.com> Date: Mon, 9 Oct 2023 17:45:50 +0530 Subject: [PATCH 005/347] Update API-docs.md --- docs/pages/Developing/API-docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/Developing/API-docs.md b/docs/pages/Developing/API-docs.md index 4171f17f..d9e2edf0 100644 --- a/docs/pages/Developing/API-docs.md +++ b/docs/pages/Developing/API-docs.md @@ -91,7 +91,7 @@ Response: ### /api/task_status Gets task status (`task_id`) from `/api/upload`: ```js -// Find task status (Get http://127.0.0.1:5000/api/task_status) +// Task status (Get http://127.0.0.1:5000/api/task_status) fetch("http://localhost:5001/api/task_status?task_id=b2d2a0f4-387c-44fd-a443-e4fe2e7454d1", { "method": "GET", "headers": { From c21e0755b3404e9d4f67904fe953e09110cb1a1f Mon Sep 17 00:00:00 2001 From: Harsh Mahajan <127186841+HarshMN2345@users.noreply.github.com> Date: Mon, 9 Oct 2023 17:55:41 +0530 Subject: [PATCH 006/347] Update API-docs.md --- docs/pages/Developing/API-docs.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/pages/Developing/API-docs.md b/docs/pages/Developing/API-docs.md index d9e2edf0..dd820f48 100644 --- a/docs/pages/Developing/API-docs.md +++ b/docs/pages/Developing/API-docs.md @@ -114,7 +114,7 @@ There are two types of responses: } ``` -2. When task is completed +2. When task is completed: ```json { "result": { @@ -133,9 +133,7 @@ There are two types of responses: ``` ### /api/delete_old -Deletes old vectorstores: - -In this section, you may come across the term "vectorstores". If you're unfamiliar with what Vector Stores are, you can find more information in this [article](https://python.langchain.com/docs/modules/data_connection/vectorstores/) that provides a detailed explanation. +Deletes old [Vector Stores]('https://python.langchain.com/docs/modules/data_connection/vectorstores/'): ```js // Task status (GET http://127.0.0.1:5000/api/docs_check) From 91fa932168f241a3e072251a84105483ff20e0bf Mon Sep 17 00:00:00 2001 From: Ankita Sikdar <115947852+AnkitaSikdar005@users.noreply.github.com> Date: Tue, 10 Oct 2023 02:06:52 +0530 Subject: [PATCH 007/347] Update CONTRIBUTING.md --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8be36122..d864e73f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,11 +17,11 @@ Thank you for choosing to contribute to DocsGPT! We are all very grateful! ## 🐞 Issues and Pull requests -We value contributions in the form of discussions or suggestions. We recommend taking a look at existing issues and our [roadmap](https://github.com/orgs/arc53/projects/2). +- We value contributions in the form of discussions or suggestions. We recommend taking a look at existing issues and our [roadmap](https://github.com/orgs/arc53/projects/2). -If you're interested in contributing code, here are some important things to know: +- If you're interested in contributing code, here are some important things to know: -We have a frontend built with React (Vite) and a backend in Python. +- We have a frontend built on React (Vite) and a backend in Python. ### If you are looking to contribute to frontend (βš›οΈReact, Vite): From 3b6f3f13d408f68379c0cc4dd8ff94245bf73244 Mon Sep 17 00:00:00 2001 From: Shruti Sen <115914670+shruti-sen2004@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:12:25 +0530 Subject: [PATCH 008/347] Update CONTRIBUTING.md --- CONTRIBUTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8be36122..16f42cee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,8 +44,10 @@ To run unit tests from the root of the repository, execute: python -m pytest ``` -### Workflow: -Fork the repository, make your changes on your forked version, and then submit those changes as a pull request. +### WorkflowπŸ“ˆ : +- Fork the repository
+- Make the required changes on your forked version
+- Commit those changes and submit those as a pull request so that it reflects on thr main repository.
## Questions/collaboration Feel free to join our [Discord](https://discord.gg/n5BX8dh8rU). We're very friendly and welcoming to new contributors, so don't hesitate to reach out. From e48df87e06db88fdf822c73e7c26f9df917b8796 Mon Sep 17 00:00:00 2001 From: hariraghav10 Date: Tue, 10 Oct 2023 17:04:05 +0530 Subject: [PATCH 009/347] added autofocus feature for chat input div --- frontend/src/conversation/Conversation.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 5b2e6981..9e574e9c 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -29,6 +29,16 @@ export default function Conversation() { scrollIntoView(); }, [queries.length, queries[queries.length - 1]]); + useEffect(() => { + const element = document.getElementById('inputbox') as HTMLInputElement; + if (element) { + element.focus(); + console.log("Element with ID 'inputbox' found"); + } else { + console.log("Element with ID 'inputbox' not found"); + } + }, []); + useEffect(() => { const observerCallback: IntersectionObserverCallback = (entries) => { entries.forEach((entry) => { @@ -152,7 +162,9 @@ export default function Conversation() {
Date: Tue, 10 Oct 2023 17:22:10 +0530 Subject: [PATCH 010/347] added autofocus for user chat input --- frontend/src/conversation/Conversation.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 9e574e9c..87a5ebb7 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -33,9 +33,6 @@ export default function Conversation() { const element = document.getElementById('inputbox') as HTMLInputElement; if (element) { element.focus(); - console.log("Element with ID 'inputbox' found"); - } else { - console.log("Element with ID 'inputbox' not found"); } }, []); From 43a9bc0d7b24a876a9253b2ad287f85106710cd9 Mon Sep 17 00:00:00 2001 From: Shruti Sen <115914670+shruti-sen2004@users.noreply.github.com> Date: Tue, 10 Oct 2023 17:22:38 +0530 Subject: [PATCH 011/347] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 16f42cee..d55880fd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,7 +44,7 @@ To run unit tests from the root of the repository, execute: python -m pytest ``` -### WorkflowπŸ“ˆ : +### Workflow πŸ“ˆ : - Fork the repository
- Make the required changes on your forked version
- Commit those changes and submit those as a pull request so that it reflects on thr main repository.
From 56d0981ceea12492378770f23065a9f51d211b76 Mon Sep 17 00:00:00 2001 From: Shruti Sen <115914670+shruti-sen2004@users.noreply.github.com> Date: Tue, 10 Oct 2023 17:35:18 +0530 Subject: [PATCH 012/347] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d55880fd..f4f01402 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,7 +45,7 @@ python -m pytest ``` ### Workflow πŸ“ˆ : -- Fork the repository
+- Fork repository
- Make the required changes on your forked version
- Commit those changes and submit those as a pull request so that it reflects on thr main repository.
From 4d29cae936418da6f077c3fd6160ca1b8053a834 Mon Sep 17 00:00:00 2001 From: Shruti Sen <115914670+shruti-sen2004@users.noreply.github.com> Date: Tue, 10 Oct 2023 17:39:07 +0530 Subject: [PATCH 013/347] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f4f01402..f3e124e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,8 +45,8 @@ python -m pytest ``` ### Workflow πŸ“ˆ : -- Fork repository
-- Make the required changes on your forked version
+- Fork repository +- Make the required changes on your forked version - Commit those changes and submit those as a pull request so that it reflects on thr main repository.
## Questions/collaboration From dc14245105f4c5fb5eccbca071a00c330c54305f Mon Sep 17 00:00:00 2001 From: Shruti Sen <115914670+shruti-sen2004@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:05:19 +0530 Subject: [PATCH 014/347] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f3e124e8..76e60f65 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,7 +47,7 @@ python -m pytest ### Workflow πŸ“ˆ : - Fork repository - Make the required changes on your forked version -- Commit those changes and submit those as a pull request so that it reflects on thr main repository.
+- Commit those changes and submit those as a pull request so that it reflects on thr main repository. ## Questions/collaboration Feel free to join our [Discord](https://discord.gg/n5BX8dh8rU). We're very friendly and welcoming to new contributors, so don't hesitate to reach out. From d7b28a35867e5751aa4f735d5af0bbbf120dca2a Mon Sep 17 00:00:00 2001 From: Ayan Joshi Date: Tue, 10 Oct 2023 19:10:24 +0530 Subject: [PATCH 015/347] Update Customising-prompts.md --- docs/pages/Guides/Customising-prompts.md | 26 +++++++----------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/docs/pages/Guides/Customising-prompts.md b/docs/pages/Guides/Customising-prompts.md index e2e26133..2426974c 100644 --- a/docs/pages/Guides/Customising-prompts.md +++ b/docs/pages/Guides/Customising-prompts.md @@ -10,28 +10,16 @@ To customize the main prompt for DocsGPT, follow these steps: **Original Prompt:** ```markdown -QUESTION: How to merge tables in pandas? -========= -Content: pandas provides various facilities for easily combining together Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. -Source: 28-pl -Content: pandas provides a single function, merge(), as the entry point for all standard database join operations between DataFrame or named Series objects: \n\npandas.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes=('_x', '_y'), copy=True, indicator=False, validate=None) -Source: 30-pl -========= -FINAL ANSWER: To merge two tables in pandas, you can use the pd.merge() function. The basic syntax is: \n\npd.merge(left, right, on, how) \n\nwhere left and right are the two tables to merge, on is the column to merge on, and how is the type of merge to perform. \n\nFor example, to merge the two tables df1 and df2 on the column 'id', you can use: \n\npd.merge(df1, df2, on='id', how='inner') -SOURCES: 28-pl 30-pl +You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible. +Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses. +You have access to chat history, and can use it to help answer the question. +When using code examples, use the following format: +(code) +{summaries} -## Modified Prompt (for illustration): +Thank you -QUESTION: Explain the concept of pandas merge in Python. -========= -Content: The pandas merge function in Python allows you to combine DataFrame objects by performing SQL-style joins. It is a powerful tool for data manipulation and analysis. -Source: Official pandas documentation -Content: You can use the merge function with various options such as 'how,' 'on,' 'left_on,' and 'right_on' to control how the merging is done. -Source: Data science tutorial blog -========= -FINAL ANSWER: To perform a pandas merge in Python, use the `pd.merge()` function. This function takes two DataFrames as input and merges them based on the specified columns. For example, to merge DataFrames `df1` and `df2` on the 'key' column, you can use: `pd.merge(df1, df2, on='key', how='inner')`. -SOURCES: Official pandas documentation, Data science tutorial blog ## Conclusion From 11cd02296567bbfaa0d6b9897ba757f355717046 Mon Sep 17 00:00:00 2001 From: Harsh Mahajan <127186841+HarshMN2345@users.noreply.github.com> Date: Tue, 10 Oct 2023 23:22:11 +0530 Subject: [PATCH 016/347] Update API-docs.md --- docs/pages/Developing/API-docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/Developing/API-docs.md b/docs/pages/Developing/API-docs.md index dd820f48..a95f3e1f 100644 --- a/docs/pages/Developing/API-docs.md +++ b/docs/pages/Developing/API-docs.md @@ -133,7 +133,7 @@ There are two types of responses: ``` ### /api/delete_old -Deletes old [Vector Stores]('https://python.langchain.com/docs/modules/data_connection/vectorstores/'): +Deletes old [Vector Stores](): ```js // Task status (GET http://127.0.0.1:5000/api/docs_check) From 79bb79debc0ba843751dacf7bdeade6f8fbe2371 Mon Sep 17 00:00:00 2001 From: DHRUVKADAM22 <147514863+DHRUVKADAM22@users.noreply.github.com> Date: Tue, 10 Oct 2023 23:29:46 +0530 Subject: [PATCH 017/347] Update README.md I have added quick start guide for windows more specifically makes more user friendly by adding basic info and description (which make user or newbies to get understand properly.) --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index db561862..f8d977ce 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,47 @@ Otherwise, refer to this Guide: To stop, just run `Ctrl + C`. + +For WINDOWS: + +To run the given setup on Windows, you can use the Windows Subsystem for Linux (WSL) or a Git Bash terminal to execute similar commands. Here are the steps adapted for Windows: + +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: + ``` + 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/). +6. To stop the setup, just press `Ctrl + C` in the WSL terminal + +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: + ``` + 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/). +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. + + ## Development environments ### Spin up mongo and redis From 31fb1801d2735f5bc7194cafd7fa53790ce91602 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 21:18:11 +0000 Subject: [PATCH 018/347] Bump langchain from 0.0.308 to 0.0.312 in /application Bumps [langchain](https://github.com/langchain-ai/langchain) from 0.0.308 to 0.0.312. - [Release notes](https://github.com/langchain-ai/langchain/releases) - [Commits](https://github.com/langchain-ai/langchain/compare/v0.0.308...v0.0.312) --- updated-dependencies: - dependency-name: langchain dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- application/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/requirements.txt b/application/requirements.txt index b4c712f4..6ffad8ec 100644 --- a/application/requirements.txt +++ b/application/requirements.txt @@ -41,7 +41,7 @@ Jinja2==3.1.2 jmespath==1.0.1 joblib==1.2.0 kombu==5.2.4 -langchain==0.0.308 +langchain==0.0.312 loguru==0.6.0 lxml==4.9.2 MarkupSafe==2.1.2 From ddd938fd646242be3489dd866df56909a10b90a0 Mon Sep 17 00:00:00 2001 From: Exterminator11 Date: Wed, 11 Oct 2023 07:36:37 +0530 Subject: [PATCH 019/347] Parser for OpenAPI3(Swagger) --- scripts/parser/file/openapi3_parser.py | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 scripts/parser/file/openapi3_parser.py diff --git a/scripts/parser/file/openapi3_parser.py b/scripts/parser/file/openapi3_parser.py new file mode 100644 index 00000000..72feab71 --- /dev/null +++ b/scripts/parser/file/openapi3_parser.py @@ -0,0 +1,46 @@ +from urllib.parse import urlparse + +from openapi_parser import parse + +from base_parser import BaseParser + + +class OpenAPI3Parser(BaseParser): + def init_parser(self) -> None: + return super().init_parser() + + def get_base_urls(self, urls): + base_urls = [] + for i in urls: + parsed_url = urlparse(i) + base_url = parsed_url.scheme + "://" + parsed_url.netloc + if base_url not in base_urls: + base_urls.append(base_url) + return base_urls + + def get_info_from_paths(self, path): + info = "" + for operation in path.operations: + info += ( + f"\n{operation.method.value}=" + f"{operation.responses[0].description}" + ) + return info + + def parse_file(self, file_path): + data = parse(file_path) + results = "" + base_urls = self.get_base_urls(link.url for link in data.servers) + base_urls = ",".join([base_url for base_url in base_urls]) + results += f"Base URL:{base_urls}\n" + i = 1 + for path in data.paths: + info = self.get_info_from_paths(path) + results += ( + f"Path{i}: {path.url}\n" + f"description: {path.description}\n" + f"parameters: {path.parameters}\nmethods: {info}\n" + ) + i += 1 + with open("results.txt", "w") as f: + f.write(results) From 84c822a0ca0b6f02ba9e72b1f0c0506fe9fe2ecc Mon Sep 17 00:00:00 2001 From: M Sai Kiran <116418856+MSaiKiran9@users.noreply.github.com> Date: Wed, 11 Oct 2023 09:38:15 +0530 Subject: [PATCH 020/347] Before File Selection Train Button Disabled --- frontend/src/upload/Upload.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/upload/Upload.tsx b/frontend/src/upload/Upload.tsx index 755a9ad4..db2136ec 100644 --- a/frontend/src/upload/Upload.tsx +++ b/frontend/src/upload/Upload.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useRef } from 'react'; import { useCallback, useEffect, useState } from 'react'; import { useDropzone } from 'react-dropzone'; import { useDispatch } from 'react-redux'; @@ -55,9 +55,8 @@ export default function Upload({ setProgress(undefined); setModalState('INACTIVE'); }} - className={`rounded-3xl bg-purple-30 px-4 py-2 text-sm font-medium text-white ${ - isCancellable ? '' : 'hidden' - }`} + className={`rounded-3xl bg-purple-30 px-4 py-2 text-sm font-medium text-white ${isCancellable ? '' : 'hidden' + }`} > Finish @@ -189,6 +188,7 @@ export default function Upload({ Name
+ * Choose Files @@ -206,7 +206,9 @@ export default function Upload({
@@ -227,9 +229,8 @@ export default function Upload({ return (
{view} From 76baa6c5f85baff064b7212deeed94ce87d215b3 Mon Sep 17 00:00:00 2001 From: M Sai Kiran <116418856+MSaiKiran9@users.noreply.github.com> Date: Wed, 11 Oct 2023 09:39:04 +0530 Subject: [PATCH 021/347] Before File Selection Train Disabled 1 --- frontend/src/upload/Upload.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/upload/Upload.tsx b/frontend/src/upload/Upload.tsx index db2136ec..b79e8923 100644 --- a/frontend/src/upload/Upload.tsx +++ b/frontend/src/upload/Upload.tsx @@ -1,4 +1,4 @@ -import React, { useRef } from 'react'; +import React from 'react'; import { useCallback, useEffect, useState } from 'react'; import { useDropzone } from 'react-dropzone'; import { useDispatch } from 'react-redux'; From 9bacae4b2e24474cd9ea582f2101f0ba1dd9f8cc Mon Sep 17 00:00:00 2001 From: DHRUVKADAM22 <147514863+DHRUVKADAM22@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:06:44 +0530 Subject: [PATCH 022/347] Update README.md --- README.md | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/README.md b/README.md index f8d977ce..54eb94e5 100644 --- a/README.md +++ b/README.md @@ -106,44 +106,7 @@ Otherwise, refer to this Guide: To stop, just run `Ctrl + C`. -For WINDOWS: -To run the given setup on Windows, you can use the Windows Subsystem for Linux (WSL) or a Git Bash terminal to execute similar commands. Here are the steps adapted for Windows: - -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: - ``` - 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/). -6. To stop the setup, just press `Ctrl + C` in the WSL terminal - -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: - ``` - 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/). -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. ## Development environments From c969e9c014cebc7aef3068e15486c547fe663140 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 11 Oct 2023 23:11:08 +0100 Subject: [PATCH 023/347] fix update and delete bug --- frontend/src/Navigation.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 7a55cd09..e236b8a3 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -88,12 +88,6 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { method: 'POST', }) .then(() => { - // remove the image element from the DOM - const imageElement = document.querySelector( - `#img-${id}`, - ) as HTMLElement; - const parentElement = imageElement.parentNode as HTMLElement; - parentElement.parentNode?.removeChild(parentElement); fetchConversations(); }) .catch((error) => console.error(error)); @@ -239,9 +233,9 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
{conversations - ? conversations.map((conversation, index) => ( + ? conversations.map((conversation) => ( handleConversationClick(id)} onDeleteConversation={(id) => handleDeleteConversation(id)} From 51f2ca72b9b300c62b7ebd0d64ddcb2b7c472159 Mon Sep 17 00:00:00 2001 From: Rahul Kumar <104289350+rahul0x00@users.noreply.github.com> Date: Thu, 12 Oct 2023 03:19:40 +0000 Subject: [PATCH 024/347] Enhanced Documentation for Self-Hosting DocsGPT on Amazon Lightsail --- docs/pages/Deploying/Hosting-the-app.md | 62 +++++++++++-------------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/docs/pages/Deploying/Hosting-the-app.md b/docs/pages/Deploying/Hosting-the-app.md index 13296b49..f26bff6b 100644 --- a/docs/pages/Deploying/Hosting-the-app.md +++ b/docs/pages/Deploying/Hosting-the-app.md @@ -6,47 +6,40 @@ Here's a step-by-step guide on how to setup an Amazon Lightsail instance to host (If you know how to create a Lightsail instance, you can skip to the recommended configuration part by clicking here). -### 1. Create an account or login to https://lightsail.aws.amazon.com +### 1. Create an AWS Account: +If you haven't already, create or log in to your AWS account at lightsail.aws.amazon.com. -### 2. Click on "Create instance" +### 2. Create an Instance: -### 3. Create your instance +a. Click "Create Instance." -The first step is to select the "Instance location". In most cases, there's no need to switch locations as the default one will work well. +b. Select the "Instance location." In most cases, the default location works fine. -After that, it is time to pick your Instance Image. We recommend using "Linux/Unix" as the image and "Ubuntu 20.04 LTS" as the Operating System. +c. Choose "Linux/Unix" as the image and "Ubuntu 20.04 LTS" as the Operating System. -As for instance plan, it'll vary depending on your unique demands, but a "1 GB, 1vCPU, 40GB SSD and 2TB transfer" setup should cover most scenarios. +d. Configure the instance plan based on your requirements. A "1 GB, 1vCPU, 40GB SSD, and 2TB transfer" setup is recommended for most scenarios. -Lastly, identify your instance by giving it a unique name and then hit "Create instance". +e. Give your instance a unique name and click "Create Instance." -PS: Once you create your instance, it'll likely take a few minutes for the setup to be completed. +PS: It may take a few minutes for the instance setup to complete. -#### The recommended configuration is as follows: +### Connecting to Your newly created Instance -- Ubuntu 20.04 LTS -- 1GB RAM -- 1vCPU -- 40GB SSD Hard Drive -- 2TB transfer +Your instance will be ready a few minutes after creation. To access it, open the instance and click "Connect using SSH." -### Connecting to your newly created instance +#### Clone the DocsGPT Repository -Your instance will be ready for use a few minutes after being created. To access it, just open it up and click on "Connect using SSH". - -#### Clone the repository - -A terminal window will pop up, and the first step will be to clone the DocsGPT git repository: +A terminal window will pop up, and the first step will be to clone the DocsGPT Git repository: `git clone https://github.com/arc53/DocsGPT.git` #### Download the package information -Once it has finished cloning the repository, it is time to download the package information from all sources. To do so, simply enter the following command: +Once it has finished cloning the repository, it is time to download the package information from all sources. To do so simply enter the following command: `sudo apt update` -#### Install Docker and Docker Compose +#### Installing Docker and Docker Compose DocsGPT backend and worker use Python, Frontend is written on React and the whole application is containerized using Docker. To install Docker and Docker Compose, enter the following commands: @@ -56,15 +49,15 @@ And now install docker-compose: `sudo apt install docker-compose` -#### Access the DocsGPT folder +#### Access the DocsGPT Folder Enter the following command to access the folder in which DocsGPT docker-compose file is present. `cd DocsGPT/` -#### Prepare the environment +#### Prepare the Environment -Inside the DocsGPT folder, create a `.env` file and copy the contents of `.env_sample` into it. +Inside the DocsGPT folder create a `.env` file and copy the contents of `.env_sample` into it. `nano .env` @@ -78,16 +71,16 @@ SELF_HOSTED_MODEL=false To save the file, press CTRL+X, then Y, and then ENTER. -Next, we need to set a correct IP for our Backend. To do so, open the docker-compose.yml file: +Next, set the correct IP for the Backend by opening the docker-compose.yml file: `nano docker-compose.yml` -And change this line 7 `VITE_API_HOST=http://localhost:7091` +And Change line 7 to: `VITE_API_HOST=http://localhost:7091` to this `VITE_API_HOST=http://:7091` This will allow the frontend to connect to the backend. -#### Running the app +#### Running the Application You're almost there! Now that all the necessary bits and pieces have been installed, it is time to run the application. To do so, use the following command: @@ -95,18 +88,17 @@ You're almost there! Now that all the necessary bits and pieces have been instal Launching it for the first time will take a few minutes to download all the necessary dependencies and build. -Once this is done, you can go ahead and close the terminal window. +Once this is done you can go ahead and close the terminal window. -#### Enabling ports +#### Enabling Ports -Before you are able to access your live instance, you must first enable the port that it is using. +a. Before you are able to access your live instance, you must first enable the port that it is using. -Open your Lightsail instance and head to "Networking". +b. Open your Lightsail instance and head to "Networking". -Then click on "Add rule" under "IPv4 Firewall", enter `5173` as your port, and hit "Create". +c. Then click on "Add rule" under "IPv4 Firewall", enter `5173` as your port, and hit "Create". Repeat the process for port `7091`. #### Access your instance -Your instance will now be available under your Public IP Address and port `5173`. Enjoy! - +Your instance is now available at your Public IP Address on port 5173. Enjoy using DocsGPT! From ca3e549dd4f35d3c7b3b33ff85a32e861f6ccd83 Mon Sep 17 00:00:00 2001 From: shivanandmn Date: Thu, 12 Oct 2023 13:29:52 +0530 Subject: [PATCH 025/347] added delete index of vector store in faiss --- application/vectorstore/faiss.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/vectorstore/faiss.py b/application/vectorstore/faiss.py index 217b0457..e5e8f7f5 100644 --- a/application/vectorstore/faiss.py +++ b/application/vectorstore/faiss.py @@ -24,3 +24,6 @@ class FaissStore(BaseVectorStore): def save_local(self, *args, **kwargs): return self.docsearch.save_local(*args, **kwargs) + + def delete_index(self, *args, **kwargs): + return self.docsearch.delete(*args, **kwargs) From 80e2d0651b852b86b5026536210ee47e093f7fd6 Mon Sep 17 00:00:00 2001 From: ankur0904 Date: Thu, 12 Oct 2023 14:32:44 +0530 Subject: [PATCH 026/347] Adds contributing guidelines with steps --- CONTRIBUTING.md | 57 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 76e60f65..c8798c4b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,10 +44,59 @@ To run unit tests from the root of the repository, execute: python -m pytest ``` -### Workflow πŸ“ˆ : -- Fork repository -- Make the required changes on your forked version -- Commit those changes and submit those as a pull request so that it reflects on thr main repository. +## Workflow πŸ“ˆ + +Here's a step-by-step guide on how to contribute to DocsGPT: + +1. **Fork the Repository:** + - Click the "Fork" button at the top-right of this repository to create your fork. + +2. **Create and Switch to a New Branch:** + - Create a new branch for your contribution using: + ```shell + git checkout -b your-branch-name + ``` + +3. **Make Changes:** + - Make the required changes in your branch. + +4. **Add Changes to the Staging Area:** + - Add your changes to the staging area using: + ```shell + git add . + ``` + +5. **Commit Your Changes:** + - Commit your changes with a descriptive commit message using: + ```shell + git commit -m "Your descriptive commit message" + ``` + +6. **Push Your Changes to the Remote Repository:** + - Push your branch with changes to your fork on GitHub using: + ```shell + git push origin your-branch-name + ``` + +7. **Submit a Pull Request (PR):** + - Create a Pull Request from your branch to the main repository. Make sure to include a detailed description of your changes and reference any related issues. + +8. **Collaborate:** + - Be responsive to comments and feedback on your PR. + - Make necessary updates as suggested. + - Once your PR is approved, it will be merged into the main repository. + +9. **Testing:** + - Before submitting a Pull Request, ensure your code passes all unit tests. + - To run unit tests from the root of the repository, execute: + ```shell + python -m pytest + ``` + +10. **Questions and Collaboration:** + - Feel free to join our Discord. We're very friendly and welcoming to new contributors, so don't hesitate to reach out. + +Thank you for considering contributing to DocsGPT! πŸ™ ## Questions/collaboration Feel free to join our [Discord](https://discord.gg/n5BX8dh8rU). We're very friendly and welcoming to new contributors, so don't hesitate to reach out. From cc887d25e4a98c5efe5fa8beec5ac313fc2dacab Mon Sep 17 00:00:00 2001 From: DHRUVKADAM22 <147514863+DHRUVKADAM22@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:48:44 +0530 Subject: [PATCH 027/347] Update Quickstart.md added windows Quickstart guide in Quickstart.md for easy to understand and make more user friendly --- docs/pages/Deploying/Quickstart.md | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/docs/pages/Deploying/Quickstart.md b/docs/pages/Deploying/Quickstart.md index 5ed37a5b..a1974e5e 100644 --- a/docs/pages/Deploying/Quickstart.md +++ b/docs/pages/Deploying/Quickstart.md @@ -16,6 +16,45 @@ Otherwise, refer to this Guide: To stop, just run `Ctrl + C`. +For WINDOWS: + +To run the given setup on Windows, you can use the Windows Subsystem for Linux (WSL) or a Git Bash terminal to execute similar commands. Here are the steps adapted for Windows: + +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: + ``` + 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/). +6. To stop the setup, just press `Ctrl + C` in the WSL terminal + +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: + ``` + 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/). +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. + + ### Chrome Extension To install the Chrome extension: From b5d6f0ad36e75992b30474aaeeb2242cf1eb8aee Mon Sep 17 00:00:00 2001 From: M Sai Kiran <116418856+MSaiKiran9@users.noreply.github.com> Date: Thu, 12 Oct 2023 15:07:48 +0530 Subject: [PATCH 028/347] Update Upload.tsx --- frontend/src/upload/Upload.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/upload/Upload.tsx b/frontend/src/upload/Upload.tsx index b79e8923..34534f77 100644 --- a/frontend/src/upload/Upload.tsx +++ b/frontend/src/upload/Upload.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useRef } from 'react'; import { useCallback, useEffect, useState } from 'react'; import { useDropzone } from 'react-dropzone'; import { useDispatch } from 'react-redux'; @@ -188,7 +188,6 @@ export default function Upload({ Name
- * Choose Files @@ -206,7 +205,7 @@ export default function Upload({
- ) : null} + )} {queries.length > 0 && (
diff --git a/frontend/src/conversation/ConversationTile.tsx b/frontend/src/conversation/ConversationTile.tsx index 592c52b2..5799f449 100644 --- a/frontend/src/conversation/ConversationTile.tsx +++ b/frontend/src/conversation/ConversationTile.tsx @@ -92,7 +92,7 @@ export default function ConversationTile({

)}
- {conversationId === conversation.id ? ( + {conversationId === conversation.id && (
- ) : null} + )}
); } From 13e6b1530852dca7252dac13fb8309d1513daa4c Mon Sep 17 00:00:00 2001 From: Siddharth Warrier <117698635+siddwarr@users.noreply.github.com> Date: Sat, 14 Oct 2023 14:53:38 +0530 Subject: [PATCH 042/347] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db561862..d727dbb5 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ Make sure you have Python 3.10 or 3.11 installed. (check out [`application/core/settings.py`](application/core/settings.py) if you want to see more config options.) 2. (optional) Create a Python virtual environment: -You can follow the [Python official documentation](https://docs.python.org/3/tutorial/venv.html) for virtual environments . +You can follow the [Python official documentation](https://docs.python.org/3/tutorial/venv.html) for virtual environments. a) On Mac OS and Linux ```commandline From 1f8643c538d9e5fe42cf67789ef53dee5727ea2c Mon Sep 17 00:00:00 2001 From: Aditya Aryaman Das <128703909+alienishi@users.noreply.github.com> Date: Sat, 14 Oct 2023 19:03:09 +0530 Subject: [PATCH 043/347] Updated README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d1cc12e7..1b48b8bc 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize - Extensions - Chrome extension. -- Scripts - Script that creates similarity search index and storage for other libraries. +- Scripts - Script that creates similarity search index for other libraries. - Frontend - Frontend uses Vite and React. From 04a13c2ebbb11e1f7c24a01a233d778afeb94f87 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Oct 2023 19:20:49 +0000 Subject: [PATCH 044/347] Bump langchain from 0.0.308 to 0.0.312 in /scripts Bumps [langchain](https://github.com/langchain-ai/langchain) from 0.0.308 to 0.0.312. - [Release notes](https://github.com/langchain-ai/langchain/releases) - [Commits](https://github.com/langchain-ai/langchain/compare/v0.0.308...v0.0.312) --- updated-dependencies: - dependency-name: langchain dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- scripts/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/requirements.txt b/scripts/requirements.txt index 7d48373f..5ead1d07 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -47,7 +47,7 @@ javalang==0.13.0 Jinja2==3.1.2 jmespath==1.0.1 joblib==1.3.1 -langchain==0.0.308 +langchain==0.0.312 lxml==4.9.3 manifest-ml==0.1.8 MarkupSafe==2.1.3 From 88123261ac71d92fda8f37a256ec3725d0bac4f3 Mon Sep 17 00:00:00 2001 From: Muzakir Shah Date: Sun, 15 Oct 2023 00:38:46 +0500 Subject: [PATCH 045/347] sidebar glitch fixed --- frontend/src/Navigation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index ceb146a9..90a6deb0 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -194,7 +194,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { ref={navRef} className={`${ !navOpen && '-ml-96 md:-ml-[18rem]' - } duration-20 fixed z-20 flex h-full w-72 flex-col border-r-2 bg-gray-50 transition-all`} + } duration-20 fixed top-0 z-20 flex h-full w-72 flex-col border-r-2 bg-gray-50 transition-all`} >
@@ -205,9 +206,10 @@ export default function Upload({
@@ -228,8 +230,9 @@ export default function Upload({ return (
{view} From d93266fee29aa6ead88475c60c7ce9086cc633c8 Mon Sep 17 00:00:00 2001 From: Ayush-Prabhu <126278585+Ayush-Prabhu@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:21:15 +0530 Subject: [PATCH 109/347] Update How-to-use-different-LLM.md Corrected grammatical errors to remove ambiguity and improve professionalism. --- docs/pages/Guides/How-to-use-different-LLM.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/pages/Guides/How-to-use-different-LLM.md b/docs/pages/Guides/How-to-use-different-LLM.md index 0eaf483e..8d7cccce 100644 --- a/docs/pages/Guides/How-to-use-different-LLM.md +++ b/docs/pages/Guides/How-to-use-different-LLM.md @@ -1,10 +1,10 @@ -Fortunately, there are many providers for LLM's and some of them can even be run locally +Fortunately, there are many providers for LLMs, and some of them can even be run locally. There are two models used in the app: 1. Embeddings. 2. Text generation. -By default, we use OpenAI's models but if you want to change it or even run it locally, it's very simple! +By default, we use OpenAI's models, but if you want to change it or even run it locally, it's very simple! ### Go to .env file or set environment variables: @@ -31,6 +31,6 @@ Alternatively, if you wish to run Llama locally, you can run `setup.sh` and choo That's it! ### Hosting everything locally and privately (for using our optimised open-source models) -If you are working with important data and don't want anything to leave your premises. +If you are working with critical data and don't want anything to leave your premises. -Make sure you set `SELF_HOSTED_MODEL` as true in your `.env` variable and for your `LLM_NAME` you can use anything that's on Hugging Face. +Make sure you set `SELF_HOSTED_MODEL` as true in your `.env` variable, and for your `LLM_NAME`, you can use anything that is on Hugging Face. From ee6471351d4ee1ae8c651aece0aae94e7d32e35f Mon Sep 17 00:00:00 2001 From: Ankit Matth Date: Wed, 18 Oct 2023 18:41:03 +0530 Subject: [PATCH 110/347] Icon for Documentation changed --- frontend/src/Navigation.tsx | 4 ++-- frontend/src/assets/documentation.svg | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 frontend/src/assets/documentation.svg diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index be308eab..e85bbc57 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -7,7 +7,7 @@ import Message from './assets/message.svg'; import Hamburger from './assets/hamburger.svg'; import Key from './assets/key.svg'; import Info from './assets/info.svg'; -import Link from './assets/link.svg'; +import Documentation from './assets/documentation.svg'; import Discord from './assets/discord.svg'; import Github from './assets/github.svg'; import UploadIcon from './assets/upload.svg'; @@ -338,7 +338,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { rel="noreferrer" className="my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" > - link + documentation

Documentation

+ + \ No newline at end of file From 55921b262f1a41364d45f4eedf0c1f5503d1e2d4 Mon Sep 17 00:00:00 2001 From: KRISH SONI <67964054+krishvsoni@users.noreply.github.com> Date: Wed, 18 Oct 2023 21:54:28 +0530 Subject: [PATCH 111/347] docker docs --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index edeb7b66..109728ed 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize ## QuickStart -Note: Make sure you have Docker installed +Note: Make sure you have [Docker](https://www.docker.com/) installed On Mac OS or Linux, write: @@ -124,10 +124,19 @@ Make sure you have Python 3.10 or 3.11 installed. (check out [`application/core/settings.py`](application/core/settings.py) if you want to see more config options.) 2. (optional) Create a Python virtual environment: +You can follow the [Python official documentation](https://docs.python.org/3/tutorial/venv.html) for virtual environments . + +a) On Mac OS and Linux ```commandline python -m venv venv . venv/bin/activate ``` +b) On Windows +```commandline +python -m venv venv + venv/Scripts/activate +``` + 3. Change to the `application/` subdir and install dependencies for the backend: ```commandline pip install -r application/requirements.txt From 2f6213c944c0c7bc948e57c3b02243668223331b Mon Sep 17 00:00:00 2001 From: "beKool.sh" <76424367+beKoool@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:11:30 +0545 Subject: [PATCH 112/347] Change font weight --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 8958f6d0..4e41a0de 100644 --- a/docs/README.md +++ b/docs/README.md @@ -50,4 +50,4 @@ 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. -- Footnotes: This guide assumes you have Node.js and npm installed. The guide involves running a local server using yarn, and viewing the documentation offline. If you encounter any issues, it may be worth verifying your Node.js and npm installations and whether you have installed yarn correctly. +- **Footnotes:** This guide assumes you have Node.js and npm installed. The guide involves running a local server using yarn, and viewing the documentation offline. If you encounter any issues, it may be worth verifying your Node.js and npm installations and whether you have installed yarn correctly. From 06f0129b595d04be48870314bab51148cece0081 Mon Sep 17 00:00:00 2001 From: Saksham Tyagi Date: Thu, 19 Oct 2023 20:12:40 +0530 Subject: [PATCH 113/347] =?UTF-8?q?=F0=9F=92=84=20About=20margin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/About.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index fe26835e..bde6ad95 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -4,7 +4,7 @@ export default function About() { return (
-
+

About DocsGPT

πŸ¦–

From e7bbc4ac0c72bb77c6b765be481ba1844d166d29 Mon Sep 17 00:00:00 2001 From: 0xrahul6 <113128186+0xrahul6@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:13:30 +0000 Subject: [PATCH 114/347] Enhanced Chatwoot-Extension --- docs/pages/Extensions/Chatwoot-extension.md | 64 +++++++++++---------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/docs/pages/Extensions/Chatwoot-extension.md b/docs/pages/Extensions/Chatwoot-extension.md index f9db022b..d6494bbf 100644 --- a/docs/pages/Extensions/Chatwoot-extension.md +++ b/docs/pages/Extensions/Chatwoot-extension.md @@ -1,42 +1,44 @@ -### To Start Chatwoot Extension: +## Chatwoot Extension Setup Guide -1. **Prepare and Start DocsGPT:** - - Launch DocsGPT using the instructions in our [wiki](https://github.com/arc53/DocsGPT/wiki). - - Make sure to load your documentation. +### Step 1: Prepare and Start DocsGPT -2. **Get Access Token from Chatwoot:** - - Navigate to Chatwoot. - - Go to your profile (bottom left), click on profile settings. - - Scroll to the bottom and copy the **Access Token**. +- **Launch DocsGPT**: Follow the instructions in our [DocsGPT Wiki](https://github.com/arc53/DocsGPT/wiki) to start DocsGPT. Make sure to load your documentation. -3. **Set Up Chatwoot Extension:** - - Navigate to `/extensions/chatwoot`. - - Copy `.env_sample` and create a `.env` file. - - Fill in the values in the `.env` file: +### Step 2: Get Access Token from Chatwoot - ```env - docsgpt_url= - chatwoot_url= - docsgpt_key= - chatwoot_token= - ``` +- Go to Chatwoot. +- In your profile settings (located at the bottom left), scroll down and copy the **Access Token**. -4. **Start the Extension:** - - Use the command `flask run` to start the extension. +### Step 3: Set Up Chatwoot Extension -5. **Optional: Extra Validation** - - In `app.py`, uncomment lines 12-13 and 71-75. - - Add the following lines to your `.env` file: +- Navigate to `/extensions/chatwoot`. +- Copy the `.env_sample` file and create a new file named `.env`. +- Fill in the values in the `.env` file as follows: - ```env - account_id=(optional) 1 - assignee_id=(optional) 1 - ``` +```env +docsgpt_url= +chatwoot_url= +docsgpt_key= +chatwoot_token= +``` - These Chatwoot values help ensure you respond to the correct widget and handle questions assigned to a specific user. +### Step 4: Start the Extension + +- Use the command `flask run` to start the extension. + +### Step 5: Optional - Extra Validation + +- In app.py, uncomment lines 12-13 and 71-75. +- Add the following lines to your .env file: +```account_id=(optional) 1 +assignee_id=(optional) 1 +``` +These Chatwoot values help ensure you respond to the correct widget and handle questions assigned to a specific user. + +### Stopping Bot Responses for Specific User or Session -### Stopping Bot Responses for Specific User or Session: - If you want the bot to stop responding to questions for a specific user or session, add a label `human-requested` in your conversation. -### Additional Notes: -- For further details on training on other documentation, refer to our [wiki](https://github.com/arc53/DocsGPT/wiki/How-to-train-on-other-documentation). +### Additional Notes + +- For further details on training on other documentation, refer to our [wiki](https://github.com/arc53/DocsGPT/wiki/How-to-train-on-other-documentation). \ No newline at end of file From fe866b2d667ec7bc3dba5387b7a5f93a33227033 Mon Sep 17 00:00:00 2001 From: rasvanjaya21 Date: Fri, 20 Oct 2023 02:57:41 +0700 Subject: [PATCH 115/347] Enhance backdrop modal effect --- frontend/tailwind.config.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/tailwind.config.cjs b/frontend/tailwind.config.cjs index b76b0222..69086069 100644 --- a/frontend/tailwind.config.cjs +++ b/frontend/tailwind.config.cjs @@ -12,7 +12,7 @@ module.exports = { 'eerie-black': '#212121', 'black-1000': '#343541', jet: '#343541', - 'gray-alpha': 'rgba(0,0,0, .1)', + 'gray-alpha': 'rgba(0,0,0, .64)', 'gray-1000': '#F6F6F6', 'gray-2000': 'rgba(0, 0, 0, 0.5)', 'gray-3000': 'rgba(243, 243, 243, 1)', From fcfaa04cc6c0387ce1a688770e0efed9a5c7462c Mon Sep 17 00:00:00 2001 From: Ankit Matth Date: Fri, 20 Oct 2023 05:42:12 +0530 Subject: [PATCH 116/347] About page aligned in center --- frontend/src/About.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index fe26835e..53a87bc8 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -4,7 +4,7 @@ export default function About() { return (
-
+

About DocsGPT

πŸ¦–

@@ -54,7 +54,7 @@ export default function About() { Currently It uses{' '} DocsGPT{' '} documentation, so it will respond to information relevant to{' '} - DocsGPT . If you + DocsGPT. If you want to train it on different documentation - please follow Date: Fri, 20 Oct 2023 14:33:43 +0530 Subject: [PATCH 117/347] Update index.ts --- frontend/src/hooks/index.ts | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/frontend/src/hooks/index.ts b/frontend/src/hooks/index.ts index bcf3cee9..8d4e15eb 100644 --- a/frontend/src/hooks/index.ts +++ b/frontend/src/hooks/index.ts @@ -4,42 +4,63 @@ export function useOutsideAlerter( ref: RefObject, handler: () => void, additionalDeps: unknown[], + handleEscapeKey?: boolean, ) { useEffect(() => { - function handleClickOutside(this: Document, event: MouseEvent) { + function handleClickOutside(event: MouseEvent) { if (ref.current && !ref.current.contains(event.target as Node)) { handler(); } } + + function handleEscape(event: KeyboardEvent) { + if (event.key === 'Escape') { + handler(); + } + } + document.addEventListener('mousedown', handleClickOutside); + if (handleEscapeKey) { + document.addEventListener('keydown', handleEscape); + } + return () => { document.removeEventListener('mousedown', handleClickOutside); + if (handleEscapeKey) { + document.removeEventListener('keydown', handleEscape); + } }; }, [ref, ...additionalDeps]); } -// Use isMobile for checking if the width is in the expected mobile range (less than 768px) -// use IsDesktop for effects you explicitly only want when width is wider than 960px. export function useMediaQuery() { const mobileQuery = '(max-width: 768px)'; + const darkModeQuery = '(prefers-color-scheme: dark)'; // Detect dark mode const desktopQuery = '(min-width: 960px)'; const [isMobile, setIsMobile] = useState(false); const [isDesktop, setIsDesktop] = useState(false); + const [isDarkMode, setIsDarkMode] = useState(false); useEffect(() => { const mobileMedia = window.matchMedia(mobileQuery); const desktopMedia = window.matchMedia(desktopQuery); + const darkModeMedia = window.matchMedia(darkModeQuery); + const updateMediaQueries = () => { setIsMobile(mobileMedia.matches); setIsDesktop(desktopMedia.matches); + setIsDarkMode(darkModeMedia.matches); }; + updateMediaQueries(); + const listener = () => updateMediaQueries(); window.addEventListener('resize', listener); + return () => { window.removeEventListener('resize', listener); }; - }, [mobileQuery, desktopQuery]); + }, [mobileQuery, desktopQuery, darkModeQuery]); - return { isMobile, isDesktop }; + return { isMobile, isDesktop, isDarkMode }; } From a245383f8c8d89d2a170aef0ec76e7fd419b4fa5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Oct 2023 16:22:35 +0530 Subject: [PATCH 118/347] Added a custom 404 not found page --- frontend/src/App.tsx | 2 ++ frontend/src/PageNotFound.tsx | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 frontend/src/PageNotFound.tsx diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 44540943..878a98f9 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2,6 +2,7 @@ import { Routes, Route } from 'react-router-dom'; import Navigation from './Navigation'; import Conversation from './conversation/Conversation'; import About from './About'; +import PageNotFound from './PageNotFound'; import { inject } from '@vercel/analytics'; import { useMediaQuery } from './hooks'; import { useState } from 'react'; @@ -25,6 +26,7 @@ export default function App() { } /> } /> + } />
diff --git a/frontend/src/PageNotFound.tsx b/frontend/src/PageNotFound.tsx new file mode 100644 index 00000000..eaea5cc9 --- /dev/null +++ b/frontend/src/PageNotFound.tsx @@ -0,0 +1,15 @@ +import { Link } from 'react-router-dom'; + +export default function PageNotFound() { + return ( +
+

+

404

+

The page you are looking for does not exist.

+ +

+
+ ); +} From ae13e557a7d67b3e1a0d0ed344f9e6c3963747f3 Mon Sep 17 00:00:00 2001 From: Lokendra Kushwah <118094744+Lokendrakushwah12@users.noreply.github.com> Date: Fri, 20 Oct 2023 23:24:56 +0530 Subject: [PATCH 119/347] added the 3 cards in hero section with gradient border also its responsive --- frontend/package-lock.json | 210 +++++++++++++++++++------------------ frontend/package.json | 2 +- frontend/src/Hero.tsx | 14 +-- 3 files changed, 116 insertions(+), 110 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5fed8451..4a67cc0c 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -43,7 +43,7 @@ "prettier-plugin-tailwindcss": "^0.2.2", "tailwindcss": "^3.2.4", "typescript": "^4.9.5", - "vite": "^4.1.5", + "vite": "^4.5.0", "vite-plugin-svgr": "^2.4.0" } }, @@ -416,9 +416,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.17.tgz", - "integrity": "sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", "cpu": [ "arm" ], @@ -432,9 +432,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz", - "integrity": "sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", "cpu": [ "arm64" ], @@ -448,9 +448,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.17.tgz", - "integrity": "sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", "cpu": [ "x64" ], @@ -464,9 +464,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz", - "integrity": "sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", "cpu": [ "arm64" ], @@ -480,9 +480,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz", - "integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", "cpu": [ "x64" ], @@ -496,9 +496,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz", - "integrity": "sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", "cpu": [ "arm64" ], @@ -512,9 +512,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz", - "integrity": "sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", "cpu": [ "x64" ], @@ -528,9 +528,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz", - "integrity": "sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", "cpu": [ "arm" ], @@ -544,9 +544,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz", - "integrity": "sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", "cpu": [ "arm64" ], @@ -560,9 +560,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz", - "integrity": "sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", "cpu": [ "ia32" ], @@ -576,9 +576,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.17.tgz", - "integrity": "sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", "cpu": [ "loong64" ], @@ -592,9 +592,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz", - "integrity": "sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", "cpu": [ "mips64el" ], @@ -608,9 +608,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz", - "integrity": "sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", "cpu": [ "ppc64" ], @@ -624,9 +624,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz", - "integrity": "sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", "cpu": [ "riscv64" ], @@ -640,9 +640,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz", - "integrity": "sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", "cpu": [ "s390x" ], @@ -656,9 +656,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz", - "integrity": "sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", "cpu": [ "x64" ], @@ -672,9 +672,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz", - "integrity": "sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", "cpu": [ "x64" ], @@ -688,9 +688,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz", - "integrity": "sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", "cpu": [ "x64" ], @@ -704,9 +704,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz", - "integrity": "sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", "cpu": [ "x64" ], @@ -720,9 +720,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz", - "integrity": "sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", "cpu": [ "arm64" ], @@ -736,9 +736,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz", - "integrity": "sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", "cpu": [ "ia32" ], @@ -752,9 +752,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz", - "integrity": "sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", "cpu": [ "x64" ], @@ -2561,9 +2561,9 @@ } }, "node_modules/esbuild": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.17.tgz", - "integrity": "sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==", + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", "dev": true, "hasInstallScript": true, "bin": { @@ -2573,28 +2573,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.16.17", - "@esbuild/android-arm64": "0.16.17", - "@esbuild/android-x64": "0.16.17", - "@esbuild/darwin-arm64": "0.16.17", - "@esbuild/darwin-x64": "0.16.17", - "@esbuild/freebsd-arm64": "0.16.17", - "@esbuild/freebsd-x64": "0.16.17", - "@esbuild/linux-arm": "0.16.17", - "@esbuild/linux-arm64": "0.16.17", - "@esbuild/linux-ia32": "0.16.17", - "@esbuild/linux-loong64": "0.16.17", - "@esbuild/linux-mips64el": "0.16.17", - "@esbuild/linux-ppc64": "0.16.17", - "@esbuild/linux-riscv64": "0.16.17", - "@esbuild/linux-s390x": "0.16.17", - "@esbuild/linux-x64": "0.16.17", - "@esbuild/netbsd-x64": "0.16.17", - "@esbuild/openbsd-x64": "0.16.17", - "@esbuild/sunos-x64": "0.16.17", - "@esbuild/win32-arm64": "0.16.17", - "@esbuild/win32-ia32": "0.16.17", - "@esbuild/win32-x64": "0.16.17" + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" } }, "node_modules/escalade": { @@ -6482,9 +6482,9 @@ } }, "node_modules/rollup": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.14.0.tgz", - "integrity": "sha512-o23sdgCLcLSe3zIplT9nQ1+r97okuaiR+vmAPZPTDYB7/f3tgWIYNyiQveMsZwshBT0is4eGax/HH83Q7CG+/Q==", + "version": "3.29.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", + "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -7249,15 +7249,14 @@ } }, "node_modules/vite": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.1.5.tgz", - "integrity": "sha512-zJ0RiVkf61kpd7O+VtU6r766xgnTaIknP/lR6sJTZq3HtVJ3HGnTo5DaJhTUtYoTyS/CQwZ6yEVdc/lrmQT7dQ==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.0.tgz", + "integrity": "sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==", "dev": true, "dependencies": { - "esbuild": "^0.16.14", - "postcss": "^8.4.21", - "resolve": "^1.22.1", - "rollup": "^3.10.0" + "esbuild": "^0.18.10", + "postcss": "^8.4.27", + "rollup": "^3.27.1" }, "bin": { "vite": "bin/vite.js" @@ -7265,12 +7264,16 @@ "engines": { "node": "^14.18.0 || >=16.0.0" }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, "optionalDependencies": { "fsevents": "~2.3.2" }, "peerDependencies": { "@types/node": ">= 14", "less": "*", + "lightningcss": "^1.21.0", "sass": "*", "stylus": "*", "sugarss": "*", @@ -7283,6 +7286,9 @@ "less": { "optional": true }, + "lightningcss": { + "optional": true + }, "sass": { "optional": true }, diff --git a/frontend/package.json b/frontend/package.json index 9dcbf4ae..0d9c3fd4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -54,7 +54,7 @@ "prettier-plugin-tailwindcss": "^0.2.2", "tailwindcss": "^3.2.4", "typescript": "^4.9.5", - "vite": "^4.1.5", + "vite": "^4.5.0", "vite-plugin-svgr": "^2.4.0" } } diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index 0644da67..34347c09 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -17,9 +17,9 @@ export default function Hero({ className = '' }: { className?: string }) { Start by entering your query in the input field below and we will do the rest!

-
-
-
+
+
+
lock
-
-
+
+
lock

Secure Data Storage

@@ -47,8 +47,8 @@ export default function Hero({ className = '' }: { className?: string }) {

-
-
+
+
lock Date: Sat, 21 Oct 2023 12:53:47 +0530 Subject: [PATCH 120/347] Update react-widget.md --- docs/pages/Extensions/react-widget.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/Extensions/react-widget.md b/docs/pages/Extensions/react-widget.md index 1cc11321..66001ba2 100644 --- a/docs/pages/Extensions/react-widget.md +++ b/docs/pages/Extensions/react-widget.md @@ -1,7 +1,7 @@ ### How to set up react docsGPT widget on your website: ### Installation -Got to your project and install a new dependency: `npm install docsgpt`. +Go to your project and install a new dependency: `npm install docsgpt`. ### Usage Go to your project and in the file where you want to use the widget, import it: From 960365a0633067af0c4daf0796fff56e6a735903 Mon Sep 17 00:00:00 2001 From: neha3423 Date: Sun, 22 Oct 2023 10:54:02 +0530 Subject: [PATCH 121/347] neha3423 --- CONTRIBUTING.md | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3407fdc9..a14e4bf7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,42 +57,55 @@ Here's a step-by-step guide on how to contribute to DocsGPT: 1. **Fork the Repository:** - Click the "Fork" button at the top-right of this repository to create your fork. -2. **Create and Switch to a New Branch:** +2. **Clone the Forked Repository:** + - Clone the repository using: + ''' shell + git clone https://github.com//DocsGPT.git + ''' + +3. **Keep your in Sync:** + - Before you make any changes, make sure that your fork is in sync to avoid merge conflicts. + '''shell + git remote add upstream https://github.com/arc53/DocsGPT.git + git pull upstream master + ''' + +4. **Create and Switch to a New Branch:** - Create a new branch for your contribution using: ```shell git checkout -b your-branch-name ``` -3. **Make Changes:** +5. **Make Changes:** - Make the required changes in your branch. -4. **Add Changes to the Staging Area:** +6. **Add Changes to the Staging Area:** - Add your changes to the staging area using: ```shell git add . ``` -5. **Commit Your Changes:** +7. **Commit Your Changes:** - Commit your changes with a descriptive commit message using: ```shell git commit -m "Your descriptive commit message" ``` -6. **Push Your Changes to the Remote Repository:** +8. **Push Your Changes to the Remote Repository:** - Push your branch with changes to your fork on GitHub using: ```shell git push origin your-branch-name ``` -7. **Submit a Pull Request (PR):** +9. **Submit a Pull Request (PR):** - Create a Pull Request from your branch to the main repository. Make sure to include a detailed description of your changes and reference any related issues. -8. **Collaborate:** +10. **Collaborate:** - Be responsive to comments and feedback on your PR. - Make necessary updates as suggested. - Once your PR is approved, it will be merged into the main repository. -9. **Testing:** +11. **Testing:** - Before submitting a Pull Request, ensure your code passes all unit tests. - To run unit tests from the root of the repository, execute: ```shell @@ -101,7 +114,7 @@ Here's a step-by-step guide on how to contribute to DocsGPT: *Note: You should run the unit test only after making the changes to the backend code.* -10. **Questions and Collaboration:** +12. **Questions and Collaboration:** - Feel free to join our Discord. We're very friendly and welcoming to new contributors, so don't hesitate to reach out. Thank you for considering contributing to DocsGPT! πŸ™ From 6cbe4f2ea72fd1a10d2c0ee6ce4762d3acc3a016 Mon Sep 17 00:00:00 2001 From: neha3423 Date: Sun, 22 Oct 2023 11:38:23 +0530 Subject: [PATCH 122/347] neha3423 --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a14e4bf7..ff5aab35 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,13 +63,13 @@ Here's a step-by-step guide on how to contribute to DocsGPT: git clone https://github.com//DocsGPT.git ''' -3. **Keep your in Sync:** - - Before you make any changes, make sure that your fork is in sync to avoid merge conflicts. +3. **Keep your Fork in Sync:** + - Before you make any changes, make sure that your fork is in sync to avoid merge conflicts using: '''shell git remote add upstream https://github.com/arc53/DocsGPT.git git pull upstream master ''' - + 4. **Create and Switch to a New Branch:** - Create a new branch for your contribution using: ```shell From 5556be9cabc238dc542c922f5ecd36768c9730f9 Mon Sep 17 00:00:00 2001 From: Lakshmi Narayanan Date: Mon, 23 Oct 2023 00:32:57 +0400 Subject: [PATCH 123/347] Fix something went wrong message bubble --- frontend/src/conversation/ConversationBubble.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 37b93f2e..dbf00ad3 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -59,7 +59,7 @@ const ConversationBubble = forwardRef<
Date: Mon, 23 Oct 2023 14:44:37 +0530 Subject: [PATCH 124/347] Railway Deployment Guide Added --- docs/package-lock.json | 1 + docs/pages/Deploying/Railway-Deploying.md | 254 ++++++++++++++++++++++ docs/pages/Deploying/image.png | Bin 0 -> 11181 bytes 3 files changed, 255 insertions(+) create mode 100644 docs/pages/Deploying/Railway-Deploying.md create mode 100644 docs/pages/Deploying/image.png diff --git a/docs/package-lock.json b/docs/package-lock.json index b0255929..20f65d80 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -4,6 +4,7 @@ "requires": true, "packages": { "": { + "license": "MIT", "dependencies": { "@vercel/analytics": "^1.0.2", "docsgpt": "^0.2.4", diff --git a/docs/pages/Deploying/Railway-Deploying.md b/docs/pages/Deploying/Railway-Deploying.md new file mode 100644 index 00000000..15e2f60a --- /dev/null +++ b/docs/pages/Deploying/Railway-Deploying.md @@ -0,0 +1,254 @@ + +# Self-hosting DocsGPT on Railway + + + +Here's a step-by-step guide on how to host DocsGPT on Railway App. + + + +At first Clone and setup the project locally to run , test and Modify. + + + +### 1. Clone and GitHub SetUp + +a. Open Terminal (Windows Shell or Git bash(recommended)). + + + +b. Type `git clone https://github.com/arc53/DocsGPT.git` + + + +#### Download the package information + + + +Once it has finished cloning the repository, it is time to download the package information from all sources. To do so, simply enter the following command: + + + +`sudo apt update` + + + +#### Install Docker and Docker Compose + + + +DocsGPT backend and worker use Python, Frontend is written on React and the whole application is containerized using Docker. To install Docker and Docker Compose, enter the following commands: + + + +`sudo apt install docker.io` + + + +And now install docker-compose: + + + +`sudo apt install docker-compose` + + + +#### Access the DocsGPT Folder + + + +Enter the following command to access the folder in which the DocsGPT docker-compose file is present. + + + +`cd DocsGPT/` + + + +#### Prepare the Environment + + + +Inside the DocsGPT folder create a `.env` file and copy the contents of `.env_sample` into it. + + + +`nano .env` + + + +Make sure your `.env` file looks like this: + + + +``` + +OPENAI_API_KEY=(Your OpenAI API key) + +VITE_API_STREAMING=true + +SELF_HOSTED_MODEL=false + +``` + + + +To save the file, press CTRL+X, then Y, and then ENTER. + + + +Next, set the correct IP for the Backend by opening the docker-compose.yml file: + + + +`nano docker-compose.yml` + + + +And Change line 7 to: `VITE_API_HOST=http://localhost:7091` + +to this `VITE_API_HOST=http://:7091` + + + +This will allow the frontend to connect to the backend. + + + +#### Running the Application + + + +You're almost there! Now that all the necessary bits and pieces have been installed, it is time to run the application. To do so, use the following command: + + + +`sudo docker-compose up -d` + + + +Launching it for the first time will take a few minutes to download all the necessary dependencies and build. + + + +Once this is done you can go ahead and close the terminal window. + + + +### 2. Pushing it to your own Repository + + + +a. Create a Repository on your GitHub. + + + +b. Open Terminal in the same directory of the Cloned project. + + + +c. Type `git init` + + + +d. `git add .` + + + +e. `git commit -m "first-commit"` + + + +f. `git remote add origin ` + + + +g. `git push git push --set-upstream origin master` + +Your local files will now be pushed to your GitHub Account. :) + + +### 3. Create an Railway Account: + + + +If you haven't already, create or log in to your railway account do it by visiting [Railway](https://railway.app/) + + + +Signup via **GitHub** [Recommended]. + + + +### 4. Start New Project: + + + +a. Open Railway app and Click on "Start New Project." + + + +b. Choose any from the list of options available (Recommended "**Deploy from GitHub Repo**") + + + +c. Choose the required Repository from your Github. + + + +d. Configure and allow access to modify your GitHub content from the pop-up window. + + + +e. Agree to all the terms and conditions. + + + +PS: It may take a few minutes for the account setup to complete. + + + +#### You will get A free trail of $5 (use it for trail and then purchase if satisfied and needed) + + + +### 5. Connecting to Your newly Railway app with GitHub + + + +a. Choose DocsGPT repo from the list of your GitHub repository that you want to deploy now. + + + +b. Click on Deploy now . + + + +![Three Tabs will be there](image.png) + + + +c. Select Variables Tab. + + + +d. Upload the env file here that you used for local setup. + + + +e. Go to Settings Tab now. + + + +f. Go to "Networking" and click on Generate Domain Name, to get the URL of your hosted project. + + + +g. You can update the Root directory, build command, installation command as per need. + +*[However recommended not the disturb these options and leave them as default if not that needed.]* + + + + +Your own DocsGPT is now available at the Generated domain URl. :) \ No newline at end of file diff --git a/docs/pages/Deploying/image.png b/docs/pages/Deploying/image.png new file mode 100644 index 0000000000000000000000000000000000000000..2100e5b4d20e24108e52dff4de8e9c486ee4ff17 GIT binary patch literal 11181 zcmeHtcTiJX)UV|#D(zZOLCUp(G*Nm-RC@0anu4^1A|>=9B6y{W^gt-m6GG@E1W*v9 zg-{a-5JWm5L`nh#0x$Qw-<$87dH=ncH}huR+cW2!wdU-7&e^}c_Bwm*_4{CKsKtJX z=hCTDr`UD0pPQaK^#`3PCtNtsJn!r6O*1d2{Y|x=o~j<^U1KVLxTzbcpE^~W!g}=b z98XhhHo#*Q2!4Blvh=6O)`Yb)MC0r>9R;EjwJla)dGKbFII1=3ZtZ1+U;QnKL^Dg;It*m(wWS_jRo7 z4!{7q1%0>g@@eKrGRrE&$*+1C?E0T-fW>2>7mC;SSAA10A{hMZ zofPZ8Y9Tz{H}cHC@@m(GfAIOI-1uwt?7x!Tn?lZirPrt5s{Si|Irsl7{;%*vXXnBF zp*H_QbjsdhsQ<-C&Oc_vEF%^@NA2r1{|)tv`SSBa{}XuF&BXtF-v1WJ4|Pz#29V=p z$gy&*Wch?YXJ2E&oZ_l!ik)$AQG9`HHNJQ6X!vcyH?KYSez5A=>O=A1fX4biTOQ4Z zx_LaIY>s6`@>R%hig_hy37*84ef_-=%|hUIJpHUL?GRJhI!l+hP9fB+&rJ4#fxQ>MKiD>zyWBN0t0V1)NkCG z$F$n0@k6VBL~Y^(tTwORXIkQ$;VXyG!CwNKzCB!Y$v0i7M#3DA-SZ@4lp1RH?@X2Z3*cCr+3;^l04lAX3H5)j+@+$nc>KMZ#*q6083&!S zEBekU>X6`tN7O;>39B&9%4N_>wELC!9s?6k*|ig_W{I4Ol&YWb72_msf^EJYO8D`z z0D-Zkmd7$|)@wbhsA%Oe_t*ixo6Q8{ip;BDuk5Eg%XtRWM&<+Go68q_%#~9u0L?~? zopsQanT+B9l0k26PG%(k67GD8)fSQRz)&3u49JA09ixs}80oKd5+Cm5n@&Y{lA@qm zuQ||bJYj>L1~(O-oZxmYGGdqm{?vu+mD`K!?C zWbe7UJQ&SW2sI8^eyZB6 zm{YBZVr?erH-Uj92o!+S#9QQA=!z@uwMak1H{3PObgQY> zN%4NrotbG6XcJm!uk_cA7|PpybNT+M`k#vX-t9ASW~XSD=gR+ zg3l>=95UQR(-x?{I2>x`b8}S;{aQgz9vMso)ni?T(wCQxkCZB;c}Vb_qR=E<@t-e!-J+z2|jqzvDIo;^pBPuXT?@UGAU?KR(q z3kTX`x}#=c>wml0A>)H|H%O)u1zVWw_V4q*^WETSUl*Iyq?q&wJMB~tEkY!igqKmiErh3OKyo{&onqe!;cD- zi=wjR{xEN%31d3_V|DX1nnw2WOOl>ht`_O^qK1nz34UBEkF8iE1!Qmb`N&q%o7gHn z8%;0WP-M;BmtM&!MMdex{p#N2JX1=d?i*2X+q!PiFPC9^)Wz&qq9b{cFwt-O6pKy13i5u1-(y2#q#w{|9JD^_`RBh98) zwbJi;tS)2i4g&4-NwWLOo5HB9%#)R;j8LyZ#@1r;CCret?9!46fd9sPJ)VDTn`N04 z{gJxN6;b%UI>An^WMip=XG?VDhI5o*#Ny*wIZ%sfH-Y0kV|sUgS83O-?|6f*JkaUV zQB4uIpafgO5pUXL=CTVsfXP-#Tt4eL?6)x<&Q~V(=(l9(kZU2`T}@AxEWLv3t!2vd z&Skzzf=KDLZh;kle+OS;J1MI6A&gq&HU=X?aPO2?GF%9>Rz}TI-W>L$ltEC^))ex@ zGNu>XVq#PDzH3d9FLICF>p`{2p!YQ42S=KmeX(GonRh`Zi|)dWjL@Kk^L&3xTkABC z)$Eb$?LO|*hgp-?frLG+0gF-5XAu%fbrM)@)2|x>Aa|!25fRvAGt$f(=X+UD*eJ~h z<=~+LaM)i@xeg+gAz&9g9P*X712IEVEayBhoi3^Id0E(ezvkXD$Y4JH*g zRFx%YT)`!s(p%nGG-MN=d6R&(`t`!PJFSKVo(Sn6rD^)3X7e~hWBQ!9YYyEs! zAQ2qccjI>!ylNslnJ23Mdyl9;y*t!v{3(|rmILp6WU90XN7mv+siH4j&wSv9&1TJM~8@$W;q=AZ(x3D%T` zW4lULOW@8`!@e6RwYR+>dK`%OOD1%Fh34NKa-REe^l0O>o9z(ROZB6?v46f@$>B5A zz1o3GBn1ltC~#7dlx?O>mtU6CqfTJSAF(q9_bFcE$xaLY*3(kDoQSA-F&X7HNTIH3 zZFgz<>6l{aw4KT*REXSEVYk40T25BgTY=f?-0j3%^M%?kZW)Sp9)^>bqX8N~)vJh{ed4+Na^~{0Ty)r#6FV?*CYi@4#05La(aqa1r_geKhf9Z^q|- zofSK|4zsGLQ#Y6Vz6sy(&!OfiuIyJn9@b6s^#*j_GRxS3j&b-}%~shalDE$%`ZeHW zhDqaw3d1*r9N}2PcCg2>7|2C&DIdT0 z=pB-+j$wNKmetF<;Ll3}Q!-t@!f1_=vN^54d@<5KzepS&2WXRZwO44(MCmg180n1; z1DNC{+pis0QqhI4nOlGRRSz2fZZDVKgn`IZO&+94aC7`XBGEo+bx7eI7fnFl`cy7&~SNlOH`pe49r_t#vI6_JA^hNNR03k0hw2u_88AO8VQS zKH%=0PgT?P#-D@6$oAf*y<0Aw_>bz4#@&x#sYPyOhghN?0wQJH8cSv9hb7_p+<>6rN%Tc-OYuRNOpx`V|ICDv zbOd@!K~vS0g3a%i5prq`v=`z`@AJVOYY!M3mb7(Gh`B)4-f?%loA|QDv!pT+9$5pR zREGivPxetbgj~5*!%>hAtV@hm@>Qg-A)mjuMVK;GcowOGaLcSVAEjG0u9KTsh%GgH zQg%7zb{X!obt{cPM7#GWY=t@m>ak=m+(!$egb66|dzCNZeHXlWA5dLGV}G(l|}J;-`=GEdm8EB>r@*Eghh zqF%^-_XHUym#NDGImuSm?aQvqFF53KZ<`p)ggJnd1rFt{w>EYFK{dlD?`w%54y7|J za<)s1YN-G}#ylBES#A(|>axE`{IKm~U)F=|c$Gn32Pt=}<2YcVtsg zJ!#R$$}dfeN4(Q~&+E*bxizA{=S4%8d#oC~2Mx(HPUyMq6>8Ig#;<b7Y$c!o-hc(b_GXMQwvR4lpaHF{Q4Ve+hZ?b->xt9dODP1Z1YY0 z)p}kG7_&p~L2T!qE|$~k?xvS-$hv>_NB_XrFJql}C6+_8xbbjNs8I9As-kBR>t*K` zZblFRKI1effwl|>Y&jxV-*DRrEopReF#j(B! zv-5cG$Yl^lB{Ah96TFTMk78HZ%$J!<$%lr4=?%LdiDP8F(Y)- z1!SVf{(hIxF5Vn57*#dSzd$4ecphGvJPtBHA1`fgKep?&j~&mOB)9pI{4 z9GTO(-O=bZO$$4ZBJ+oNu=a-5M>b*(dMq1h-r{p!bC6Pw>{krW&W?4LS+m2&z5Yxj ze4rGy7afZVS`SVNdj$MrR0jHRv`ANq&%ku93MVrV&X7bzE3S*`*}jvY9$NCql^{Xg zBv7MT__YDEQi9v$&v-Mxg1&A$+@@{0m(~W4CE2%#;znE)n5nZd#QAG3q#^*#*l_g} z`ZBxfVBx*<^|+kYTwoB~-PuE1O5K*+(MX7x$liM8{(2P?;rGejd3(o?@51!?h$agp zWBxvab|7bdnHE}Y(q_bhVO;V04{JBHA{AQjr-BFhoY3gzH-_*J=_9QbjR{5vQ_Jcvd7W=LPDcL@=zA~+rdW{{FD^XN_JRTPsuuZ| zv7r``*NCsCgQ3mGFIc{}4ZA3z-eBiOw=F1rKA9$HqgH31$(e&7((tsK$95mu(jYrG zB)uT(GB0d}{dHXB^VhgAdu(L9IuL~g6vU( zMtkmZ8)b?IqMzR@jOLvja-VTg{IgVaobahkT_+qh0Js8`5FLksEhF3=(*X|Z8Alin z@6fV$-`E`|Y;M1!FM=jA5X~~iAUUc(vXCZF)19Cl<9CmviDllsN(^`0r{VegL3si9 z$3HCSFB^CYBO}6pgr7#5hOb!N+FYG)0%bLgnUf}!d+#_7nYXQQF=#&4$B9sZu-d$9hu9`e;_0K>AgI0nke01MMtm>PM zks)fc?Ut~qr!}hdNM$v>-CXLDlt9g{e2ovWZn1Id~ zByeZv`#lI3g)kv~1{8jBD`~G&;a7lj)ZtJHHJ~{Xki0SRuwKDc|E*utzTT`tP-a=O zuyG(@Od*A5#wF)_4!7yOIDFHN@ElCg208Yt>1k7NPt^A#Zqd1szC&VO+;J{n)Hkpa zh%uCWx!?u<4=>V9(ESPqMbRMCObayp))7b(mjh0Wu$AU5^ug`TVt@mIz_h9Gi?sgd4#lq0y3y;fPQh32Xe#g!Lb9+=6G>v!Xd$V1t?9v>}B-;5G!m=02= z&0UUm_F{wh>Nj4dr%1XijvGY5CGS$*c*YN%EIZ~nhu1U5c{ESe zu*Ez~UxSvnT&g&T?jIN$_*?S+bksL^xhdB4F$K;3`e~nYq>7ukyY1l55hM$-K9^1# z$_+0&X{+?#A-lGf9(F{hy5vIod8RY@Jp>45Ff+1{>YCVBHn#Qy_V^mN)M`xB%aQqUQUU{eY-$_%=qXvo|6898z31%# zL?t9olO1CMKpFLCg;lAu0in^HiiU0-a~EZ@gNEZq;^h!BGR@Kwr`LK9wQ@c|-`r7s zT(S&k=cqo6k-cUGC$dQ;g8r6p%kDKiuHDLstW-$bPM;xm44}k1X#$cUzfi>S{_tv6 zxtM>}WTtym?%6&$8QVm&qm0Y6HmQTW<$|q?ZaQ8{+J2w-HqHZ!IfQtp+-#|1qPE~4 z%7Msb9m4s?_s@7nm|DY(K<5iAqHpZT5kfOXr(kt9< zkPb)4Uyko2n}rH~A^abxU!1qlln^`->gN#ey!5=1%kz@Rs$E*wWEL8x=J~*~F{D44 zDxx5x_3S&bYHDXQ+3waA=HS_1QgB~dl1hPaAUf8Q)IzP;p@6Cc=&PF1rnk0&GD*Txfer(KZl-NQ~9fa1E| zsp9ik-pjZELIiM+uL1bDr)))dj-K+j)$7lEA4YPaDj2KCmrr(3U3s*Vbn?FH zyyC^JF$h%z=uar&LjZewL}etp+?$gR52qR{0q6YZbbU)(|ycH9JmQ zP`t)|on#}|7N91nh`L0p`NUY!jP)ud$B=5t~VR70jM&rI~%ccq8=hr|3 zS-BR!?AdRDo`!H$9$O&nCCQ?T3wI{xVjDGMo>7g8&GLU&NmMR)Xeo1&PDQ5eJK$Dl zFZb+Ew5`=Q-?v7t*Ud85-=eq+KXIqDT=!1JNaYDJXH_Bm_A2R*O0(-8OK;UJcc#CD ziBi7>hP5tzh!ByY@P#dtn%rgDyu+*|j_}+;R#6v=rcDB%^<`0<_3al)14Q6#!R)WBAe#tI8afos56KpnT4B9*Vv~T- zQks6qSi9RM2hXFZT@MLxItVzCl349$ajkd+%npfEp1nJxxPlpB7{}f) zhG_!}km=1w-z`kN%k21FmKGmGy_tMjEW)u-|19x3nqEE0m{Fr1l;hq$awshgcvauc z5!|`2zXb3ax7FiMcVXcyIH1abbOMe$r|-54x-Mz4gRdO2kB9BVt|cp{2*f@c`rx3kMheVqaaU34m>0Z7tp=)wXO+AbhgO##nU zeYT=UDsJZLb&+N95lGJhLUr%$ebVk1o-kil37@ejTb;Sr7-4B29$W{a1`R6OM18dhj)p)S!X&q4B$Snpj@dA|GP-8^*Q zeo%M_o*-xGhVYt-Jx3ErS8(w3obyEyJtc$IYXzdv8Z1Y*)TCR_6UqS<1KpJ{!qxuHjo^ETunnsQALNJPA9#c+m!-rDwoXRXZnP z{Pmp&&s?X%<5j8Pyj~8Bnfl9jmo3Ahj1+M57Ucw5%JK-9ZwmR$l03@GWqtPHbN)$% zPhXBZ2YAipWWn#sxElDu6JprWyO<76A^2Zntd+IX_V8SZZl3w(g>=vgOW<70lxFKn z+=)bCQ1o$xdprs(*Hko6xg6n;`OnYn0fe{TqQ@IqU7GXI1_TOS*k(1sk7S4-Mye~r3yXQRG>l7g!!T96L$Q@6e_ zH?c^(>*(k|v8)Y�rTbqHcM)Dm^zooSSlESN?^`cco%OTu)s$`b1C8E6qiIFpDT5 zUI>jaa{kU?w)s01ky4+1jh$~b+z1MaN@aSG7I(W(0X-Rx<)x0LMkx(bF$!Y-jmv4V zA`P2sF_+>R*0+Ogk6G1>Q4T35yWZj{@(+3*sI)HFU>e4rEVLf`MR*^p^XC>ito6ss zoj7o2f+lCSPgwc$EST#6s+Pj@J3Mc~}f%*65+YCj)WZ%4|uLs?T3c+ol3t%psi&+Ae0=>_?H z${gp|H?1L-X9JVL8`hv!^N1uz8OIzU^E|ZX)cvp+m8t?-8PPNZZoEb#7g-u9=N*lm~ABk-!)??W)_|wj_qGsvtxIz`LJR~S_ zXY$gu+*k)So+MJ_Lce5tt7kpOG^gz+Rv-M(R~kqz|55%<$}GJbbhshdZIb-Go?ps~ z_d7B2DtLOIEd;Y5uTRd;Ak2X*-{Cn_h9O9oWmRo`0~2&k_^m_laf+kW+7zIRnfm_u z`Pw}8Swq5i=h!fVG+}Fjk=ikP09D}XWYnvMkJtu-z3anxf64)(<`Hov@k%Z;IiP;> zPz8Ty5w!L#vz1Pz`<+uUxVxu#+tjNy{`jugA}GxfYXB`_!KK^AXav)xecp#4U&Uo` zHeBA$iO<|ryjp0{-Yo6c$J}4b92#pm#KDJPv*XI2YPq&$m|4l?`Rljm&P{h1*XRFO zPK1FnBhd6E8JS6$0WggL=xEba51Eh}pDHjs_+vnJZA-_S<3L}Xd{VKt54T!-KN{Ac zb}&k!FW_|BEOqNBLls%fFu8IUp|Do0`W{WErb!wKo0-S=Tfv52s`^B;mzdWsi78D{9{ZUs>24E+P?BWqy z7G!Cb7YC9RX+m#dj4Jam*_#EvZVjP%G~cGmlHP1kM`q69U&o)$pMwR$`hEnx3;!nu zx*Ck*MBH%3|jlVMc48fA79S- zUcpU=5cc>n-%BR;J8vAkxWd;ZC;tS1JQG>R*JhtoRO;)vD58h(G2J z!5FGfGa%5f#YeWww)PL6BVQ7><&{R)@D5Cj!mnPSqY^Ku&uJ9?ZuJ5<)3mJWo_6;t z&s2V8Zu8aj>|s7O*V#>`cC}`U%}P@=sqGC2Zw_X|pPJIMJ*|3sHZcKoZiq*M)s(fj_B*T1hLb>J~ z`ZMP++s~JmGOKY_sjQ9N2Yjba1>EsT7R2(DOV?A9$Jt?O4qlvMem3ZEm9(m_wx8L> z{^4Z>6>AC%kN)K%7;>$OQ^eY;_>&ALN$@F?0@tBHy$@*iENzN#;(%SoE7xdK?)5+z ziu~fEWe?6KFx!5atr%rtvc6)cV!Cfiu?;gl&ToWP60_}_hgG#5hS6^xU*2Z2^}L_wdg&e{l7GBZw(*m*g;?@lP3<{6EPa`#;I$Yq_@;FWPCS*Ew*&^>1IESOo~K z9x}O$ZkO*=9;3T*&MIo^B0Gk8|Ks+T*t`ElJXHO^i;eh~;L5t)e`8hpOWq9lZ^?zIgjT E0GIWpBLDyZ literal 0 HcmV?d00001 From 0668fea3b75ad157e618259375b17c341c4de7c2 Mon Sep 17 00:00:00 2001 From: Ankit Matth Date: Mon, 23 Oct 2023 17:01:41 +0530 Subject: [PATCH 125/347] Revamp Icon Effects --- frontend/src/assets/checkmark.svg | 4 +- .../src/conversation/ConversationBubble.tsx | 129 ++++++++++++++---- frontend/tailwind.config.cjs | 3 + 3 files changed, 103 insertions(+), 33 deletions(-) diff --git a/frontend/src/assets/checkmark.svg b/frontend/src/assets/checkmark.svg index 9ed02cbd..499000e8 100644 --- a/frontend/src/assets/checkmark.svg +++ b/frontend/src/assets/checkmark.svg @@ -1,3 +1 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 37b93f2e..dc02447c 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -37,8 +37,13 @@ const ConversationBubble = forwardRef< // Reset copied to false after a few seconds setTimeout(() => { setCopied(false); - }, 2000); + }, 3000); }; + const [isCopyHovered, setIsCopyHovered] = useState(false); + const [isLikeHovered, setIsLikeHovered] = useState(false); + const [isDislikeHovered, setIsDislikeHovered] = useState(false); + const [isLikeClicked, setIsLikeClicked] = useState(false); + const [isDislikeClicked, setIsDislikeClicked] = useState(false); let bubble; @@ -55,7 +60,10 @@ const ConversationBubble = forwardRef< ); } else { bubble = ( -
+
- {copied ? ( - - ) : ( - { - handleCopyClick(message); +
+
- )} + > + {copied ? ( + setIsCopyHovered(true)} + onMouseLeave={() => setIsCopyHovered(false)} + /> + ) : ( + { + handleCopyClick(message); + }} + onMouseEnter={() => setIsCopyHovered(true)} + onMouseLeave={() => setIsCopyHovered(false)} + > + )} +
+
- handleFeedback?.('LIKE')} - > +
+
+ { + handleFeedback?.('LIKE'); + setIsLikeClicked(true); + setIsDislikeClicked(false); + }} + onMouseEnter={() => setIsLikeHovered(true)} + onMouseLeave={() => setIsLikeHovered(false)} + > +
+
- handleFeedback?.('DISLIKE')} - > +
+
+ { + handleFeedback?.('DISLIKE'); + setIsDislikeClicked(true); + setIsLikeClicked(false); + }} + onMouseEnter={() => setIsDislikeHovered(true)} + onMouseLeave={() => setIsDislikeHovered(false)} + > +
+
diff --git a/frontend/tailwind.config.cjs b/frontend/tailwind.config.cjs index b76b0222..437f4a09 100644 --- a/frontend/tailwind.config.cjs +++ b/frontend/tailwind.config.cjs @@ -28,6 +28,9 @@ module.exports = { 'purple-30': '#7D54D1', 'blue-4000': 'rgba(0, 125, 255, 0.36)', 'blue-5000': 'rgba(0, 125, 255)', + 'green-2000': '#0FFF50', + 'light-gray': '#edeef0', + 'white-3000': '#ffffff', }, }, }, From 9b044815de92951f9c80844b1b27c8e578d2ecc8 Mon Sep 17 00:00:00 2001 From: Ankita Sikdar <115947852+AnkitaSikdar005@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:07:25 +0530 Subject: [PATCH 126/347] Update CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 512b6c23..3daec1f5 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -2,8 +2,8 @@ ## Our Pledge -We as members, contributors, and leaders, pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body +We as members, contributors and leaders pledge to make participation in our +community, a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity @@ -72,20 +72,18 @@ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed +- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community space. -**Consequence**: A private, written warning from community leaders, providing +- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning - -**Community Impact**: A violation through a single incident or series +- **Community Impact**: A violation through a single incident or series of actions. -**Consequence**: A warning with consequences for continued behavior. No +- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels @@ -93,23 +91,21 @@ like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including +- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. -**Consequence**: A temporary ban from any sort of interaction or public +- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community +- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression towards or disparagement of classes of individuals. -**Consequence**: A permanent ban from any sort of public interaction within +- **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution From 9e632aa0bdfbf80d78b03c4fe9f12a3add28e9ee Mon Sep 17 00:00:00 2001 From: KRISH SONI <67964054+krishvsoni@users.noreply.github.com> Date: Mon, 23 Oct 2023 22:01:07 +0530 Subject: [PATCH 127/347] Update README.md --- README.md | 110 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 72 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index b570dfc7..3a6448dd 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@

- DocsGPT is a cutting-edge open-source solution that streamlines the process of finding information in project documentation. With its integration of the powerful GPT models, developers can easily ask questions about a project and receive accurate answers. + DocsGPT is a cutting-edge open-source solution that streamlines the process of finding information in the project documentation. With its integration of the powerful GPT models, developers can easily ask questions about a project and receive accurate answers. -Say goodbye to time-consuming manual searches, and let DocsGPT help you quickly find the information you need. Try it out and see how it revolutionizes your project documentation experience. Contribute to its development and be a part of the future of AI-powered assistance. +Say goodbye to time-consuming manual searches, and let DocsGPT help you quickly find the information you need. Try it out and see how it revolutionizes your project documentation experience. Contribute to its development and be a part of the future of AI-powered assistance.

@@ -21,64 +21,62 @@ Say goodbye to time-consuming manual searches, and let DocsGPT
-### Production Support / Help for companies: +### Production Support / Help for companies: We're eager to provide personalized assistance when deploying your DocsGPT to a live environment. -- [Schedule Demo πŸ‘‹](https://cal.com/arc53/docsgpt-demo-b2b?date=2023-10-04&month=2023-10) + +- [Book Demo πŸ‘‹](https://airtable.com/appdeaL0F1qV8Bl2C/shrrJF1Ll7btCJRbP) - [Send Email βœ‰οΈ](mailto:contact@arc53.com?subject=DocsGPT%20support%2Fsolutions) - + ### [πŸŽ‰ Join the Hacktoberfest with DocsGPT and Earn a Free T-shirt! πŸŽ‰](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md) ![video-example-of-docs-gpt](https://d3dg1063dc54p9.cloudfront.net/videos/demov3.gif) - ## Roadmap You can find our roadmap [here](https://github.com/orgs/arc53/projects/2). Please don't hesitate to contribute or create issues, it helps us improve DocsGPT! ## Our Open-Source models optimized for DocsGPT: -| Name | Base Model | Requirements (or similar) | -|-------------------|------------|----------------------------------------------------------| -| [Docsgpt-7b-falcon](https://huggingface.co/Arc53/docsgpt-7b-falcon) | Falcon-7b | 1xA10G gpu | -| [Docsgpt-14b](https://huggingface.co/Arc53/docsgpt-14b) | llama-2-14b | 2xA10 gpu's | -| [Docsgpt-40b-falcon](https://huggingface.co/Arc53/docsgpt-40b-falcon) | falcon-40b | 8xA10G gpu's | - +| Name | Base Model | Requirements (or similar) | +| --------------------------------------------------------------------- | ----------- | ------------------------- | +| [Docsgpt-7b-falcon](https://huggingface.co/Arc53/docsgpt-7b-falcon) | Falcon-7b | 1xA10G gpu | +| [Docsgpt-14b](https://huggingface.co/Arc53/docsgpt-14b) | llama-2-14b | 2xA10 gpu's | +| [Docsgpt-40b-falcon](https://huggingface.co/Arc53/docsgpt-40b-falcon) | falcon-40b | 8xA10G gpu's | If you don't have enough resources to run it, you can use bitsnbytes to quantize. - ## Features ![Group 9](https://user-images.githubusercontent.com/17906039/220427472-2644cff4-7666-46a5-819f-fc4a521f63c7.png) - ## Useful links - [Live preview](https://docsgpt.arc53.com/) - - [Join our Discord](https://discord.gg/n5BX8dh8rU) - - [Guides](https://docs.docsgpt.co.uk/) - [Interested in contributing?](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md) +- πŸ”πŸ”₯ [Live preview](https://docsgpt.arc53.com/) - [How to use any other documentation](https://docs.docsgpt.co.uk/Guides/How-to-train-on-other-documentation) +- πŸ’¬πŸŽ‰[Join our Discord](https://discord.gg/n5BX8dh8rU) - [How to host it locally (so all data will stay on-premises)](https://docs.docsgpt.co.uk/Guides/How-to-use-different-LLM) +- πŸ“šπŸ˜Ž [Guides](https://docs.docsgpt.co.uk/) +- πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» [Interested in contributing?](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md) + +- πŸ—‚οΈπŸš€ [How to use any other documentation](https://docs.docsgpt.co.uk/Guides/How-to-train-on-other-documentation) + +- πŸ πŸ” [How to host it locally (so all data will stay on-premises)](https://docs.docsgpt.co.uk/Guides/How-to-use-different-LLM) ## Project structure + - Application - Flask app (main application). - Extensions - Chrome extension. -- Scripts - Script that creates similarity search index and stores for other libraries. +- Scripts - Script that creates similarity search index for other libraries. - Frontend - Frontend uses Vite and React. ## QuickStart -Note: Make sure you have [Docker](https://www.docker.com/) installed +Note: Make sure you have [Docker](https://docs.docker.com/) installed On Mac OS or Linux, write: @@ -89,15 +87,17 @@ It will install all the dependencies and allow you to download the local model o Otherwise, refer to this Guide: 1. Download and open this repository with `git clone https://github.com/arc53/DocsGPT.git` -2. Create a `.env` file in your root directory and set the env variable `OPENAI_API_KEY` with your OpenAI API key and `VITE_API_STREAMING` to true or false, depending on if you want streaming answers or not. +2. Create a `.env` file in your root directory and set the env variable `OPENAI_API_KEY` with your [OpenAI API key](https://platform.openai.com/account/api-keys) and `VITE_API_STREAMING` to true or false, depending on whether you want streaming answers or not. It should look like this inside: - + ``` API_KEY=Yourkey VITE_API_STREAMING=true ``` - See optional environment variables in the `/.env-template` and `/application/.env_sample` files. -3. Run `./run-with-docker-compose.sh`. + + See optional environment variables in the [/.env-template](https://github.com/arc53/DocsGPT/blob/main/.env-template) and [/application/.env_sample](https://github.com/arc53/DocsGPT/blob/main/application/.env_sample) files. + +3. Run [./run-with-docker-compose.sh](https://github.com/arc53/DocsGPT/blob/main/run-with-docker-compose.sh). 4. Navigate to http://localhost:5173/. To stop, just run `Ctrl + C`. @@ -105,10 +105,12 @@ To stop, just run `Ctrl + C`. ## Development environments ### Spin up mongo and redis -For development, only two containers are used from `docker-compose.yaml` (by deleting all services except for Redis and Mongo). + +For development, only two containers are used from [docker-compose.yaml](https://github.com/arc53/DocsGPT/blob/main/docker-compose.yaml) (by deleting all services except for Redis and Mongo). See file [docker-compose-dev.yaml](./docker-compose-dev.yaml). Run + ``` docker compose -f docker-compose-dev.yaml build docker compose -f docker-compose-dev.yaml up -d @@ -119,35 +121,67 @@ docker compose -f docker-compose-dev.yaml up -d Make sure you have Python 3.10 or 3.11 installed. 1. Export required environment variables or prepare a `.env` file in the `/application` folder: - - Copy `.env_sample` and create `.env` with your OpenAI API token for the `API_KEY` and `EMBEDDINGS_KEY` fields. + - Copy [.env_sample](https://github.com/arc53/DocsGPT/blob/main/application/.env_sample) and create `.env` with your OpenAI API token for the `API_KEY` and `EMBEDDINGS_KEY` fields. (check out [`application/core/settings.py`](application/core/settings.py) if you want to see more config options.) 2. (optional) Create a Python virtual environment: + You can follow the [Python official documentation](https://docs.python.org/3/tutorial/venv.html) for virtual environments. + +a) On Mac OS and Linux + ```commandline python -m venv venv . venv/bin/activate ``` -3. Change to the `application/` subdir and install dependencies for the backend: + +b) On Windows + ```commandline -pip install -r application/requirements.txt +python -m venv venv + venv/Scripts/activate ``` + +3. Change to the `application/` subdir by the command `cd application/` and install dependencies for the backend: + +```commandline +pip install -r requirements.txt +``` + 4. Run the app using `flask run --host=0.0.0.0 --port=7091`. 5. Start worker with `celery -A application.app.celery worker -l INFO`. -### Start frontend +### Start frontend Make sure you have Node version 16 or higher. -1. Navigate to the `/frontend` folder. -2. Install dependencies by running `npm install`. -3. Run the app using `npm run dev`. +1. Navigate to the [/frontend](https://github.com/arc53/DocsGPT/tree/main/frontend) folder. +2. Install the required packages `husky` and `vite` (ignore if already installed). + +```commandline +npm install husky -g +npm install vite -g +``` + +3. Install dependencies by running `npm install --include=dev`. +4. Run the app using `npm run dev`. + +## Contributing + +Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for information about how to get involved. We welcome issues, questions, and pull requests. + +## Code Of Conduct + +We as members, contributors, and leaders, pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. Please refer to the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file for more information about contributing. ## Many Thanks To Our Contributors -
- + + Contributors +## License + +The source code license is [MIT](https://opensource.org/license/mit/), as described in the [LICENSE](LICENSE) file. Built with [πŸ¦œοΈπŸ”— LangChain](https://github.com/hwchase17/langchain) From 130a6b67bd6113513c964437de841f33037db14d Mon Sep 17 00:00:00 2001 From: KRISH SONI <67964054+krishvsoni@users.noreply.github.com> Date: Mon, 23 Oct 2023 22:16:19 +0530 Subject: [PATCH 128/347] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a6448dd..9aaad49a 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize ## QuickStart -Note: Make sure you have [Docker](https://docs.docker.com/) installed +Note: Make sure you have [Docker](https://docs.docker.com/engine/install/) installed On Mac OS or Linux, write: From 8934b9ab5c26a5e51c51cfd94925fbac41171942 Mon Sep 17 00:00:00 2001 From: Gourav2609 Date: Mon, 23 Oct 2023 23:15:07 +0530 Subject: [PATCH 129/347] Fixed overflow --- frontend/src/Navigation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index c6c35af8..aed0965e 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -172,7 +172,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { <> {!navOpen && (
diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index c6c35af8..36a73dc3 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -7,6 +7,7 @@ import Message from './assets/message.svg'; import Hamburger from './assets/hamburger.svg'; import Key from './assets/key.svg'; import Info from './assets/info.svg'; +import SettingGear from './assets/settingGear.svg'; import Documentation from './assets/documentation.svg'; import Discord from './assets/discord.svg'; import Github from './assets/github.svg'; @@ -320,6 +321,17 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
+ + `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 ${ + isActive ? 'bg-gray-3000' : '' + }` + } + > + info +

Settings

+
diff --git a/frontend/src/Setting.tsx b/frontend/src/Setting.tsx new file mode 100644 index 00000000..edba40b5 --- /dev/null +++ b/frontend/src/Setting.tsx @@ -0,0 +1,137 @@ +import React, { useState } from 'react'; +import Arrow2 from './assets/dropdown-arrow.svg'; + +const Setting = () => { + const list = ['General', 'Prompts', 'Documents', 'Widgets']; + const [active, setActive] = useState('General'); + const returnActiveTabs = (): JSX.Element => { + if (active === 'General') return ; + else if (active === 'Prompts') return ; + else if (active === 'Documents') return ; + else if (active === 'Widgets') return ; + else return <>; + }; + return ( +
+

Settings

+
+ {list.map((item, index) => ( +
setActive(item)} + > + {item} +
+ ))} +
+ {returnActiveTabs()} +
+ ); +}; + +const General = () => { + const [theme, setTheme] = useState('Light'); + const [isThemeListOpen, setIsThemeListOpen] = useState(false); + const themes = ['Light', 'Dark']; + const [language, setLanguage] = useState('English'); + const languages = ['English', 'French']; + const [isLanguageListOpen, setIsLanguageListOpen] = useState(false); + return ( + <> +
+

Select Theme

+
+
setIsThemeListOpen(!isThemeListOpen)} + > + {theme && ( +

{theme}

+ )} + arrow +
+ {isThemeListOpen && ( +
+ {themes.map((item, index) => ( +
{ + setTheme(item); + setIsThemeListOpen(false); + }} + className="flex h-10 w-full cursor-pointer items-center justify-between border-x-2 border-b-2 hover:bg-gray-100" + > +

+ {item} +

+
+ ))} +
+ )} +
+
+
+

Select Language

+
+
setIsLanguageListOpen(!isLanguageListOpen)} + > + {language && ( +

+ {language} +

+ )} + arrow +
+ {isLanguageListOpen && ( +
+ {languages.map((item, index) => ( +
{ + setLanguage(item); + setIsLanguageListOpen(false); + }} + className="flex h-10 w-full cursor-pointer items-center justify-between border-x-2 border-b-2 hover:bg-gray-100" + > +

+ {item} +

+
+ ))} +
+ )} +
+
+ + ); +}; +const Prompts = () => { + return
This is prompts
; +}; +const Documents = () => { + return
This is Documents
; +}; +const Widgets = () => { + return
This is widgets
; +}; +export default Setting; diff --git a/frontend/src/assets/settingGear.svg b/frontend/src/assets/settingGear.svg new file mode 100644 index 00000000..0b9af06b --- /dev/null +++ b/frontend/src/assets/settingGear.svg @@ -0,0 +1,70 @@ + + + + + + settings-gear + + + + image/svg+xml + + settings-gear + + + + + + + + + \ No newline at end of file diff --git a/frontend/tailwind.config.cjs b/frontend/tailwind.config.cjs index 69086069..7db27d96 100644 --- a/frontend/tailwind.config.cjs +++ b/frontend/tailwind.config.cjs @@ -26,6 +26,7 @@ module.exports = { 'blue-2000': '#002B49', 'blue-3000': '#4B02E2', 'purple-30': '#7D54D1', + 'purple-3000': 'rgb(230,222,247)', 'blue-4000': 'rgba(0, 125, 255, 0.36)', 'blue-5000': 'rgba(0, 125, 255)', }, From 9b10a8028d19c7d102a540d894c2bb0a7dcc41fa Mon Sep 17 00:00:00 2001 From: Yash-sudo-web Date: Wed, 25 Oct 2023 15:38:19 +0530 Subject: [PATCH 139/347] Enhanced How-to-use-different-LLM.md --- docs/pages/Guides/How-to-use-different-LLM.md | 54 ++++++++++--------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/docs/pages/Guides/How-to-use-different-LLM.md b/docs/pages/Guides/How-to-use-different-LLM.md index 8d7cccce..c300bef3 100644 --- a/docs/pages/Guides/How-to-use-different-LLM.md +++ b/docs/pages/Guides/How-to-use-different-LLM.md @@ -1,36 +1,42 @@ -Fortunately, there are many providers for LLMs, and some of them can even be run locally. +# Setting Up Local Language Models for Your App -There are two models used in the app: -1. Embeddings. -2. Text generation. +Your app relies on two essential models: Embeddings and Text Generation. While OpenAI's default models work seamlessly, you have the flexibility to switch providers or even run the models locally. -By default, we use OpenAI's models, but if you want to change it or even run it locally, it's very simple! +## Step 1: Configure Environment Variables -### Go to .env file or set environment variables: +Navigate to the `.env` file or set the following environment variables: -`LLM_NAME=` +```env +LLM_NAME= +API_KEY= +EMBEDDINGS_NAME= +EMBEDDINGS_KEY= +VITE_API_STREAMING= +``` -`API_KEY=` +You can omit the keys if users provide their own. Ensure you set `LLM_NAME` and `EMBEDDINGS_NAME`. -`EMBEDDINGS_NAME=` +## Step 2: Choose Your Models -`EMBEDDINGS_KEY=` +**Options for `LLM_NAME`:** +- openai +- manifest +- cohere +- Arc53/docsgpt-14b +- Arc53/docsgpt-7b-falcon +- llama.cpp -`VITE_API_STREAMING=` +**Options for `EMBEDDINGS_NAME`:** +- openai_text-embedding-ada-002 +- huggingface_sentence-transformers/all-mpnet-base-v2 +- huggingface_hkunlp/instructor-large +- cohere_medium -You don't need to provide keys if you are happy with users providing theirs, so make sure you set `LLM_NAME` and `EMBEDDINGS_NAME`. +If using Llama, set `EMBEDDINGS_NAME` to `huggingface_sentence-transformers/all-mpnet-base-v2`. Download the required model and place it in the `models/` folder. -Options: -LLM_NAME (openai, manifest, cohere, Arc53/docsgpt-14b, Arc53/docsgpt-7b-falcon, llama.cpp) -EMBEDDINGS_NAME (openai_text-embedding-ada-002, huggingface_sentence-transformers/all-mpnet-base-v2, huggingface_hkunlp/instructor-large, cohere_medium) +Alternatively, for local Llama setup, run `setup.sh` and choose option 1. The script handles the DocsGPT model addition. -If using Llama, set the `EMBEDDINGS_NAME` to `huggingface_sentence-transformers/all-mpnet-base-v2` and be sure to download [this model](https://d3dg1063dc54p9.cloudfront.net/models/docsgpt-7b-f16.gguf) into the `models/` folder: `https://d3dg1063dc54p9.cloudfront.net/models/docsgpt-7b-f16.gguf`. +## Step 3: Local Hosting for Privacy -Alternatively, if you wish to run Llama locally, you can run `setup.sh` and choose option 1 when prompted. You do not need to manually add the DocsGPT model mentioned above to your `models/` folder if you use `setup.sh`, as the script will manage that step for you. - -That's it! - -### Hosting everything locally and privately (for using our optimised open-source models) -If you are working with critical data and don't want anything to leave your premises. - -Make sure you set `SELF_HOSTED_MODEL` as true in your `.env` variable, and for your `LLM_NAME`, you can use anything that is on Hugging Face. +If working with sensitive data, host everything locally by setting `SELF_HOSTED_MODEL` to true in your `.env`. For `LLM_NAME`, use any model available on Hugging Face. +That's it! Your app is now configured for local and private hosting, ensuring optimal security for critical data. From 889ce984a9ea9786bd5ecbf2bf01a08b71dad13e Mon Sep 17 00:00:00 2001 From: Exterminator11 Date: Wed, 25 Oct 2023 16:50:01 +0530 Subject: [PATCH 140/347] Made changes --- application/parser/file/openapi3_parser.py | 51 ++++++++++++++++++++++ application/requirements.txt | 1 + tests/test_openapi3parser.py | 2 +- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 application/parser/file/openapi3_parser.py diff --git a/application/parser/file/openapi3_parser.py b/application/parser/file/openapi3_parser.py new file mode 100644 index 00000000..4fd1ffaf --- /dev/null +++ b/application/parser/file/openapi3_parser.py @@ -0,0 +1,51 @@ +from urllib.parse import urlparse + +from openapi_parser import parse + +try: + from scripts.parser.file.base_parser import BaseParser +except ModuleNotFoundError: + from base_parser import BaseParser + + +class OpenAPI3Parser(BaseParser): + def init_parser(self) -> None: + return super().init_parser() + + def get_base_urls(self, urls): + base_urls = [] + for i in urls: + parsed_url = urlparse(i) + base_url = parsed_url.scheme + "://" + parsed_url.netloc + if base_url not in base_urls: + base_urls.append(base_url) + return base_urls + + def get_info_from_paths(self, path): + info = "" + if path.operations: + for operation in path.operations: + info += ( + f"\n{operation.method.value}=" + f"{operation.responses[0].description}" + ) + return info + + def parse_file(self, file_path): + data = parse(file_path) + results = "" + base_urls = self.get_base_urls(link.url for link in data.servers) + base_urls = ",".join([base_url for base_url in base_urls]) + results += f"Base URL:{base_urls}\n" + i = 1 + for path in data.paths: + info = self.get_info_from_paths(path) + results += ( + f"Path{i}: {path.url}\n" + f"description: {path.description}\n" + f"parameters: {path.parameters}\nmethods: {info}\n" + ) + i += 1 + with open("results.txt", "w") as f: + f.write(results) + return results diff --git a/application/requirements.txt b/application/requirements.txt index b4c712f4..908d0ba2 100644 --- a/application/requirements.txt +++ b/application/requirements.txt @@ -57,6 +57,7 @@ nltk==3.8.1 numcodecs==0.11.0 numpy==1.24.2 openai==0.27.8 +openapi3-parser==1.1.14 packaging==23.0 pathos==0.3.0 Pillow==10.0.1 diff --git a/tests/test_openapi3parser.py b/tests/test_openapi3parser.py index 2634c868..1ce01ef5 100644 --- a/tests/test_openapi3parser.py +++ b/tests/test_openapi3parser.py @@ -1,6 +1,6 @@ import pytest from openapi_parser import parse -from scripts.parser.file.openapi3_parser import OpenAPI3Parser +from application.parser.file.openapi3_parser import OpenAPI3Parser @pytest.mark.parametrize( From f3540aac0f2e5028ad694207e158e592a68626f7 Mon Sep 17 00:00:00 2001 From: Exterminator11 Date: Wed, 25 Oct 2023 17:07:47 +0530 Subject: [PATCH 141/347] Changed import --- application/parser/file/openapi3_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/parser/file/openapi3_parser.py b/application/parser/file/openapi3_parser.py index 4fd1ffaf..3c5082fa 100644 --- a/application/parser/file/openapi3_parser.py +++ b/application/parser/file/openapi3_parser.py @@ -3,7 +3,7 @@ from urllib.parse import urlparse from openapi_parser import parse try: - from scripts.parser.file.base_parser import BaseParser + from application.parser.file.base_parser import BaseParser except ModuleNotFoundError: from base_parser import BaseParser From f38c934a6d9f976f4b07baac0d0523fb5f72655c Mon Sep 17 00:00:00 2001 From: Ram-tyagi Date: Wed, 25 Oct 2023 17:42:01 +0530 Subject: [PATCH 142/347] [Add] Vite and react documentation link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b7e9f37..061fba78 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize - Scripts - Script that creates similarity search index for other libraries. -- Frontend - Frontend uses Vite and React. +- Frontend - Frontend uses
Vite and React. ## QuickStart From 7a2e6e640dcddadf927d132c8c90a1ed6b9fc976 Mon Sep 17 00:00:00 2001 From: Ankit Matth <146843890+Ankit-Matth@users.noreply.github.com> Date: Wed, 25 Oct 2023 21:48:25 +0530 Subject: [PATCH 143/347] [making required changes] - Update ConversationBubble.tsx --- .../src/conversation/ConversationBubble.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index dc02447c..7fb377b2 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -162,7 +162,7 @@ const ConversationBubble = forwardRef<
{copied ? ( @@ -199,16 +199,16 @@ const ConversationBubble = forwardRef< style={{ backgroundColor: isLikeHovered ? isLikeClicked - ? '#dfe3f5' - : '#edeef0' + ? '#7D54D1' + : '#EEEEEE' : isLikeClicked - ? '#dfe3f5' + ? '#7D54D1' : '#ffffff', }} > Date: Wed, 25 Oct 2023 22:27:11 +0100 Subject: [PATCH 144/347] Update _meta.json --- docs/pages/Deploying/_meta.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/pages/Deploying/_meta.json b/docs/pages/Deploying/_meta.json index 27090f4b..bcc9bcde 100644 --- a/docs/pages/Deploying/_meta.json +++ b/docs/pages/Deploying/_meta.json @@ -6,5 +6,9 @@ "Quickstart": { "title": "⚑️Quickstart", "href": "/Deploying/Quickstart" + }, + "Railway-Deploying": { + "title": "πŸš‚Deploying on Rainway", + "href": "/Deploying/Railway-Deploying" } } \ No newline at end of file From 1248b76b41ab28cd3191d90740262762b2651b91 Mon Sep 17 00:00:00 2001 From: Ankit Matth <146843890+Ankit-Matth@users.noreply.github.com> Date: Thu, 26 Oct 2023 06:20:50 +0530 Subject: [PATCH 145/347] Background color of like/dislike has been changed --- frontend/src/conversation/ConversationBubble.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 7fb377b2..bac0800c 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -199,10 +199,10 @@ const ConversationBubble = forwardRef< style={{ backgroundColor: isLikeHovered ? isLikeClicked - ? '#7D54D1' + ? 'rgba(125, 84, 209, 0.3)' : '#EEEEEE' : isLikeClicked - ? '#7D54D1' + ? 'rgba(125, 84, 209, 0.3)' : '#ffffff', }} > @@ -238,10 +238,10 @@ const ConversationBubble = forwardRef< style={{ backgroundColor: isDislikeHovered ? isDislikeClicked - ? '#F87171' + ? 'rgba(248, 113, 113, 0.3)' : '#EEEEEE' : isDislikeClicked - ? '#F87171' + ? 'rgba(248, 113, 113, 0.3)' : '#ffffff', }} > From 5f0cccb81e540f980e951458e72818cddf346bad Mon Sep 17 00:00:00 2001 From: Pronay Debnath Date: Thu, 26 Oct 2023 10:37:58 +0530 Subject: [PATCH 146/347] Update Customising-prompts.md --- docs/pages/Guides/Customising-prompts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/Guides/Customising-prompts.md b/docs/pages/Guides/Customising-prompts.md index 6cfbbff7..5e7430d7 100644 --- a/docs/pages/Guides/Customising-prompts.md +++ b/docs/pages/Guides/Customising-prompts.md @@ -2,7 +2,7 @@ To customize the main prompt for DocsGPT, follow these steps: -1. Navigate to `/application/prompt/combine_prompt.txt`. +1. Navigate to `/application/prompts/combine_prompt.txt`. 2. Edit the `combine_prompt.txt` file to modify the prompt text. You can experiment with different phrasings and structures to see how the model responds. From 1a62a773aeb509503045346bbe88933da5d8b2b7 Mon Sep 17 00:00:00 2001 From: Pronay Debnath Date: Thu, 26 Oct 2023 10:40:19 +0530 Subject: [PATCH 147/347] Update react-widget.md --- docs/pages/Extensions/react-widget.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pages/Extensions/react-widget.md b/docs/pages/Extensions/react-widget.md index 4bc40854..de585581 100644 --- a/docs/pages/Extensions/react-widget.md +++ b/docs/pages/Extensions/react-widget.md @@ -43,4 +43,5 @@ export default function MyApp({ Component, pageProps }) { } ``` +For more information about React, refer to this [link here](https://react.dev/learn) From 153d12d93f202309ae009ff6d0acfe736e2b74d5 Mon Sep 17 00:00:00 2001 From: Pronay Debnath Date: Thu, 26 Oct 2023 10:47:35 +0530 Subject: [PATCH 148/347] Update How-to-use-different-LLM.md --- docs/pages/Guides/How-to-use-different-LLM.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/pages/Guides/How-to-use-different-LLM.md b/docs/pages/Guides/How-to-use-different-LLM.md index c300bef3..6c7e08a9 100644 --- a/docs/pages/Guides/How-to-use-different-LLM.md +++ b/docs/pages/Guides/How-to-use-different-LLM.md @@ -19,12 +19,12 @@ You can omit the keys if users provide their own. Ensure you set `LLM_NAME` and ## Step 2: Choose Your Models **Options for `LLM_NAME`:** -- openai -- manifest -- cohere -- Arc53/docsgpt-14b -- Arc53/docsgpt-7b-falcon -- llama.cpp +- OpenAI ([More details](https://platform.openai.com/docs/models)) +- manifest ([More details](https://python.langchain.com/docs/integrations/llms/manifest)) +- cohere ([More details](https://docs.cohere.com/docs/llmu)) +- Arc53/docsgpt-14b ([More details](https://huggingface.co/Arc53/docsgpt-14b)) +- Arc53/docsgpt-7b-falcon ([More details](https://huggingface.co/Arc53/docsgpt-7b-falcon)) +- llama.cpp ([More details](https://python.langchain.com/docs/integrations/llms/llamacpp)) **Options for `EMBEDDINGS_NAME`:** - openai_text-embedding-ada-002 From b68b214d08490f0bed475f38012404a67f0c054c Mon Sep 17 00:00:00 2001 From: Pronay Debnath Date: Thu, 26 Oct 2023 10:56:57 +0530 Subject: [PATCH 149/347] Update My-AI-answers-questions-using-external-knowledge.md --- .../Guides/My-AI-answers-questions-using-external-knowledge.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/Guides/My-AI-answers-questions-using-external-knowledge.md b/docs/pages/Guides/My-AI-answers-questions-using-external-knowledge.md index a546116e..503d18c9 100644 --- a/docs/pages/Guides/My-AI-answers-questions-using-external-knowledge.md +++ b/docs/pages/Guides/My-AI-answers-questions-using-external-knowledge.md @@ -1,3 +1,5 @@ +## Avoiding hallucinations + If your AI uses external knowledge and is not explicit enough, it is ok, because we try to make DocsGPT friendly. But if you want to adjust it, here is a simple way:- From 2e6a5c05254b132990dd4f0f4bac8a32c2f14b51 Mon Sep 17 00:00:00 2001 From: Pronay Debnath Date: Thu, 26 Oct 2023 10:57:24 +0530 Subject: [PATCH 150/347] Update My-AI-answers-questions-using-external-knowledge.md --- .../Guides/My-AI-answers-questions-using-external-knowledge.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/Guides/My-AI-answers-questions-using-external-knowledge.md b/docs/pages/Guides/My-AI-answers-questions-using-external-knowledge.md index 503d18c9..99e3c757 100644 --- a/docs/pages/Guides/My-AI-answers-questions-using-external-knowledge.md +++ b/docs/pages/Guides/My-AI-answers-questions-using-external-knowledge.md @@ -1,4 +1,4 @@ -## Avoiding hallucinations +# Avoiding hallucinations If your AI uses external knowledge and is not explicit enough, it is ok, because we try to make DocsGPT friendly. From 1811cff1f91381332d82a5f623138658abff474b Mon Sep 17 00:00:00 2001 From: Pronay Debnath Date: Thu, 26 Oct 2023 10:59:32 +0530 Subject: [PATCH 151/347] Rename Hosting-the-app.md to Hosting-DocsGPT.md --- docs/pages/Deploying/{Hosting-the-app.md => Hosting-DocsGPT.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/pages/Deploying/{Hosting-the-app.md => Hosting-DocsGPT.md} (100%) diff --git a/docs/pages/Deploying/Hosting-the-app.md b/docs/pages/Deploying/Hosting-DocsGPT.md similarity index 100% rename from docs/pages/Deploying/Hosting-the-app.md rename to docs/pages/Deploying/Hosting-DocsGPT.md From 32fa86adaada8e6115d90f5145ce6ff2b872b5e6 Mon Sep 17 00:00:00 2001 From: Pronay Debnath Date: Thu, 26 Oct 2023 11:11:41 +0530 Subject: [PATCH 152/347] Update _meta.json --- docs/pages/Deploying/_meta.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/Deploying/_meta.json b/docs/pages/Deploying/_meta.json index bcc9bcde..55a8e77c 100644 --- a/docs/pages/Deploying/_meta.json +++ b/docs/pages/Deploying/_meta.json @@ -1,5 +1,5 @@ { - "Hosting-the-app": { + "Hosting-DocsGPT": { "title": "☁️ Hosting DocsGPT", "href": "/Deploying/Hosting-the-app" }, @@ -11,4 +11,4 @@ "title": "πŸš‚Deploying on Rainway", "href": "/Deploying/Railway-Deploying" } -} \ No newline at end of file +} From 12bd7dc44ff9e6ffb10fbc72dea843f8cd5dba67 Mon Sep 17 00:00:00 2001 From: Pronay Debnath Date: Thu, 26 Oct 2023 11:14:30 +0530 Subject: [PATCH 153/347] Update _meta.json --- docs/pages/Deploying/_meta.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/Deploying/_meta.json b/docs/pages/Deploying/_meta.json index 55a8e77c..db262e59 100644 --- a/docs/pages/Deploying/_meta.json +++ b/docs/pages/Deploying/_meta.json @@ -1,7 +1,7 @@ { "Hosting-DocsGPT": { "title": "☁️ Hosting DocsGPT", - "href": "/Deploying/Hosting-the-app" + "href": "/Deploying/Hosting-DocsGPT" }, "Quickstart": { "title": "⚑️Quickstart", From 9133a56d2a92b42f154a5227783fe6fc28ed9b66 Mon Sep 17 00:00:00 2001 From: Pronay Debnath Date: Thu, 26 Oct 2023 11:16:26 +0530 Subject: [PATCH 154/347] Update _meta.json --- docs/pages/Deploying/_meta.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/Deploying/_meta.json b/docs/pages/Deploying/_meta.json index db262e59..0e91f35e 100644 --- a/docs/pages/Deploying/_meta.json +++ b/docs/pages/Deploying/_meta.json @@ -1,7 +1,7 @@ { - "Hosting-DocsGPT": { + "Hosting-the-app": { "title": "☁️ Hosting DocsGPT", - "href": "/Deploying/Hosting-DocsGPT" + "href": "/Deploying/Hosting-the-app" }, "Quickstart": { "title": "⚑️Quickstart", From aaeed646210ca16eaa4043dce29ac675850cfa90 Mon Sep 17 00:00:00 2001 From: Pronay Debnath Date: Thu, 26 Oct 2023 11:17:19 +0530 Subject: [PATCH 155/347] Update and rename Hosting-DocsGPT.md to Hosting-the-app.md --- docs/pages/Deploying/{Hosting-DocsGPT.md => Hosting-the-app.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename docs/pages/Deploying/{Hosting-DocsGPT.md => Hosting-the-app.md} (97%) diff --git a/docs/pages/Deploying/Hosting-DocsGPT.md b/docs/pages/Deploying/Hosting-the-app.md similarity index 97% rename from docs/pages/Deploying/Hosting-DocsGPT.md rename to docs/pages/Deploying/Hosting-the-app.md index 31c3f55a..9550e810 100644 --- a/docs/pages/Deploying/Hosting-DocsGPT.md +++ b/docs/pages/Deploying/Hosting-the-app.md @@ -1,6 +1,6 @@ # Self-hosting DocsGPT on Amazon Lightsail -Here's a step-by-step guide on how to setup an Amazon Lightsail instance to host DocsGPT. +Here's a step-by-step guide on how to set up an Amazon Lightsail instance to host DocsGPT. ## Configuring your instance From 217c4144b5690df3e7621394655f30cce9164d18 Mon Sep 17 00:00:00 2001 From: Akash Bag <110753356+akash0708@users.noreply.github.com> Date: Thu, 26 Oct 2023 13:09:08 +0530 Subject: [PATCH 156/347] docs: Typo in quickstart guide fixed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 061fba78..c9a6124f 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ It will install all the dependencies and allow you to download the local model o Otherwise, refer to this Guide: 1. Download and open this repository with `git clone https://github.com/arc53/DocsGPT.git` -2. Create a `.env` file in your root directory and set the env variable `OPENAI_API_KEY` with your [OpenAI API key](https://platform.openai.com/account/api-keys) and `VITE_API_STREAMING` to true or false, depending on whether you want streaming answers or not. +2. Create a `.env` file in your root directory and set the env variable `API_KEY` with your [OpenAI API key](https://platform.openai.com/account/api-keys) and `VITE_API_STREAMING` to true or false, depending on whether you want streaming answers or not. It should look like this inside: ``` From cff7aebe55916e5e777ea823a45a59723c60048e Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 26 Oct 2023 18:06:26 +0100 Subject: [PATCH 157/347] fix --- docs/pages/Deploying/Railway-Deploying.md | 2 +- .../image.png => public/Railway-selection.png} | Bin 2 files changed, 1 insertion(+), 1 deletion(-) rename docs/{pages/Deploying/image.png => public/Railway-selection.png} (100%) diff --git a/docs/pages/Deploying/Railway-Deploying.md b/docs/pages/Deploying/Railway-Deploying.md index 15e2f60a..8f8fe0fd 100644 --- a/docs/pages/Deploying/Railway-Deploying.md +++ b/docs/pages/Deploying/Railway-Deploying.md @@ -224,7 +224,7 @@ b. Click on Deploy now . -![Three Tabs will be there](image.png) +![Three Tabs will be there](Railway-selection.png) diff --git a/docs/pages/Deploying/image.png b/docs/public/Railway-selection.png similarity index 100% rename from docs/pages/Deploying/image.png rename to docs/public/Railway-selection.png From ff89c3b274497c748ef7fc8591f4ba3e230738f0 Mon Sep 17 00:00:00 2001 From: Christine Date: Thu, 26 Oct 2023 19:12:33 +0000 Subject: [PATCH 158/347] feat: made color accessible --- frontend/src/conversation/Conversation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 9e852f49..cd93f1c1 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -192,7 +192,7 @@ export default function Conversation() {
)}
-

+

This is a chatbot that uses the GPT-3, Faiss and LangChain to answer questions.

From 678fd28f1da7169a5b9bc10e3e5fc7674957a8e3 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 26 Oct 2023 22:53:57 +0100 Subject: [PATCH 159/347] Update Railway-Deploying.md --- docs/pages/Deploying/Railway-Deploying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/Deploying/Railway-Deploying.md b/docs/pages/Deploying/Railway-Deploying.md index 8f8fe0fd..c326a6bd 100644 --- a/docs/pages/Deploying/Railway-Deploying.md +++ b/docs/pages/Deploying/Railway-Deploying.md @@ -224,7 +224,7 @@ b. Click on Deploy now . -![Three Tabs will be there](Railway-selection.png) +![Three Tabs will be there](/Railway-selection.png) From 08a7e666b224e2a959662355eddb14ffda208bbe Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 27 Oct 2023 00:52:15 +0100 Subject: [PATCH 160/347] Update ConversationTile.tsx --- .../src/conversation/ConversationTile.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/frontend/src/conversation/ConversationTile.tsx b/frontend/src/conversation/ConversationTile.tsx index 1b5dc42c..3ee67943 100644 --- a/frontend/src/conversation/ConversationTile.tsx +++ b/frontend/src/conversation/ConversationTile.tsx @@ -7,7 +7,6 @@ import CheckMark from '../assets/checkmark.svg'; import Trash from '../assets/trash.svg'; import { selectConversationId } from '../preferences/preferenceSlice'; -import { useOutsideAlerter } from '../hooks'; interface ConversationProps { name: string; @@ -31,15 +30,15 @@ export default function ConversationTile({ const [isEdit, setIsEdit] = useState(false); const [conversationName, setConversationsName] = useState(''); - useOutsideAlerter( - tileRef, - () => - handleSaveConversation({ - id: conversationId || conversation.id, - name: conversationName, - }), - [conversationName], - ); + // useOutsideAlerter( + // tileRef, + // () => + // handleSaveConversation({ + // id: conversationId || conversation.id, + // name: conversationName, + // }), + // [conversationName], + // ); useEffect(() => { setConversationsName(conversation.name); From 1dc16e900a3ba911e7c1231b5587e6af89edbf2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michelle=20=22MishManners=C2=AE=E2=84=A2=22=20Mannering?= <36594527+mishmanners@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:22:47 +1100 Subject: [PATCH 161/347] Make README accessible Add accessibility features to README file based on the top tips from GitHub: https://github.blog/2023-10-26-5-tips-for-making-your-github-profile-page-accessible/ --- README.md | 185 +++++++++++++----------------------------------------- 1 file changed, 42 insertions(+), 143 deletions(-) diff --git a/README.md b/README.md index c9a6124f..f72ca91d 100644 --- a/README.md +++ b/README.md @@ -1,187 +1,86 @@

- DocsGPT πŸ¦– + DocsGPT πŸ¦–

- Open-Source Documentation Assistant -

-

- DocsGPT is a cutting-edge open-source solution that streamlines the process of finding information in the project documentation. With its integration of the powerful GPT models, developers can easily ask questions about a project and receive accurate answers. - -Say goodbye to time-consuming manual searches, and let DocsGPT help you quickly find the information you need. Try it out and see how it revolutionizes your project documentation experience. Contribute to its development and be a part of the future of AI-powered assistance. -

+ @@ -14,27 +14,27 @@ Say goodbye to time-consuming manual searches, and let - - ![example1](https://img.shields.io/github/stars/arc53/docsgpt?style=social) - ![example2](https://img.shields.io/github/forks/arc53/docsgpt?style=social) - ![example3](https://img.shields.io/github/license/arc53/docsgpt) - ![example3](https://img.shields.io/discord/1070046503302877216) - + + ![link to main GitHub showing Stars number](https://img.shields.io/github/stars/arc53/docsgpt?style=social) + ![link to main GitHub showing Forks number](https://img.shields.io/github/forks/arc53/docsgpt?style=social) + ![link to license file](https://img.shields.io/github/license/arc53/docsgpt) + ![link to discord](https://img.shields.io/discord/1070046503302877216) + +
+ ### Production Support / Help for companies: + We're eager to provide personalized assistance when deploying your DocsGPT to a live environment. -- [Book Demo πŸ‘‹](https://airtable.com/appdeaL0F1qV8Bl2C/shrrJF1Ll7btCJRbP) -- [Send Email βœ‰οΈ](mailto:contact@arc53.com?subject=DocsGPT%20support%2Fsolutions) -### [πŸŽ‰ Join the Hacktoberfest with DocsGPT and Earn a Free T-shirt! πŸŽ‰](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md) +- [Book Demo :wave:](https://airtable.com/appdeaL0F1qV8Bl2C/shrrJF1Ll7btCJRbP) +- [Send Email :email:](mailto:contact@arc53.com?subject=DocsGPT%20support%2Fsolutions) + + +### [:tada: Join the Hacktoberfest with DocsGPT and Earn a Free T-shirt! :tada:](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md) + ![video-example-of-docs-gpt](https://d3dg1063dc54p9.cloudfront.net/videos/demov3.gif) + ## Roadmap -You can find our roadmap [here](https://github.com/orgs/arc53/projects/2). Please don't hesitate to contribute or create issues, it helps us improve DocsGPT! + +You can find our roadmap [on our GitHub project board](https://github.com/orgs/arc53/projects/2). Please don't hesitate to contribute or create issues, it helps us improve DocsGPT! + ## Our Open-Source models optimized for DocsGPT: -| Name | Base Model | Requirements (or similar) | -| --------------------------------------------------------------------- | ----------- | ------------------------- | -| [Docsgpt-7b-falcon](https://huggingface.co/Arc53/docsgpt-7b-falcon) | Falcon-7b | 1xA10G gpu | -| [Docsgpt-14b](https://huggingface.co/Arc53/docsgpt-14b) | llama-2-14b | 2xA10 gpu's | -| [Docsgpt-40b-falcon](https://huggingface.co/Arc53/docsgpt-40b-falcon) | falcon-40b | 8xA10G gpu's | -If you don't have enough resources to run it, you can use bitsnbytes to quantize. + + @@ -48,21 +48,21 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize + ## Features -![Group 9](https://user-images.githubusercontent.com/17906039/220427472-2644cff4-7666-46a5-819f-fc4a521f63c7.png) + +![Main features of DocsGPT showcasing six main features](https://user-images.githubusercontent.com/17906039/220427472-2644cff4-7666-46a5-819f-fc4a521f63c7.png) + ## Useful links -- πŸ”πŸ”₯ [Live preview](https://docsgpt.arc53.com/) -- πŸ’¬πŸŽ‰[Join our Discord](https://discord.gg/n5BX8dh8rU) +- :mag: :fire: [Live preview](https://docsgpt.arc53.com/) + + +- :speech_balloon: :tada: [Join our Discord](https://discord.gg/n5BX8dh8rU) + + +- :books: :sunglasses: [Guides](https://docs.docsgpt.co.uk/) -- πŸ“šπŸ˜Ž [Guides](https://docs.docsgpt.co.uk/) - πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» [Interested in contributing?](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md) -- πŸ—‚οΈπŸš€ [How to use any other documentation](https://docs.docsgpt.co.uk/Guides/How-to-train-on-other-documentation) -- πŸ πŸ” [How to host it locally (so all data will stay on-premises)](https://docs.docsgpt.co.uk/Guides/How-to-use-different-LLM) +- :file_folder: :rocket: [How to use any other documentation](https://docs.docsgpt.co.uk/Guides/How-to-train-on-other-documentation) + + +- :house: :closed_lock_with_key: [How to host it locally (so all data will stay on-premises)](https://docs.docsgpt.co.uk/Guides/How-to-use-different-LLM) + ## Project structure -- Application - Flask app (main application). -- Extensions - Chrome extension. -- Scripts - Script that creates similarity search index for other libraries. + @@ -184,4 +184,4 @@ We as members, contributors, and leaders, pledge to make participation in our co -- Frontend - Frontend uses Vite and React. - -## QuickStart - -Note: Make sure you have [Docker](https://docs.docker.com/engine/install/) installed - -On Mac OS or Linux, write: - -`./setup.sh` - -It will install all the dependencies and allow you to download the local model or use OpenAI. - -Otherwise, refer to this Guide: - -1. Download and open this repository with `git clone https://github.com/arc53/DocsGPT.git` -2. Create a `.env` file in your root directory and set the env variable `API_KEY` with your [OpenAI API key](https://platform.openai.com/account/api-keys) and `VITE_API_STREAMING` to true or false, depending on whether you want streaming answers or not. - It should look like this inside: - - ``` - API_KEY=Yourkey - VITE_API_STREAMING=true - ``` - - See optional environment variables in the [/.env-template](https://github.com/arc53/DocsGPT/blob/main/.env-template) and [/application/.env_sample](https://github.com/arc53/DocsGPT/blob/main/application/.env_sample) files. - -3. Run [./run-with-docker-compose.sh](https://github.com/arc53/DocsGPT/blob/main/run-with-docker-compose.sh). -4. Navigate to http://localhost:5173/. - -To stop, just run `Ctrl + C`. - -## Development environments - -### Spin up mongo and redis - -For development, only two containers are used from [docker-compose.yaml](https://github.com/arc53/DocsGPT/blob/main/docker-compose.yaml) (by deleting all services except for Redis and Mongo). -See file [docker-compose-dev.yaml](./docker-compose-dev.yaml). - -Run - -``` -docker compose -f docker-compose-dev.yaml build -docker compose -f docker-compose-dev.yaml up -d -``` - -### Run the backend - -Make sure you have Python 3.10 or 3.11 installed. - -1. Export required environment variables or prepare a `.env` file in the `/application` folder: - - Copy [.env_sample](https://github.com/arc53/DocsGPT/blob/main/application/.env_sample) and create `.env` with your OpenAI API token for the `API_KEY` and `EMBEDDINGS_KEY` fields. - -(check out [`application/core/settings.py`](application/core/settings.py) if you want to see more config options.) - -2. (optional) Create a Python virtual environment: - You can follow the [Python official documentation](https://docs.python.org/3/tutorial/venv.html) for virtual environments. - -a) On Mac OS and Linux - -```commandline -python -m venv venv -. venv/bin/activate -``` - -b) On Windows - -```commandline -python -m venv venv - venv/Scripts/activate -``` - -3. Change to the `application/` subdir by the command `cd application/` and install dependencies for the backend: - -```commandline -pip install -r requirements.txt -``` - -4. Run the app using `flask run --host=0.0.0.0 --port=7091`. -5. Start worker with `celery -A application.app.celery worker -l INFO`. - -### Start frontend - -Make sure you have Node version 16 or higher. - -1. Navigate to the [/frontend](https://github.com/arc53/DocsGPT/tree/main/frontend) folder. -2. Install the required packages `husky` and `vite` (ignore if already installed). - -```commandline -npm install husky -g -npm install vite -g -``` - -3. Install dependencies by running `npm install --include=dev`. -4. Run the app using `npm run dev`. - -## Contributing - -Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for information about how to get involved. We welcome issues, questions, and pull requests. - -## Code Of Conduct - -We as members, contributors, and leaders, pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. Please refer to the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file for more information about contributing. - -## Many Thanks To Our Contributors - - - Contributors - - -## License The source code license is [MIT](https://opensource.org/license/mit/), as described in the [LICENSE](LICENSE) file. -Built with [πŸ¦œοΈπŸ”— LangChain](https://github.com/hwchase17/langchain) + +Built with [:bird: :link: LangChain](https://github.com/hwchase17/langchain) From 54a3b9900ef287cff69283da6b1f2c6ec82375e0 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 27 Oct 2023 01:52:09 +0100 Subject: [PATCH 162/347] fix error msg --- frontend/src/conversation/ConversationBubble.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 2a9a57ba..b429e2ee 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -69,7 +69,7 @@ const ConversationBubble = forwardRef<
@@ -208,7 +208,7 @@ const ConversationBubble = forwardRef< > Date: Fri, 27 Oct 2023 02:22:04 +0100 Subject: [PATCH 163/347] Update Navigation.tsx --- frontend/src/Navigation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 388ea19b..f3d810d7 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -243,7 +243,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
setIsDocsListOpen(!isDocsListOpen)} > {selectedDocs && ( From 5f03f905827ba8cda7ce7b95eaff8e75367d54ec Mon Sep 17 00:00:00 2001 From: Akash Bag <110753356+akash0708@users.noreply.github.com> Date: Fri, 27 Oct 2023 16:35:59 +0530 Subject: [PATCH 164/347] fix: fixed styling for firefox --- frontend/src/Hero.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index 24fec7c2..e411ab8d 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -18,7 +18,7 @@ export default function Hero({ className = '' }: { className?: string }) { rest!

-
+
Date: Sat, 28 Oct 2023 11:01:50 +0530 Subject: [PATCH 165/347] fix: fixed bug due to change in number of lines of text --- frontend/src/Hero.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index e411ab8d..4df9d109 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -18,7 +18,7 @@ export default function Hero({ className = '' }: { className?: string }) { rest!

-
+
-
+
lock

Secure Data Storage

@@ -47,7 +47,7 @@ export default function Hero({ className = '' }: { className?: string }) {

-
+
Date: Sat, 28 Oct 2023 14:45:57 +0000 Subject: [PATCH 166/347] Bump urllib3 from 1.26.17 to 1.26.18 in /application Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.17 to 1.26.18. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/1.26.17...1.26.18) --- updated-dependencies: - dependency-name: urllib3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- application/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/requirements.txt b/application/requirements.txt index 693e6283..5e0184fb 100644 --- a/application/requirements.txt +++ b/application/requirements.txt @@ -101,7 +101,7 @@ transformers==4.30.0 typer==0.7.0 typing-inspect==0.8.0 typing_extensions==4.5.0 -urllib3==1.26.17 +urllib3==1.26.18 vine==5.0.0 wcwidth==0.2.6 yarl==1.8.2 From fbfb8a3b41abba8e91e7ba01cd1f810a8dc315e1 Mon Sep 17 00:00:00 2001 From: PRINCE PAL <113759522+theprince29@users.noreply.github.com> Date: Sat, 28 Oct 2023 21:17:25 +0530 Subject: [PATCH 167/347] Update CONTRIBUTING.md Under the workflow heading I found that in point 2 & 3 shell was missing, that I rectified and corrected it --- CONTRIBUTING.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2e24b43f..3b713155 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,16 +65,16 @@ Here's a step-by-step guide on how to contribute to DocsGPT: 2. **Clone the Forked Repository:** - Clone the repository using: - ''' shell + ``` shell git clone https://github.com//DocsGPT.git - ''' + ``` 3. **Keep your Fork in Sync:** - Before you make any changes, make sure that your fork is in sync to avoid merge conflicts using: - '''shell - git remote add upstream https://github.com/arc53/DocsGPT.git - git pull upstream master - ''' + ```shell + git remote add upstream https://github.com/arc53/DocsGPT.git + git pull upstream master + ``` 4. **Create and Switch to a New Branch:** - Create a new branch for your contribution using: From 04b40012774a484313f0d8ced997caa4140cf804 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 28 Oct 2023 19:51:12 +0100 Subject: [PATCH 168/347] anthropic working --- application/api/answer/routes.py | 2 ++ application/llm/anthropic.py | 40 ++++++++++++++++++++++ application/llm/llm_creator.py | 4 ++- application/requirements.txt | 1 + docker-compose.yaml | 2 ++ tests/llm/test_anthropic.py | 57 ++++++++++++++++++++++++++++++++ 6 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 application/llm/anthropic.py create mode 100644 tests/llm/test_anthropic.py diff --git a/application/api/answer/routes.py b/application/api/answer/routes.py index b694c4aa..a9327255 100644 --- a/application/api/answer/routes.py +++ b/application/api/answer/routes.py @@ -29,6 +29,8 @@ answer = Blueprint('answer', __name__) if settings.LLM_NAME == "gpt4": gpt_model = 'gpt-4' +elif settings.LLM_NAME == "anthropic": + gpt_model = 'claude-2' else: gpt_model = 'gpt-3.5-turbo' diff --git a/application/llm/anthropic.py b/application/llm/anthropic.py new file mode 100644 index 00000000..a64d71e9 --- /dev/null +++ b/application/llm/anthropic.py @@ -0,0 +1,40 @@ +from application.llm.base import BaseLLM +from application.core.settings import settings + +class AnthropicLLM(BaseLLM): + + def __init__(self, api_key=None): + from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT + self.api_key = api_key or settings.ANTHROPIC_API_KEY # If not provided, use a default from settings + self.anthropic = Anthropic(api_key=self.api_key) + self.HUMAN_PROMPT = HUMAN_PROMPT + self.AI_PROMPT = AI_PROMPT + + def gen(self, model, messages, engine=None, max_tokens=300, stream=False, **kwargs): + context = messages[0]['content'] + user_question = messages[-1]['content'] + prompt = f"### Context \n {context} \n ### Question \n {user_question}" + if stream: + return self.gen_stream(model, prompt, max_tokens, **kwargs) + + completion = self.anthropic.completions.create( + model=model, + max_tokens_to_sample=max_tokens, + stream=stream, + prompt=f"{self.HUMAN_PROMPT} {prompt}{self.AI_PROMPT}", + ) + return completion.completion + + def gen_stream(self, model, messages, engine=None, max_tokens=300, **kwargs): + context = messages[0]['content'] + user_question = messages[-1]['content'] + prompt = f"### Context \n {context} \n ### Question \n {user_question}" + stream_response = self.anthropic.completions.create( + model=model, + prompt=f"{self.HUMAN_PROMPT} {prompt}{self.AI_PROMPT}", + max_tokens_to_sample=max_tokens, + stream=True, + ) + + for completion in stream_response: + yield completion.completion \ No newline at end of file diff --git a/application/llm/llm_creator.py b/application/llm/llm_creator.py index 6a60f1b6..bbc2c792 100644 --- a/application/llm/llm_creator.py +++ b/application/llm/llm_creator.py @@ -2,6 +2,7 @@ from application.llm.openai import OpenAILLM, AzureOpenAILLM from application.llm.sagemaker import SagemakerAPILLM from application.llm.huggingface import HuggingFaceLLM from application.llm.llama_cpp import LlamaCpp +from application.llm.anthropic import AnthropicLLM @@ -11,7 +12,8 @@ class LLMCreator: 'azure_openai': AzureOpenAILLM, 'sagemaker': SagemakerAPILLM, 'huggingface': HuggingFaceLLM, - 'llama.cpp': LlamaCpp + 'llama.cpp': LlamaCpp, + 'anthropic': AnthropicLLM } @classmethod diff --git a/application/requirements.txt b/application/requirements.txt index 693e6283..e2a2b2de 100644 --- a/application/requirements.txt +++ b/application/requirements.txt @@ -4,6 +4,7 @@ aiohttp-retry==2.8.3 aiosignal==1.3.1 aleph-alpha-client==2.16.1 amqp==5.1.1 +anthropic==0.5.0 async-timeout==4.0.2 attrs==22.2.0 billiard==3.6.4.0 diff --git a/docker-compose.yaml b/docker-compose.yaml index 84cc5681..7008b53d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -16,6 +16,7 @@ services: environment: - API_KEY=$API_KEY - EMBEDDINGS_KEY=$API_KEY + - LLM_NAME=$LLM_NAME - CELERY_BROKER_URL=redis://redis:6379/0 - CELERY_RESULT_BACKEND=redis://redis:6379/1 - MONGO_URI=mongodb://mongo:27017/docsgpt @@ -35,6 +36,7 @@ services: environment: - API_KEY=$API_KEY - EMBEDDINGS_KEY=$API_KEY + - LLM_NAME=$LLM_NAME - CELERY_BROKER_URL=redis://redis:6379/0 - CELERY_RESULT_BACKEND=redis://redis:6379/1 - MONGO_URI=mongodb://mongo:27017/docsgpt diff --git a/tests/llm/test_anthropic.py b/tests/llm/test_anthropic.py new file mode 100644 index 00000000..ee4ba15f --- /dev/null +++ b/tests/llm/test_anthropic.py @@ -0,0 +1,57 @@ +import unittest +from unittest.mock import patch, Mock +from application.llm.anthropic import AnthropicLLM + +class TestAnthropicLLM(unittest.TestCase): + + def setUp(self): + self.api_key = "TEST_API_KEY" + self.llm = AnthropicLLM(api_key=self.api_key) + + @patch("application.llm.anthropic.settings") + def test_init_default_api_key(self, mock_settings): + mock_settings.ANTHROPIC_API_KEY = "DEFAULT_API_KEY" + llm = AnthropicLLM() + self.assertEqual(llm.api_key, "DEFAULT_API_KEY") + + def test_gen(self): + messages = [ + {"content": "context"}, + {"content": "question"} + ] + mock_response = Mock() + mock_response.completion = "test completion" + + with patch.object(self.llm.anthropic.completions, "create", return_value=mock_response) as mock_create: + response = self.llm.gen("test_model", messages) + self.assertEqual(response, "test completion") + + prompt_expected = "### Context \n context \n ### Question \n question" + mock_create.assert_called_with( + model="test_model", + max_tokens_to_sample=300, + stream=False, + prompt=f"{self.llm.HUMAN_PROMPT} {prompt_expected}{self.llm.AI_PROMPT}" + ) + + def test_gen_stream(self): + messages = [ + {"content": "context"}, + {"content": "question"} + ] + mock_responses = [Mock(completion="response_1"), Mock(completion="response_2")] + + with patch.object(self.llm.anthropic.completions, "create", return_value=iter(mock_responses)) as mock_create: + responses = list(self.llm.gen_stream("test_model", messages)) + self.assertListEqual(responses, ["response_1", "response_2"]) + + prompt_expected = "### Context \n context \n ### Question \n question" + mock_create.assert_called_with( + model="test_model", + prompt=f"{self.llm.HUMAN_PROMPT} {prompt_expected}{self.llm.AI_PROMPT}", + max_tokens_to_sample=300, + stream=True + ) + +if __name__ == "__main__": + unittest.main() From c14f79ebf7ba31a4de84d338767ed552a8513726 Mon Sep 17 00:00:00 2001 From: Lakshmi Narayanan Date: Sun, 29 Oct 2023 01:40:50 +0400 Subject: [PATCH 169/347] Add the new logo --- frontend/src/assets/cute_docsgpt3.svg | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 frontend/src/assets/cute_docsgpt3.svg diff --git a/frontend/src/assets/cute_docsgpt3.svg b/frontend/src/assets/cute_docsgpt3.svg new file mode 100644 index 00000000..53f7cac1 --- /dev/null +++ b/frontend/src/assets/cute_docsgpt3.svg @@ -0,0 +1,9 @@ + + + + + + + + + From 057ecc3ed9476992170ea1ebb3f72e2c9e586346 Mon Sep 17 00:00:00 2001 From: Lakshmi Narayanan Date: Sun, 29 Oct 2023 01:41:55 +0400 Subject: [PATCH 170/347] Update logo in Homepage and About page --- frontend/src/About.tsx | 3 ++- frontend/src/Hero.tsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index 53a87bc8..4f388e37 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -1,5 +1,6 @@ //TODO - Add hyperlinks to text //TODO - Styling +import DocsGPT3 from './assets/cute_docsgpt3.svg'; export default function About() { return ( @@ -7,7 +8,7 @@ export default function About() {

About DocsGPT

-

πŸ¦–

+ DocsGPT

Find the information in your documentation through AI-powered diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index 34347c09..dd2f60a2 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -1,9 +1,11 @@ +import DocsGPT3 from './assets/cute_docsgpt3.svg'; + export default function Hero({ className = '' }: { className?: string }) { return (

DocsGPT

-

πŸ¦–

+ DocsGPT

Welcome to DocsGPT, your technical documentation assistant! From 754339214c0c923973fb6e55d56d35aaf6a1784a Mon Sep 17 00:00:00 2001 From: Lakshmi Narayanan Date: Sun, 29 Oct 2023 01:42:26 +0400 Subject: [PATCH 171/347] Update logo in conversation --- frontend/src/Avatar.tsx | 4 +++- frontend/src/conversation/ConversationBubble.tsx | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/Avatar.tsx b/frontend/src/Avatar.tsx index 04819e7e..ef733ff2 100644 --- a/frontend/src/Avatar.tsx +++ b/frontend/src/Avatar.tsx @@ -1,9 +1,11 @@ +import { ReactNode } from 'react'; + export default function Avatar({ avatar, size, className, }: { - avatar: string; + avatar: string | ReactNode; size?: 'SMALL' | 'MEDIUM' | 'LARGE'; className: string; }) { diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index b429e2ee..85b80286 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -11,6 +11,7 @@ import ReactMarkdown from 'react-markdown'; import copy from 'copy-to-clipboard'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { vscDarkPlus } from 'react-syntax-highlighter/dist/cjs/styles/prism'; +import DocsGPT3 from '../assets/cute_docsgpt3.svg'; const DisableSourceFE = import.meta.env.VITE_DISABLE_SOURCE_FE || false; @@ -65,7 +66,10 @@ const ConversationBubble = forwardRef< className={`flex self-start ${className} group flex-col pr-20`} >

- + } + >
Date: Sun, 29 Oct 2023 01:43:09 +0400 Subject: [PATCH 172/347] Add expand icon --- frontend/src/assets/expand.svg | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 frontend/src/assets/expand.svg diff --git a/frontend/src/assets/expand.svg b/frontend/src/assets/expand.svg new file mode 100644 index 00000000..a3260d98 --- /dev/null +++ b/frontend/src/assets/expand.svg @@ -0,0 +1,4 @@ + + + + From c3044850797ac62b88e070cdef700caf0f655c3d Mon Sep 17 00:00:00 2001 From: Lakshmi Narayanan Date: Sun, 29 Oct 2023 01:44:00 +0400 Subject: [PATCH 173/347] Fix the color of documentation icon --- frontend/src/assets/documentation.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/assets/documentation.svg b/frontend/src/assets/documentation.svg index a1620ff3..344fb6cc 100644 --- a/frontend/src/assets/documentation.svg +++ b/frontend/src/assets/documentation.svg @@ -1,3 +1,3 @@ - - \ No newline at end of file + + From 56b81b78c30d07fcd9e132c846b3fdac5f194f44 Mon Sep 17 00:00:00 2001 From: Lakshmi Narayanan Date: Sun, 29 Oct 2023 01:48:04 +0400 Subject: [PATCH 174/347] Update sidebar with new logo and icon --- frontend/src/Navigation.tsx | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index f3d810d7..5eb7e018 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -1,19 +1,20 @@ import { useEffect, useRef, useState } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; import { NavLink, useNavigate } from 'react-router-dom'; -import Arrow1 from './assets/arrow.svg'; -import Arrow2 from './assets/dropdown-arrow.svg'; -import Exit from './assets/exit.svg'; -import Message from './assets/message.svg'; -import Hamburger from './assets/hamburger.svg'; -import Key from './assets/key.svg'; -import Info from './assets/info.svg'; +import DocsGPT3 from './assets/cute_docsgpt3.svg'; import Documentation from './assets/documentation.svg'; import Discord from './assets/discord.svg'; +import Arrow2 from './assets/dropdown-arrow.svg'; +import Expand from './assets/expand.svg'; +import Exit from './assets/exit.svg'; import Github from './assets/github.svg'; +import Hamburger from './assets/hamburger.svg'; +import Info from './assets/info.svg'; +import Key from './assets/key.svg'; +import Message from './assets/message.svg'; import UploadIcon from './assets/upload.svg'; import { ActiveState } from './models/misc'; import APIKeyModal from './preferences/APIKeyModal'; -import { useDispatch, useSelector } from 'react-redux'; import { selectApiKeyStatus, selectSelectedDocs, @@ -178,11 +179,11 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { }} > menu toggle )} @@ -192,19 +193,25 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { !navOpen && '-ml-96 md:-ml-[18rem]' } duration-20 fixed top-0 z-20 flex h-full w-72 flex-col border-r-2 bg-gray-50 transition-all`} > -
+
+
+ +

DocsGPT

+
@@ -224,7 +231,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { } my-auto mx-4 mt-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100` } > - +

New Chat

From e627ebc12716028667f7e84622cb61ea2ca8656f Mon Sep 17 00:00:00 2001 From: Lakshmi Narayanan Date: Sun, 29 Oct 2023 02:01:18 +0400 Subject: [PATCH 175/347] Small fix with fixed height and width --- frontend/src/About.tsx | 2 +- frontend/src/Hero.tsx | 2 +- frontend/src/Navigation.tsx | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index 4f388e37..85f654cc 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -8,7 +8,7 @@ export default function About() {

About DocsGPT

- DocsGPT + DocsGPT

Find the information in your documentation through AI-powered diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index dd2f60a2..d1030402 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -5,7 +5,7 @@ export default function Hero({ className = '' }: { className?: string }) {

DocsGPT

- DocsGPT + DocsGPT

Welcome to DocsGPT, your technical documentation assistant! diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 5eb7e018..31a27178 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -210,8 +210,6 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { className={`${ !navOpen ? 'rotate-180' : 'rotate-0' } m-auto transition-all duration-200`} - width="25px" - height="25px" />

From 70a6a275f42a1fb3d45a4306feaff6517a21e8d7 Mon Sep 17 00:00:00 2001 From: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Date: Sun, 29 Oct 2023 14:03:05 +0530 Subject: [PATCH 176/347] Update CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 4f24f158..ba590c87 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -63,7 +63,7 @@ reported to the community leaders responsible for enforcement at contact@arc53.com. All complaints will be reviewed and investigated promptly and fairly. -All community leaders are obligated to respectful towards the privacy and security of the +All community leaders are obligated to be respectful towards the privacy and security of the reporter of any incident. ## Enforcement Guidelines From 7a44c9e650969cc053c4966ff5bfaf04759ccb7c Mon Sep 17 00:00:00 2001 From: Farookh Zaheer Siddiqui <129654632+FarukhS52@users.noreply.github.com> Date: Sun, 29 Oct 2023 14:09:56 +0530 Subject: [PATCH 177/347] Update Railway-Deploying.md --- docs/pages/Deploying/Railway-Deploying.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/pages/Deploying/Railway-Deploying.md b/docs/pages/Deploying/Railway-Deploying.md index c326a6bd..34937b3d 100644 --- a/docs/pages/Deploying/Railway-Deploying.md +++ b/docs/pages/Deploying/Railway-Deploying.md @@ -168,7 +168,7 @@ g. `git push git push --set-upstream origin master` Your local files will now be pushed to your GitHub Account. :) -### 3. Create an Railway Account: +### 3. Create a Railway Account: @@ -192,7 +192,7 @@ b. Choose any from the list of options available (Recommended "**Deploy from Git -c. Choose the required Repository from your Github. +c. Choose the required Repository from your GitHub. @@ -208,7 +208,7 @@ PS: It may take a few minutes for the account setup to complete. -#### You will get A free trail of $5 (use it for trail and then purchase if satisfied and needed) +#### You will get A free trial of $5 (use it for trial and then purchase if satisfied and needed) @@ -220,7 +220,7 @@ a. Choose DocsGPT repo from the list of your GitHub repository that you want to -b. Click on Deploy now . +b. Click on Deploy now. @@ -251,4 +251,4 @@ g. You can update the Root directory, build command, installation command as per -Your own DocsGPT is now available at the Generated domain URl. :) \ No newline at end of file +Your own DocsGPT is now available at the Generated domain URl. :) From 01693cb155294ab300433466f078b724a282a8da Mon Sep 17 00:00:00 2001 From: "beKool.sh" <76424367+beKoool@users.noreply.github.com> Date: Sun, 29 Oct 2023 17:13:23 +0545 Subject: [PATCH 178/347] Fix random spaces --- docs/pages/Developing/API-docs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/Developing/API-docs.md b/docs/pages/Developing/API-docs.md index 09e4f875..e8ee521f 100644 --- a/docs/pages/Developing/API-docs.md +++ b/docs/pages/Developing/API-docs.md @@ -39,9 +39,9 @@ fetch("http://127.0.0.1:5000/api/answer", { In response, you will get a JSON document containing the answer,query and the result: ```json { - "answer": " Hi there! How can I help you?\n", + "answer": "Hi there! How can I help you?\n", "query": "Hi", - "result": " Hi there! How can I help you?\nSOURCES:" + "result": "Hi there! How can I help you?\nSOURCES:" } ``` From c0c9cab14c116f942658f4ab46b1a832365ccd37 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 29 Oct 2023 21:38:17 +0530 Subject: [PATCH 179/347] Formatting --- mock-backend/src/mocks/db.json | 4 ++-- mock-backend/src/server.js | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/mock-backend/src/mocks/db.json b/mock-backend/src/mocks/db.json index 6a15583e..4be7d3f9 100644 --- a/mock-backend/src/mocks/db.json +++ b/mock-backend/src/mocks/db.json @@ -226,7 +226,7 @@ } ], "conversations": [], - "docs_check" : { + "docs_check": { "status": "loaded" - } + } } diff --git a/mock-backend/src/server.js b/mock-backend/src/server.js index 1efb9658..f37b5d9e 100644 --- a/mock-backend/src/server.js +++ b/mock-backend/src/server.js @@ -27,11 +27,11 @@ server.use((req, res, next) => { router.render = (req, res) => { if (req.url === "/feedback") { res.status(200).jsonp({ status: "ok" }); - } else if (req.url === '/upload') { + } else if (req.url === "/upload") { res.status(200).jsonp({ - "status": "ok", - "task_id": localStorage[localStorage.length - 1] - }) + status: "ok", + task_id: localStorage[localStorage.length - 1], + }); } else if (req.url.includes("/task_status")) { const taskId = req.query["task_id"]; const taskIdExists = localStorage.includes(taskId); @@ -49,7 +49,16 @@ router.render = (req, res) => { } else { res.status(404).jsonp({}); } - }else { + } else if (req.url === "/stream") { + res.status(200).jsonp({ + data: "The answer is 42", + sources: [ + "https://en.wikipedia.org/wiki/42_(number)", + "https://en.wikipedia.org/wiki/42_(number)", + ], + conversation_id: "1234", + }); + } else { res.status(res.statusCode).jsonp(res.locals.data); } }; From a74c70e8a1d5b6a15b9281311c4f57d94b4704eb Mon Sep 17 00:00:00 2001 From: Roman Bug Date: Mon, 30 Oct 2023 00:59:17 +0300 Subject: [PATCH 180/347] 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 4e41a0de..4b90b598 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 181/347] 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 411e3234..0b601943 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 182/347] 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 e8ee521f..b57f6b1b 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 183/347] 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 0b601943..89aea851 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 0bdee8219a3b07c7d2f1b17579fda872656275d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michelle=20=22MishManners=C2=AE=E2=84=A2=22=20Mannering?= <36594527+mishmanners@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:59:47 +1100 Subject: [PATCH 184/347] Fix README for some reason - things were missing; fixed now --- README.md | 159 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 130 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index f72ca91d..97a965f5 100644 --- a/README.md +++ b/README.md @@ -1,86 +1,187 @@

- DocsGPT πŸ¦– + DocsGPT πŸ¦–

+ Open-Source Documentation Assistant +

- @@ -14,27 +14,27 @@ Say goodbye to time-consuming manual searches, and let + DocsGPT is a cutting-edge open-source solution that streamlines the process of finding information in the project documentation. With its integration of the powerful GPT models, developers can easily ask questions about a project and receive accurate answers. + +Say goodbye to time-consuming manual searches, and let DocsGPT help you quickly find the information you need. Try it out and see how it revolutionizes your project documentation experience. Contribute to its development and be a part of the future of AI-powered assistance. +

- ### Production Support / Help for companies: - We're eager to provide personalized assistance when deploying your DocsGPT to a live environment. - - [Book Demo :wave:](https://airtable.com/appdeaL0F1qV8Bl2C/shrrJF1Ll7btCJRbP) - [Send Email :email:](mailto:contact@arc53.com?subject=DocsGPT%20support%2Fsolutions) - ### [:tada: Join the Hacktoberfest with DocsGPT and Earn a Free T-shirt! :tada:](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md) - ![video-example-of-docs-gpt](https://d3dg1063dc54p9.cloudfront.net/videos/demov3.gif) - ## Roadmap - -You can find our roadmap [on our GitHub project board](https://github.com/orgs/arc53/projects/2). Please don't hesitate to contribute or create issues, it helps us improve DocsGPT! - +You can find our roadmap [here](https://github.com/orgs/arc53/projects/2). Please don't hesitate to contribute or create issues, it helps us improve DocsGPT! ## Our Open-Source models optimized for DocsGPT: +| Name | Base Model | Requirements (or similar) | +| --------------------------------------------------------------------- | ----------- | ------------------------- | +| [Docsgpt-7b-falcon](https://huggingface.co/Arc53/docsgpt-7b-falcon) | Falcon-7b | 1xA10G gpu | +| [Docsgpt-14b](https://huggingface.co/Arc53/docsgpt-14b) | llama-2-14b | 2xA10 gpu's | +| [Docsgpt-40b-falcon](https://huggingface.co/Arc53/docsgpt-40b-falcon) | falcon-40b | 8xA10G gpu's | - - @@ -48,21 +48,21 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize - +If you don't have enough resources to run it, you can use bitsnbytes to quantize. ## Features - ![Main features of DocsGPT showcasing six main features](https://user-images.githubusercontent.com/17906039/220427472-2644cff4-7666-46a5-819f-fc4a521f63c7.png) - ## Useful links - - :mag: :fire: [Live preview](https://docsgpt.arc53.com/) - - :speech_balloon: :tada: [Join our Discord](https://discord.gg/n5BX8dh8rU) - - :books: :sunglasses: [Guides](https://docs.docsgpt.co.uk/) - -- πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» [Interested in contributing?](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md) - +- :couple: [Interested in contributing?](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md) - :file_folder: :rocket: [How to use any other documentation](https://docs.docsgpt.co.uk/Guides/How-to-train-on-other-documentation) - - :house: :closed_lock_with_key: [How to host it locally (so all data will stay on-premises)](https://docs.docsgpt.co.uk/Guides/How-to-use-different-LLM) - ## Project structure +- Application - Flask app (main application). +- Extensions - Chrome extension. - @@ -184,4 +184,4 @@ We as members, contributors, and leaders, pledge to make participation in our co +- Scripts - Script that creates similarity search index for other libraries. +- Frontend - Frontend uses Vite and React. + +## QuickStart + +Note: Make sure you have [Docker](https://docs.docker.com/engine/install/) installed + +On Mac OS or Linux, write: + +`./setup.sh` + +It will install all the dependencies and allow you to download the local model or use OpenAI. + +Otherwise, refer to this Guide: + +1. Download and open this repository with `git clone https://github.com/arc53/DocsGPT.git` +2. Create a `.env` file in your root directory and set the env variable `API_KEY` with your [OpenAI API key](https://platform.openai.com/account/api-keys) and `VITE_API_STREAMING` to true or false, depending on whether you want streaming answers or not. + It should look like this inside: + + ``` + API_KEY=Yourkey + VITE_API_STREAMING=true + ``` + + See optional environment variables in the [/.env-template](https://github.com/arc53/DocsGPT/blob/main/.env-template) and [/application/.env_sample](https://github.com/arc53/DocsGPT/blob/main/application/.env_sample) files. + +3. Run [./run-with-docker-compose.sh](https://github.com/arc53/DocsGPT/blob/main/run-with-docker-compose.sh). +4. Navigate to http://localhost:5173/. + +To stop, just run `Ctrl + C`. + +## Development environments + +### Spin up mongo and redis + +For development, only two containers are used from [docker-compose.yaml](https://github.com/arc53/DocsGPT/blob/main/docker-compose.yaml) (by deleting all services except for Redis and Mongo). +See file [docker-compose-dev.yaml](./docker-compose-dev.yaml). + +Run + +``` +docker compose -f docker-compose-dev.yaml build +docker compose -f docker-compose-dev.yaml up -d +``` + +### Run the backend + +Make sure you have Python 3.10 or 3.11 installed. + +1. Export required environment variables or prepare a `.env` file in the `/application` folder: + - Copy [.env_sample](https://github.com/arc53/DocsGPT/blob/main/application/.env_sample) and create `.env` with your OpenAI API token for the `API_KEY` and `EMBEDDINGS_KEY` fields. + +(check out [`application/core/settings.py`](application/core/settings.py) if you want to see more config options.) + +2. (optional) Create a Python virtual environment: + You can follow the [Python official documentation](https://docs.python.org/3/tutorial/venv.html) for virtual environments. + +a) On Mac OS and Linux + +```commandline +python -m venv venv +. venv/bin/activate +``` + +b) On Windows + +```commandline +python -m venv venv + venv/Scripts/activate +``` + +3. Change to the `application/` subdir by the command `cd application/` and install dependencies for the backend: + +```commandline +pip install -r requirements.txt +``` + +4. Run the app using `flask run --host=0.0.0.0 --port=7091`. +5. Start worker with `celery -A application.app.celery worker -l INFO`. + +### Start frontend + +Make sure you have Node version 16 or higher. + +1. Navigate to the [/frontend](https://github.com/arc53/DocsGPT/tree/main/frontend) folder. +2. Install the required packages `husky` and `vite` (ignore if already installed). + +```commandline +npm install husky -g +npm install vite -g +``` + +3. Install dependencies by running `npm install --include=dev`. +4. Run the app using `npm run dev`. + +## Contributing + +Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for information about how to get involved. We welcome issues, questions, and pull requests. + +## Code Of Conduct + +We as members, contributors, and leaders, pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. Please refer to the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file for more information about contributing. + +## Many Thanks To Our Contributors + + + Contributors + + +## License The source code license is [MIT](https://opensource.org/license/mit/), as described in the [LICENSE](LICENSE) file. - Built with [:bird: :link: LangChain](https://github.com/hwchase17/langchain) From 5a33953b788fd7211c923cd3d7487f1a6e2aa35c Mon Sep 17 00:00:00 2001 From: Lakshmi Narayanan Date: Mon, 30 Oct 2023 10:14:40 +0400 Subject: [PATCH 185/347] Add Chats heading if there are any conversations --- frontend/src/Navigation.tsx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 31a27178..59ef4af7 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -232,19 +232,21 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {

New Chat

-
- {conversations?.map((conversation) => ( - handleConversationClick(id)} - onDeleteConversation={(id) => handleDeleteConversation(id)} - onSave={(conversation) => updateConversationName(conversation)} - /> - ))} -
+ {conversations && ( +
+

Chats

+ {conversations?.map((conversation) => ( + handleConversationClick(id)} + onDeleteConversation={(id) => handleDeleteConversation(id)} + onSave={(conversation) => updateConversationName(conversation)} + /> + ))} +
+ )} -
Date: Mon, 30 Oct 2023 13:00:47 +0530 Subject: [PATCH 186/347] Update README.md added a lighting emoji to give it more great look --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 97a965f5..f50d4ad9 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for information abou We as members, contributors, and leaders, pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. Please refer to the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file for more information about contributing. -## Many Thanks To Our Contributors +## Many Thanks To Our Contributors⚑ Contributors From 54ac2d33e247ee8a3f5b416cf7be236e2e711527 Mon Sep 17 00:00:00 2001 From: Roman Zhukov Date: Mon, 30 Oct 2023 13:06:37 +0300 Subject: [PATCH 187/347] 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 89aea851..fb6cb7e0 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 188/347] 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 fb6cb7e0..cb5fcf38 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**. From d05f7e208451d0d7c6848540c1dc5598a666a9a5 Mon Sep 17 00:00:00 2001 From: 0xrahul6 <113128186+0xrahul6@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:23:21 +0000 Subject: [PATCH 189/347] Enhanced Guides/Customizi --- docs/pages/Guides/Customising-prompts.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/pages/Guides/Customising-prompts.md b/docs/pages/Guides/Customising-prompts.md index 5e7430d7..fda1b577 100644 --- a/docs/pages/Guides/Customising-prompts.md +++ b/docs/pages/Guides/Customising-prompts.md @@ -1,10 +1,10 @@ # Customizing the Main Prompt -To customize the main prompt for DocsGPT, follow these steps: +Customizing the main prompt for DocsGPT gives you the ability to tailor the AI's responses to your specific requirements. By modifying the prompt text, you can achieve more accurate and relevant answers. Here's how you can do it: -1. Navigate to `/application/prompts/combine_prompt.txt`. +**Step 1:** Navigate to `/application/prompts/combine_prompt.txt`. -2. Edit the `combine_prompt.txt` file to modify the prompt text. You can experiment with different phrasings and structures to see how the model responds. +**Step 2:** Open the combine_prompt.txt file and modify the prompt text to suit your needs. You can experiment with different phrasings and structures to observe how the model responds. The main prompt serves as guidance to the AI model on how to generate responses. ## Example Prompt Modification @@ -19,7 +19,7 @@ When using code examples, use the following format: {summaries} ``` - +Feel free to customize the prompt to align it with your specific use case or the kind of responses you want from the AI. For example, you can focus on specific document types, industries, or topics to get more targeted results. ## Conclusion From fac8c9ee4e569ba667893db5e4a39df4cfe118b6 Mon Sep 17 00:00:00 2001 From: 0xrahul6 <113128186+0xrahul6@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:53:08 +0000 Subject: [PATCH 190/347] Enhancement: Updated Train other docs --- .../How-to-train-on-other-documentation.md | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/docs/pages/Guides/How-to-train-on-other-documentation.md b/docs/pages/Guides/How-to-train-on-other-documentation.md index aa1ff41d..8ddfa564 100644 --- a/docs/pages/Guides/How-to-train-on-other-documentation.md +++ b/docs/pages/Guides/How-to-train-on-other-documentation.md @@ -1,43 +1,47 @@ ## How to train on other documentation -This AI can use any documentation, but first it needs to be prepared for similarity search. +This AI can utilize any documentation, but it requires preparation for similarity search. Follow these steps to get your documentation ready: + +**Step 1: Prepare Your Documentation** ![video-example-of-how-to-do-it](https://d3dg1063dc54p9.cloudfront.net/videos/how-to-vectorise.gif) Start by going to `/scripts/` folder. If you open this file, you will see that it uses RST files from the folder to create a `index.faiss` and `index.pkl`. -It currently uses OPEN_AI to create the vector store, so make sure your documentation is not too big. Pandas cost me around $3-$4. +It currently uses OPENAI to create the vector store, so make sure your documentation is not too large. Using Pandas cost me around $3-$4. -You can usually find documentation on Github in `docs/` folder for most open-source projects. +You can typically find documentation on GitHub in the `docs/` folder for most open-source projects. -### 1. Find documentation in .rst/.md and create a folder with it in your scripts directory +### 1. Find documentation in .rst/.md format and create a folder with it in your scripts directory. - Name it `inputs/`. - Put all your .rst/.md files in there. - The search is recursive, so you don't need to flatten them. -If there are no .rst/.md files just convert whatever you find to .txt file and feed it. (don't forget to change the extension in script) +If there are no .rst/.md files, convert whatever you find to a .txt file and feed it. (Don't forget to change the extension in the script). -### 2. Create .env file in `scripts/` folder -And write your OpenAI API key inside -`OPENAI_API_KEY=`. +### Step 2: Configure Your OpenAI API Key +1. Create a .env file in the scripts/ folder. + - Add your OpenAI API key inside: OPENAI_API_KEY=. -### 3. Run scripts/ingest.py +### Step 3: Run the Ingestion Script `python ingest.py ingest` -It will tell you how much it will cost. +It will provide you with the estimated cost. -### 4. Move `index.faiss` and `index.pkl` generated in `scripts/output` to `application/` folder. +### Step 4: Move `index.faiss` and `index.pkl` generated in `scripts/output` to `application/` folder. -### 5. Run web app -Once you run it will use new context that is relevant to your documentation. -Make sure you select default in the dropdown in the UI. +### Step 5: Run the Web App +Once you run it, it will use new context relevant to your documentation.Make sure you select default in the dropdown in the UI. ## Customization You can learn more about options while running ingest.py by running: + - Make sure you select 'default' from the dropdown in the UI. +## Customization +You can learn more about options while running ingest.py by executing: `python ingest.py --help` | Options | | |:--------------------------------:|:------------------------------------------------------------------------------------------------------------------------------:| From 6fc31ddedb188d10ca3ef11434f674bf75d68323 Mon Sep 17 00:00:00 2001 From: SoumyadiptoPal Date: Mon, 30 Oct 2023 22:32:39 +0530 Subject: [PATCH 191/347] Updated the code --- frontend/src/Setting.tsx | 75 ++++++++++++++++++++++------- frontend/src/assets/arrow-left.svg | 3 ++ frontend/src/assets/arrow-right.svg | 3 ++ frontend/src/assets/settingGear.svg | 73 ++-------------------------- 4 files changed, 66 insertions(+), 88 deletions(-) create mode 100644 frontend/src/assets/arrow-left.svg create mode 100644 frontend/src/assets/arrow-right.svg diff --git a/frontend/src/Setting.tsx b/frontend/src/Setting.tsx index edba40b5..91071518 100644 --- a/frontend/src/Setting.tsx +++ b/frontend/src/Setting.tsx @@ -1,5 +1,7 @@ -import React, { useState } from 'react'; +import React, { useState, useRef } from 'react'; import Arrow2 from './assets/dropdown-arrow.svg'; +import ArrowLeft from './assets/arrow-left.svg'; +import ArrowRight from './assets/arrow-right.svg'; const Setting = () => { const list = ['General', 'Prompts', 'Documents', 'Widgets']; @@ -11,21 +13,58 @@ const Setting = () => { else if (active === 'Widgets') return ; else return <>; }; + const scrollableRef = useRef(null); + const scrollStep = 100; + const scrollLeft = () => { + if (scrollableRef.current) { + if (scrollableRef.current.scrollLeft > 0) { + scrollableRef.current.scrollLeft -= scrollStep; // Adjust the scroll amount as needed + } + } + }; + + const scrollRight = () => { + if (scrollableRef.current) { + scrollableRef.current.scrollLeft += scrollStep; // Adjust the scroll amount as needed + } + }; return (

Settings

-
- {list.map((item, index) => ( -
setActive(item)} - > - {item} +
+
+
+
- ))} +
+
+ {list.map((item, index) => ( +
setActive(item)} + > + {item} +
+ ))} +
+
+
+ +
+
{returnActiveTabs()}
@@ -45,18 +84,18 @@ const General = () => {

Select Theme

setIsThemeListOpen(!isThemeListOpen)} > {theme && ( -

{theme}

+

{theme}

)} arrow
{isThemeListOpen && ( @@ -86,11 +125,11 @@ const General = () => {

Select Language

setIsLanguageListOpen(!isLanguageListOpen)} > {language && ( -

+

{language}

)} @@ -99,7 +138,7 @@ const General = () => { alt="arrow" className={`${ !isLanguageListOpen ? 'rotate-0' : 'rotate-180' - } ml-auto mr-3 w-3 transition-all`} + } ml-auto mr-6 w-3 transition-all`} />
{isLanguageListOpen && ( diff --git a/frontend/src/assets/arrow-left.svg b/frontend/src/assets/arrow-left.svg new file mode 100644 index 00000000..8c7c7972 --- /dev/null +++ b/frontend/src/assets/arrow-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/arrow-right.svg b/frontend/src/assets/arrow-right.svg new file mode 100644 index 00000000..a36d6e8f --- /dev/null +++ b/frontend/src/assets/arrow-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/settingGear.svg b/frontend/src/assets/settingGear.svg index 0b9af06b..abbde123 100644 --- a/frontend/src/assets/settingGear.svg +++ b/frontend/src/assets/settingGear.svg @@ -1,70 +1,3 @@ - - - - - - settings-gear - - - - image/svg+xml - - settings-gear - - - - - - - - - \ No newline at end of file + + + From 4daf08e20f9ef936fcb220564c5cb8ec90dff67d Mon Sep 17 00:00:00 2001 From: Christine Belzie <105683440+CBID2@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:21:53 -0400 Subject: [PATCH 192/347] fix: use a new color --- frontend/src/conversation/Conversation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index cd93f1c1..34b146a7 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -192,7 +192,7 @@ export default function Conversation() {
)}
-

+

This is a chatbot that uses the GPT-3, Faiss and LangChain to answer questions.

From 93279558915937244705114b118a287f374cd65b Mon Sep 17 00:00:00 2001 From: Lakshmi Narayanan Date: Tue, 31 Oct 2023 00:38:12 +0400 Subject: [PATCH 193/347] Update sidebar effects and styles based on figma --- frontend/src/Navigation.tsx | 38 +++++++++++++++++++++++------------- frontend/src/assets/add.svg | 10 ++++++++++ frontend/tailwind.config.cjs | 3 +++ 3 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 frontend/src/assets/add.svg diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 59ef4af7..7b54399c 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -11,7 +11,7 @@ import Github from './assets/github.svg'; import Hamburger from './assets/hamburger.svg'; import Info from './assets/info.svg'; import Key from './assets/key.svg'; -import Message from './assets/message.svg'; +import Add from './assets/add.svg'; import UploadIcon from './assets/upload.svg'; import { ActiveState } from './models/misc'; import APIKeyModal from './preferences/APIKeyModal'; @@ -191,10 +191,10 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { ref={navRef} className={`${ !navOpen && '-ml-96 md:-ml-[18rem]' - } duration-20 fixed top-0 z-20 flex h-full w-72 flex-col border-r-2 bg-gray-50 transition-all`} + } duration-20 bg-light-gray-3000 fixed top-0 z-20 flex h-full w-72 flex-col border-r-2 transition-all`} >
-
+

DocsGPT

@@ -225,16 +225,22 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { }} className={({ isActive }) => `${ - isActive && conversationId === null ? 'bg-gray-3000' : '' - } my-auto mx-4 mt-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100` + isActive ? 'bg-gray-3000' : '' + } group my-auto mx-4 mt-4 flex cursor-pointer gap-2.5 rounded-3xl border border-silver p-3 hover:border-rainy-gray hover:bg-gray-3000` } > - -

New Chat

+ new +

+ New Chat +

{conversations && (
-

Chats

+

Chats

{conversations?.map((conversation) => ( )}
-

Source Docs

+

+ Source Docs +

key -

Reset Key

+

Reset Key

@@ -336,7 +344,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { } > info -

About

+

About

documentation -

Documentation

+

Documentation

link -

Visit our Discord

+

+ Visit our Discord +

link -

Visit our Github

+

Visit our Github

diff --git a/frontend/src/assets/add.svg b/frontend/src/assets/add.svg new file mode 100644 index 00000000..d38c815e --- /dev/null +++ b/frontend/src/assets/add.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/frontend/tailwind.config.cjs b/frontend/tailwind.config.cjs index ff3f42ba..a5d61d67 100644 --- a/frontend/tailwind.config.cjs +++ b/frontend/tailwind.config.cjs @@ -31,6 +31,9 @@ module.exports = { 'green-2000': '#0FFF50', 'light-gray': '#edeef0', 'white-3000': '#ffffff', + 'dove-gray': '#6c6c6c', + silver: '#c4c4c4', + 'rainy-gray': '#a4a4a4', }, }, }, From 0254510d5310e45aaabc6493e7a48ef3cf88db57 Mon Sep 17 00:00:00 2001 From: Lakshmi Narayanan Date: Tue, 31 Oct 2023 00:40:35 +0400 Subject: [PATCH 194/347] Fix the rotation of the avatar --- frontend/src/conversation/ConversationBubble.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 85b80286..6460d662 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -66,10 +66,7 @@ const ConversationBubble = forwardRef< className={`flex self-start ${className} group flex-col pr-20`} >
- } - > + DocsGPT
Date: Mon, 30 Oct 2023 22:01:04 +0000 Subject: [PATCH 195/347] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 97a965f5..abd56e25 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ python -m venv venv pip install -r requirements.txt ``` -4. Run the app using `flask run --host=0.0.0.0 --port=7091`. +4. Run the app using `flask --app application/app.py run --host=0.0.0.0 --port=7091`. 5. Start worker with `celery -A application.app.celery worker -l INFO`. ### Start frontend From 5d1ec6a9c8359842cc1c3fd40fd4d4315f8b2420 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 30 Oct 2023 22:07:34 +0000 Subject: [PATCH 196/347] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index abd56e25..91217c43 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ Say goodbye to time-consuming manual searches, and let ![link to main GitHub showing Forks number](https://img.shields.io/github/forks/arc53/docsgpt?style=social) ![link to license file](https://img.shields.io/github/license/arc53/docsgpt) ![link to discord](https://img.shields.io/discord/1070046503302877216) + ![X (formerly Twitter) URL](https://img.shields.io/twitter/url?url=https%3A%2F%2Ftwitter.com%2FATushynski) +
From 6476e688e55a3d15ea364c05ec06d5d0b101277b Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 30 Oct 2023 22:41:35 +0000 Subject: [PATCH 197/347] Fixes sidebar --- frontend/src/About.tsx | 2 +- frontend/src/Hero.tsx | 2 +- frontend/src/Navigation.tsx | 14 +++++++------- frontend/src/{ => components}/Avatar.tsx | 9 +-------- frontend/src/conversation/ConversationBubble.tsx | 14 ++++++++++++-- 5 files changed, 22 insertions(+), 19 deletions(-) rename frontend/src/{ => components}/Avatar.tsx (58%) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index 85f654cc..eaffafdc 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -8,7 +8,7 @@ export default function About() {

About DocsGPT

- DocsGPT + DocsGPT

Find the information in your documentation through AI-powered diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index b814de1c..b62823aa 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -5,7 +5,7 @@ export default function Hero({ className = '' }: { className?: string }) {

DocsGPT

- DocsGPT + DocsGPT

Welcome to DocsGPT, your technical documentation assistant! diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 7b54399c..328b9ebf 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -191,11 +191,13 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { ref={navRef} className={`${ !navOpen && '-ml-96 md:-ml-[18rem]' - } duration-20 bg-light-gray-3000 fixed top-0 z-20 flex h-full w-72 flex-col border-r-2 transition-all`} + } duration-20 fixed top-0 z-20 flex h-full w-72 flex-col border-r-2 bg-white transition-all`} > -

+
- +

DocsGPT

- {avatar} -
- ); + return
{avatar}
; } diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 6460d662..8c0ab8ef 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -1,5 +1,5 @@ import { forwardRef, useState } from 'react'; -import Avatar from '../Avatar'; +import Avatar from '../components/Avatar'; import { FEEDBACK, MESSAGE_TYPE } from './conversationModels'; import classes from './ConversationBubble.module.css'; import Alert from './../assets/alert.svg'; @@ -66,7 +66,17 @@ const ConversationBubble = forwardRef< className={`flex self-start ${className} group flex-col pr-20`} >
- DocsGPT + + } + /> +
Date: Tue, 31 Oct 2023 11:03:04 +0530 Subject: [PATCH 198/347] Fixed branch name from master to main in contributing guide. --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3b713155..5cfd1206 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,7 +73,7 @@ Here's a step-by-step guide on how to contribute to DocsGPT: - Before you make any changes, make sure that your fork is in sync to avoid merge conflicts using: ```shell git remote add upstream https://github.com/arc53/DocsGPT.git - git pull upstream master + git pull upstream main ``` 4. **Create and Switch to a New Branch:** From 79ec3594fed7099b9e1d15c6c5deac2296fd94c3 Mon Sep 17 00:00:00 2001 From: Sai-Suraj-27 Date: Tue, 31 Oct 2023 12:03:13 +0530 Subject: [PATCH 199/347] Fixed wrong closing parenthesis in codecov.yml --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 9fa3a4e6..3b859168 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,2 +1,2 @@ ignore: - - "*/tests/*” \ No newline at end of file + - "*/tests/*" \ No newline at end of file From d81838dfc496fd79fb6d9fe2ab59cfac190af2c2 Mon Sep 17 00:00:00 2001 From: Guspan Tanadi <36249910+guspan-tanadi@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:40:41 +0700 Subject: [PATCH 200/347] docs: close parentheses EMBEDDINGS_KEY comment settings --- application/core/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/core/settings.py b/application/core/settings.py index 116735a6..25a3295d 100644 --- a/application/core/settings.py +++ b/application/core/settings.py @@ -19,7 +19,7 @@ class Settings(BaseSettings): API_URL: str = "http://localhost:7091" # backend url for celery worker API_KEY: str = None # LLM api key - EMBEDDINGS_KEY: str = None # api key for embeddings (if using openai, just copy API_KEY + EMBEDDINGS_KEY: str = None # api key for embeddings (if using openai, just copy API_KEY) OPENAI_API_BASE: str = None # azure openai api base url OPENAI_API_VERSION: str = None # azure openai api version AZURE_DEPLOYMENT_NAME: str = None # azure deployment name for answering From ce8ed5bfebbbdb69b99e6023ea90ae5b510a02c4 Mon Sep 17 00:00:00 2001 From: Guspan Tanadi <36249910+guspan-tanadi@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:45:23 +0700 Subject: [PATCH 201/347] style: formatting /api/task_status API-docs --- docs/pages/Developing/API-docs.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/pages/Developing/API-docs.md b/docs/pages/Developing/API-docs.md index b57f6b1b..fa66250c 100644 --- a/docs/pages/Developing/API-docs.md +++ b/docs/pages/Developing/API-docs.md @@ -116,6 +116,7 @@ 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`. HTML example: @@ -143,7 +144,9 @@ 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**: `GE`T + +**Method**: `GET` + **Query Parameter**: `task_id` (task ID to check) **Sample JavaScript Fetch Request:** From 147b94d9364b0dd46bd0d861db93c70996f7bf20 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 31 Oct 2023 12:49:25 +0000 Subject: [PATCH 202/347] checkmark bug --- frontend/src/assets/checkMark2.svg | 3 +++ frontend/src/conversation/ConversationBubble.tsx | 4 ++-- frontend/src/conversation/ConversationTile.tsx | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 frontend/src/assets/checkMark2.svg diff --git a/frontend/src/assets/checkMark2.svg b/frontend/src/assets/checkMark2.svg new file mode 100644 index 00000000..9ed02cbd --- /dev/null +++ b/frontend/src/assets/checkMark2.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 8c0ab8ef..8dca54af 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -6,7 +6,7 @@ import Alert from './../assets/alert.svg'; import { ReactComponent as Like } from './../assets/like.svg'; import { ReactComponent as Dislike } from './../assets/dislike.svg'; import { ReactComponent as Copy } from './../assets/copy.svg'; -import { ReactComponent as Checkmark } from './../assets/checkmark.svg'; +import { ReactComponent as CheckMark } from './../assets/checkmark.svg'; import ReactMarkdown from 'react-markdown'; import copy from 'copy-to-clipboard'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; @@ -177,7 +177,7 @@ const ConversationBubble = forwardRef< }} > {copied ? ( - setIsCopyHovered(true)} onMouseLeave={() => setIsCopyHovered(false)} diff --git a/frontend/src/conversation/ConversationTile.tsx b/frontend/src/conversation/ConversationTile.tsx index 3ee67943..8fd6b261 100644 --- a/frontend/src/conversation/ConversationTile.tsx +++ b/frontend/src/conversation/ConversationTile.tsx @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux'; import Edit from '../assets/edit.svg'; import Exit from '../assets/exit.svg'; import Message from '../assets/message.svg'; -import CheckMark from '../assets/checkmark.svg'; +import CheckMark2 from '../assets/checkMark2.svg'; import Trash from '../assets/trash.svg'; import { selectConversationId } from '../preferences/preferenceSlice'; @@ -94,7 +94,7 @@ export default function ConversationTile({ {conversationId === conversation.id && (
Edit Date: Tue, 31 Oct 2023 12:50:38 +0000 Subject: [PATCH 203/347] delete conflicting checkmark --- frontend/src/assets/checkmark.svg | 1 - 1 file changed, 1 deletion(-) delete mode 100644 frontend/src/assets/checkmark.svg diff --git a/frontend/src/assets/checkmark.svg b/frontend/src/assets/checkmark.svg deleted file mode 100644 index 499000e8..00000000 --- a/frontend/src/assets/checkmark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From 0c05e1036dc1fe551f5a15f6d627d83bbc23727b Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 31 Oct 2023 12:52:27 +0000 Subject: [PATCH 204/347] del --- frontend/src/assets/checkMark.svg | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 frontend/src/assets/checkMark.svg diff --git a/frontend/src/assets/checkMark.svg b/frontend/src/assets/checkMark.svg deleted file mode 100644 index 9ed02cbd..00000000 --- a/frontend/src/assets/checkMark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file From 5d0b8588f93c0be034fbbf63275d7925f2fb2348 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 31 Oct 2023 12:52:34 +0000 Subject: [PATCH 205/347] Revert "delete conflicting checkmark" This reverts commit 266087c5f16e47fff60334f0725c6115e8ca0e2c. --- frontend/src/assets/checkmark.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 frontend/src/assets/checkmark.svg diff --git a/frontend/src/assets/checkmark.svg b/frontend/src/assets/checkmark.svg new file mode 100644 index 00000000..499000e8 --- /dev/null +++ b/frontend/src/assets/checkmark.svg @@ -0,0 +1 @@ + \ No newline at end of file From 9c5e3d094b6a01bd90d876200c6ebc800da812ca Mon Sep 17 00:00:00 2001 From: Guspan Tanadi <36249910+guspan-tanadi@users.noreply.github.com> Date: Tue, 31 Oct 2023 19:59:09 +0700 Subject: [PATCH 206/347] docs: insert Method description /api/docs_check section API-docs --- docs/pages/Developing/API-docs.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/Developing/API-docs.md b/docs/pages/Developing/API-docs.md index fa66250c..5601ebc8 100644 --- a/docs/pages/Developing/API-docs.md +++ b/docs/pages/Developing/API-docs.md @@ -55,6 +55,8 @@ This endpoint will make sure documentation is loaded on the server (just run it **Request:** +**Method**: `POST` + **Headers**: Content-Type should be set to `application/json; charset=utf-8` **Request Body**: JSON object with the field: From 5e0dd5c63b39b0ff235aa86e92656634f60a1b9d Mon Sep 17 00:00:00 2001 From: Varun Dhand Date: Tue, 31 Oct 2023 18:56:18 +0530 Subject: [PATCH 207/347] feat: mobile responsive hero page --- frontend/src/Hero.tsx | 178 +++++++++++++++++++++++++++++++++--------- 1 file changed, 139 insertions(+), 39 deletions(-) diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index b62823aa..406e48f8 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -1,34 +1,81 @@ +import { useMediaQuery } from './hooks'; import DocsGPT3 from './assets/cute_docsgpt3.svg'; export default function Hero({ className = '' }: { className?: string }) { + // const isMobile = window.innerWidth <= 768; + const { isMobile } = useMediaQuery(); return ( -
-
+
+

DocsGPT

DocsGPT
-

- Welcome to DocsGPT, your technical documentation assistant! -

-

- Enter a query related to the information in the documentation you - selected to receive -
and we will provide you with the most relevant answers. -

-

- Start by entering your query in the input field below and we will do the - rest! -

-
-
-
- lock -

Chat with Your Data

-

+ {isMobile ? ( +

+ Welcome to DocsGPT, your technical + documentation assistant! Start by entering your query in the input + field below, and we'll provide you with the most relevant + answers. +

+ ) : ( + <> +

+ Welcome to DocsGPT, your technical documentation assistant! +

+

+ Enter a query related to the information in the documentation you + selected to receive +
and we will provide you with the most relevant answers. +

+

+ Start by entering your query in the input field below and we will do + the rest! +

+ + )} +
+ {/* first */} +
+
+ {/* Add Mobile check here */} + {isMobile ? ( +
+ lock +

+ Chat with Your Data +

+
+ ) : ( + <> + lock +

+ Chat with Your Data +

+ + )} +

DocsGPT will use your data to answer questions. Whether its documentation, source code, or Microsoft files, DocsGPT allows you to have interactive conversations and find answers based on the @@ -36,12 +83,36 @@ export default function Hero({ className = '' }: { className?: string }) {

- -
-
- lock -

Secure Data Storage

-

+ {/* second */} +

+
+ {/* Add Mobile check here */} + {isMobile ? ( +
+ lock +

+ Secure Data Storage +

+
+ ) : ( + <> + lock +

+ Secure Data Storage +

+ + )} +

The security of your data is our top priority. DocsGPT ensures the utmost protection for your sensitive information. With secure data storage and privacy measures in place, you can trust that your @@ -49,15 +120,44 @@ export default function Hero({ className = '' }: { className?: string }) {

-
-
- lock -

Open Source Code

-

+ {/* third */} +

+
+ {/* Add Mobile check here */} + {isMobile ? ( +
+ lock +

+ Open Source Code +

+
+ ) : ( + <> + lock +

+ Open Source Code +

+ + )} +

DocsGPT is built on open source principles, promoting transparency and collaboration. The source code is freely available, enabling developers to contribute, enhance, and customize the app to meet From ba132fc4111014a51e8b44979ef414ba4ddaa85c Mon Sep 17 00:00:00 2001 From: 0xrahul6 <113128186+0xrahul6@users.noreply.github.com> Date: Tue, 31 Oct 2023 19:12:38 +0530 Subject: [PATCH 208/347] Update Customising-prompts.md --- docs/pages/Guides/Customising-prompts.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/Guides/Customising-prompts.md b/docs/pages/Guides/Customising-prompts.md index fda1b577..691abcf2 100644 --- a/docs/pages/Guides/Customising-prompts.md +++ b/docs/pages/Guides/Customising-prompts.md @@ -2,9 +2,9 @@ Customizing the main prompt for DocsGPT gives you the ability to tailor the AI's responses to your specific requirements. By modifying the prompt text, you can achieve more accurate and relevant answers. Here's how you can do it: -**Step 1:** Navigate to `/application/prompts/combine_prompt.txt`. +1. Navigate to `/application/prompts/combine_prompt.txt`. -**Step 2:** Open the combine_prompt.txt file and modify the prompt text to suit your needs. You can experiment with different phrasings and structures to observe how the model responds. The main prompt serves as guidance to the AI model on how to generate responses. +2. Open the combine_prompt.txt file and modify the prompt text to suit your needs. You can experiment with different phrasings and structures to observe how the model responds. The main prompt serves as guidance to the AI model on how to generate responses. ## Example Prompt Modification From 6918a36beefdb7e2c496ae808877a5492de35bbb Mon Sep 17 00:00:00 2001 From: 0xrahul6 <113128186+0xrahul6@users.noreply.github.com> Date: Tue, 31 Oct 2023 19:14:14 +0530 Subject: [PATCH 209/347] Update Customising-prompts.md --- docs/pages/Guides/Customising-prompts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/Guides/Customising-prompts.md b/docs/pages/Guides/Customising-prompts.md index 691abcf2..9d95aa8f 100644 --- a/docs/pages/Guides/Customising-prompts.md +++ b/docs/pages/Guides/Customising-prompts.md @@ -4,7 +4,7 @@ Customizing the main prompt for DocsGPT gives you the ability to tailor the AI's 1. Navigate to `/application/prompts/combine_prompt.txt`. -2. Open the combine_prompt.txt file and modify the prompt text to suit your needs. You can experiment with different phrasings and structures to observe how the model responds. The main prompt serves as guidance to the AI model on how to generate responses. +2. Open the `combine_prompt.txt` file and modify the prompt text to suit your needs. You can experiment with different phrasings and structures to observe how the model responds. The main prompt serves as guidance to the AI model on how to generate responses. ## Example Prompt Modification From 7ba939b00861191957c65893b03df67db4a789e8 Mon Sep 17 00:00:00 2001 From: Varun Dhand Date: Tue, 31 Oct 2023 18:56:18 +0530 Subject: [PATCH 210/347] feat: mobile responsive hero page --- frontend/src/Hero.tsx | 178 +++++++++++++++++++++++++++++++++--------- 1 file changed, 139 insertions(+), 39 deletions(-) diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index b62823aa..406e48f8 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -1,34 +1,81 @@ +import { useMediaQuery } from './hooks'; import DocsGPT3 from './assets/cute_docsgpt3.svg'; export default function Hero({ className = '' }: { className?: string }) { + // const isMobile = window.innerWidth <= 768; + const { isMobile } = useMediaQuery(); return ( -

-
+
+

DocsGPT

DocsGPT
-

- Welcome to DocsGPT, your technical documentation assistant! -

-

- Enter a query related to the information in the documentation you - selected to receive -
and we will provide you with the most relevant answers. -

-

- Start by entering your query in the input field below and we will do the - rest! -

-
-
-
- lock -

Chat with Your Data

-

+ {isMobile ? ( +

+ Welcome to DocsGPT, your technical + documentation assistant! Start by entering your query in the input + field below, and we'll provide you with the most relevant + answers. +

+ ) : ( + <> +

+ Welcome to DocsGPT, your technical documentation assistant! +

+

+ Enter a query related to the information in the documentation you + selected to receive +
and we will provide you with the most relevant answers. +

+

+ Start by entering your query in the input field below and we will do + the rest! +

+ + )} +
+ {/* first */} +
+
+ {/* Add Mobile check here */} + {isMobile ? ( +
+ lock +

+ Chat with Your Data +

+
+ ) : ( + <> + lock +

+ Chat with Your Data +

+ + )} +

DocsGPT will use your data to answer questions. Whether its documentation, source code, or Microsoft files, DocsGPT allows you to have interactive conversations and find answers based on the @@ -36,12 +83,36 @@ export default function Hero({ className = '' }: { className?: string }) {

- -
-
- lock -

Secure Data Storage

-

+ {/* second */} +

+
+ {/* Add Mobile check here */} + {isMobile ? ( +
+ lock +

+ Secure Data Storage +

+
+ ) : ( + <> + lock +

+ Secure Data Storage +

+ + )} +

The security of your data is our top priority. DocsGPT ensures the utmost protection for your sensitive information. With secure data storage and privacy measures in place, you can trust that your @@ -49,15 +120,44 @@ export default function Hero({ className = '' }: { className?: string }) {

-
-
- lock -

Open Source Code

-

+ {/* third */} +

+
+ {/* Add Mobile check here */} + {isMobile ? ( +
+ lock +

+ Open Source Code +

+
+ ) : ( + <> + lock +

+ Open Source Code +

+ + )} +

DocsGPT is built on open source principles, promoting transparency and collaboration. The source code is freely available, enabling developers to contribute, enhance, and customize the app to meet From 4c6b8b4173eb15548792ab55542b798e982cc7fc Mon Sep 17 00:00:00 2001 From: Arnav Kohli <95236897+THEGAMECHANGER416@users.noreply.github.com> Date: Tue, 31 Oct 2023 20:00:07 +0530 Subject: [PATCH 211/347] Update worker.py Added comments in difficult to understand areas --- application/worker.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/application/worker.py b/application/worker.py index 71fcd615..ae8f240c 100644 --- a/application/worker.py +++ b/application/worker.py @@ -20,17 +20,34 @@ except FileExistsError: pass +# Define a function to extract metadata from a given filename. def metadata_from_filename(title): store = '/'.join(title.split('/')[1:3]) return {'title': title, 'store': store} +# Define a function to generate a random string of a given length. def generate_random_string(length): return ''.join([string.ascii_letters[i % 52] for i in range(length)]) current_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +# Define the main function for ingesting and processing documents. def ingest_worker(self, directory, formats, name_job, filename, user): + """ + Ingest and process documents. + + Args: + self: Reference to the instance of the task. + directory (str): Specifies the directory for ingesting ('inputs' or 'temp'). + formats (list of str): List of file extensions to consider for ingestion (e.g., [".rst", ".md"]). + name_job (str): Name of the job for this ingestion task. + filename (str): Name of the file to be ingested. + user (str): Identifier for the user initiating the ingestion. + + Returns: + dict: Information about the completed ingestion task, including input parameters and a "limited" flag. + """ # directory = 'inputs' or 'temp' # formats = [".rst", ".md"] input_files = None From 8ee0fbe6a3af6ac1044d71ec5408139e8858fb11 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 31 Oct 2023 17:23:01 +0000 Subject: [PATCH 212/347] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a249286..4bc9d199 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Say goodbye to time-consuming manual searches, and let ![link to main GitHub showing Forks number](https://img.shields.io/github/forks/arc53/docsgpt?style=social) ![link to license file](https://img.shields.io/github/license/arc53/docsgpt) ![link to discord](https://img.shields.io/discord/1070046503302877216) - ![X (formerly Twitter) URL](https://img.shields.io/twitter/url?url=https%3A%2F%2Ftwitter.com%2FATushynski) + ![X (formerly Twitter) URL](https://img.shields.io/twitter/follow/ATushynski)

From de0e1d3e104041977f7deb4eeba49c8869e5cf62 Mon Sep 17 00:00:00 2001 From: Senthil Kumar N <89689985+IamSenthilKumar@users.noreply.github.com> Date: Tue, 31 Oct 2023 23:41:27 +0530 Subject: [PATCH 213/347] Fix Guide to use other LLMS --- docs/pages/Guides/How-to-use-different-LLM.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/pages/Guides/How-to-use-different-LLM.md b/docs/pages/Guides/How-to-use-different-LLM.md index 6c7e08a9..da7c18ad 100644 --- a/docs/pages/Guides/How-to-use-different-LLM.md +++ b/docs/pages/Guides/How-to-use-different-LLM.md @@ -19,11 +19,14 @@ You can omit the keys if users provide their own. Ensure you set `LLM_NAME` and ## Step 2: Choose Your Models **Options for `LLM_NAME`:** -- OpenAI ([More details](https://platform.openai.com/docs/models)) +- openai ([More details](https://platform.openai.com/docs/models)) +- anthropic ([More details](https://docs.anthropic.com/claude/reference/selecting-a-model)) - manifest ([More details](https://python.langchain.com/docs/integrations/llms/manifest)) - cohere ([More details](https://docs.cohere.com/docs/llmu)) +- Arc53/DocsGPT-7B ([More details](https://huggingface.co/Arc53/DocsGPT-7B)) - Arc53/docsgpt-14b ([More details](https://huggingface.co/Arc53/docsgpt-14b)) - Arc53/docsgpt-7b-falcon ([More details](https://huggingface.co/Arc53/docsgpt-7b-falcon)) +- Arc53/docsgpt-40b-falcon ([More details](https://huggingface.co/Arc53/docsgpt-40b-falcon)) - llama.cpp ([More details](https://python.langchain.com/docs/integrations/llms/llamacpp)) **Options for `EMBEDDINGS_NAME`:** From 50943865168d49fdcb5898b921d341b2eb2a8de8 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 31 Oct 2023 18:21:44 +0000 Subject: [PATCH 214/347] hotfix-1 --- frontend/src/Navigation.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index a0c18c50..f81d5eac 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -11,9 +11,6 @@ import Github from './assets/github.svg'; import Hamburger from './assets/hamburger.svg'; import Info from './assets/info.svg'; import SettingGear from './assets/settingGear.svg'; -import Documentation from './assets/documentation.svg'; -import Discord from './assets/discord.svg'; -import Github from './assets/github.svg'; import Key from './assets/key.svg'; import Add from './assets/add.svg'; import UploadIcon from './assets/upload.svg'; From 973c11a04839b73acac4c0d00f8af5827dd4bca3 Mon Sep 17 00:00:00 2001 From: arpitpandey0209 Date: Wed, 1 Nov 2023 01:04:40 +0530 Subject: [PATCH 215/347] docs: fix grammar issues --- README.md | 4 ++-- application/prompts/chat_combine_prompt.txt | 2 +- application/prompts/chat_reduce_prompt.txt | 2 +- application/prompts/combine_prompt.txt | 2 +- application/prompts/combine_prompt_hist.txt | 2 +- docs/pages/Deploying/Railway-Deploying.md | 2 +- docs/pages/Guides/Customising-prompts.md | 2 +- extensions/react-widget/README.md | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4bc9d199..980be6a9 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize Note: Make sure you have [Docker](https://docs.docker.com/engine/install/) installed -On Mac OS or Linux, write: +On macOS or Linux, write: `./setup.sh` @@ -130,7 +130,7 @@ Make sure you have Python 3.10 or 3.11 installed. 2. (optional) Create a Python virtual environment: You can follow the [Python official documentation](https://docs.python.org/3/tutorial/venv.html) for virtual environments. -a) On Mac OS and Linux +a) On macOS and Linux ```commandline python -m venv venv diff --git a/application/prompts/chat_combine_prompt.txt b/application/prompts/chat_combine_prompt.txt index 2f9a61c9..194b8537 100644 --- a/application/prompts/chat_combine_prompt.txt +++ b/application/prompts/chat_combine_prompt.txt @@ -1,5 +1,5 @@ You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible. -Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses. +Use the following pieces of context to help answer the users question. If it's not relevant to the question, provide friendly responses. You have access to chat history, and can use it to help answer the question. When using code examples, use the following format: ```(language) diff --git a/application/prompts/chat_reduce_prompt.txt b/application/prompts/chat_reduce_prompt.txt index a5842d87..b4525c2d 100644 --- a/application/prompts/chat_reduce_prompt.txt +++ b/application/prompts/chat_reduce_prompt.txt @@ -1,3 +1,3 @@ -Use the following pieces of context to help answer the users question. If its not relevant to the question, respond with "-" +Use the following pieces of context to help answer the users question. If it's not relevant to the question, respond with "-" ---------------- {context} \ No newline at end of file diff --git a/application/prompts/combine_prompt.txt b/application/prompts/combine_prompt.txt index a008da32..c9ce63de 100644 --- a/application/prompts/combine_prompt.txt +++ b/application/prompts/combine_prompt.txt @@ -2,7 +2,7 @@ You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help QUESTION: How to merge tables in pandas? ========= -Content: pandas provides various facilities for easily combining together Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. +Content: pandas provides various facilities for easily combining Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. Source: 28-pl Content: pandas provides a single function, merge(), as the entry point for all standard database join operations between DataFrame or named Series objects: \n\npandas.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes=('_x', '_y'), copy=True, indicator=False, validate=None) Source: 30-pl diff --git a/application/prompts/combine_prompt_hist.txt b/application/prompts/combine_prompt_hist.txt index 509a4a0f..0d072902 100644 --- a/application/prompts/combine_prompt_hist.txt +++ b/application/prompts/combine_prompt_hist.txt @@ -2,7 +2,7 @@ You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help QUESTION: How to merge tables in pandas? ========= -Content: pandas provides various facilities for easily combining together Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. +Content: pandas provides various facilities for easily combining Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. Source: 28-pl Content: pandas provides a single function, merge(), as the entry point for all standard database join operations between DataFrame or named Series objects: \n\npandas.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes=('_x', '_y'), copy=True, indicator=False, validate=None) Source: 30-pl diff --git a/docs/pages/Deploying/Railway-Deploying.md b/docs/pages/Deploying/Railway-Deploying.md index 34937b3d..ab6064a9 100644 --- a/docs/pages/Deploying/Railway-Deploying.md +++ b/docs/pages/Deploying/Railway-Deploying.md @@ -7,7 +7,7 @@ Here's a step-by-step guide on how to host DocsGPT on Railway App. -At first Clone and setup the project locally to run , test and Modify. +At first Clone and set up the project locally to run , test and Modify. diff --git a/docs/pages/Guides/Customising-prompts.md b/docs/pages/Guides/Customising-prompts.md index 9d95aa8f..2b124c04 100644 --- a/docs/pages/Guides/Customising-prompts.md +++ b/docs/pages/Guides/Customising-prompts.md @@ -11,7 +11,7 @@ Customizing the main prompt for DocsGPT gives you the ability to tailor the AI's **Original Prompt:** ```markdown You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible. -Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses. +Use the following pieces of context to help answer the users question. If it's not relevant to the question, provide friendly responses. You have access to chat history, and can use it to help answer the question. When using code examples, use the following format: diff --git a/extensions/react-widget/README.md b/extensions/react-widget/README.md index a680b180..89dff7e4 100644 --- a/extensions/react-widget/README.md +++ b/extensions/react-widget/README.md @@ -1,7 +1,7 @@ # DocsGPT react widget -THis widget will allow you to embed a DocsGPT assistant in your react app. +This widget will allow you to embed a DocsGPT assistant in your React app. ## Installation From 3bc0fe5a70b74033e0f5bdcd43b1b7eef133c49d Mon Sep 17 00:00:00 2001 From: gfggithubleet <144522681+gfggithubleet@users.noreply.github.com> Date: Wed, 1 Nov 2023 01:09:38 +0530 Subject: [PATCH 216/347] Update README.md TYPO FIXED --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4bc9d199..3c0e4126 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Say goodbye to time-consuming manual searches, and let
diff --git a/frontend/src/index.css b/frontend/src/index.css index 256367b4..4d881fe0 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -364,3 +364,17 @@ template { color: #9ca3af; opacity: 1; } + +/* third container laylout for Firefox */ +@-moz-document url-prefix() { + .firefox{ + padding: 32px; + } +} + +/* For screens with a maximum width of 768px (mobile) */ +@media (max-width: 768px) { + .firefox { + padding: 16px; + } +} \ No newline at end of file From 961c26894df720131cf52edb383c3da3d4d29a24 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 31 Oct 2023 23:21:46 +0000 Subject: [PATCH 218/347] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 3c0e4126..58639d3d 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,6 @@ We're eager to provide personalized assistance when deploying your DocsGPT to a - [Book Demo :wave:](https://airtable.com/appdeaL0F1qV8Bl2C/shrrJF1Ll7btCJRbP) - [Send Email :email:](mailto:contact@arc53.com?subject=DocsGPT%20support%2Fsolutions) -### [:tada: Join the Hacktoberfest with DocsGPT and Earn a Free T-shirt! :tada:](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md) - ![video-example-of-docs-gpt](https://d3dg1063dc54p9.cloudfront.net/videos/demov3.gif) ## Roadmap From bb527ac9813cf1fdda170950bd99e26c33d55bc8 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 31 Oct 2023 23:22:23 +0000 Subject: [PATCH 219/347] Update index.mdx --- docs/pages/index.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/pages/index.mdx b/docs/pages/index.mdx index fa667b70..8c646918 100644 --- a/docs/pages/index.mdx +++ b/docs/pages/index.mdx @@ -25,8 +25,6 @@ DocsGPT πŸ¦– is an innovative open-source tool designed to simplify the retrieva Try it yourself: [https://docsgpt.arc53.com/](https://docsgpt.arc53.com/) -### [πŸŽ‰ Join the Hacktoberfest with DocsGPT and Contribute to Earn a Free T-shirt!](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md) - ( From 715cd9daf5e5ac3a4748cac715642a1006dc68cb Mon Sep 17 00:00:00 2001 From: arpitpandey0209 Date: Wed, 1 Nov 2023 09:51:09 +0530 Subject: [PATCH 220/347] Revert some files --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0505744f..980be6a9 100644 --- a/README.md +++ b/README.md @@ -23,20 +23,22 @@ Say goodbye to time-consuming manual searches, and let -### Production Support / Help for companies: +### Production Support / Help for Companies: We're eager to provide personalized assistance when deploying your DocsGPT to a live environment. - [Book Demo :wave:](https://airtable.com/appdeaL0F1qV8Bl2C/shrrJF1Ll7btCJRbP) - [Send Email :email:](mailto:contact@arc53.com?subject=DocsGPT%20support%2Fsolutions) -### [:tada: Join the Hacktoberfest with DocsGPT and Earn a Free T-shirt! :tada:](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md) - -![video-example-of-docs-gpt](https://d3dg1063dc54p9.cloudfront.net/videos/demov3.gif) ## Roadmap You can find our roadmap [here](https://github.com/orgs/arc53/projects/2). Please don't hesitate to contribute or create issues, it helps us improve DocsGPT! -## Our Open-Source models optimized for DocsGPT: +## Our Open-Source Models Optimized for DocsGPT: | Name | Base Model | Requirements (or similar) | | --------------------------------------------------------------------- | ----------- | ------------------------- | @@ -52,7 +49,7 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize ![Main features of DocsGPT showcasing six main features](https://user-images.githubusercontent.com/17906039/220427472-2644cff4-7666-46a5-819f-fc4a521f63c7.png) -## Useful links +## Useful Links - :mag: :fire: [Live preview](https://docsgpt.arc53.com/) @@ -66,7 +63,7 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize - :house: :closed_lock_with_key: [How to host it locally (so all data will stay on-premises)](https://docs.docsgpt.co.uk/Guides/How-to-use-different-LLM) -## Project structure +## Project Structure - Application - Flask app (main application). @@ -80,7 +77,7 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize Note: Make sure you have [Docker](https://docs.docker.com/engine/install/) installed -On macOS or Linux, write: +On Mac OS or Linux, write: `./setup.sh` @@ -104,9 +101,9 @@ Otherwise, refer to this Guide: To stop, just run `Ctrl + C`. -## Development environments +## Development Environments -### Spin up mongo and redis +### Spin up Mongo and Redis For development, only two containers are used from [docker-compose.yaml](https://github.com/arc53/DocsGPT/blob/main/docker-compose.yaml) (by deleting all services except for Redis and Mongo). See file [docker-compose-dev.yaml](./docker-compose-dev.yaml). @@ -118,7 +115,7 @@ docker compose -f docker-compose-dev.yaml build docker compose -f docker-compose-dev.yaml up -d ``` -### Run the backend +### Run the Backend Make sure you have Python 3.10 or 3.11 installed. @@ -130,7 +127,7 @@ Make sure you have Python 3.10 or 3.11 installed. 2. (optional) Create a Python virtual environment: You can follow the [Python official documentation](https://docs.python.org/3/tutorial/venv.html) for virtual environments. -a) On macOS and Linux +a) On Mac OS and Linux ```commandline python -m venv venv @@ -153,7 +150,7 @@ pip install -r requirements.txt 4. Run the app using `flask --app application/app.py run --host=0.0.0.0 --port=7091`. 5. Start worker with `celery -A application.app.celery worker -l INFO`. -### Start frontend +### Start Frontend Make sure you have Node version 16 or higher. From bb28cc5c65b8e69d5fb33770e4468e6525c71e1f Mon Sep 17 00:00:00 2001 From: ArpitPandey29 <149410125+ArpitPandey29@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:58:13 +0530 Subject: [PATCH 222/347] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6c48f0a5..58639d3d 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ We're eager to provide personalized assistance when deploying your DocsGPT to a - [Book Demo :wave:](https://airtable.com/appdeaL0F1qV8Bl2C/shrrJF1Ll7btCJRbP) - [Send Email :email:](mailto:contact@arc53.com?subject=DocsGPT%20support%2Fsolutions) +![video-example-of-docs-gpt](https://d3dg1063dc54p9.cloudfront.net/videos/demov3.gif) ## Roadmap From 2a1a3fb1b5a655b4818498111b8b953b027116d1 Mon Sep 17 00:00:00 2001 From: ArpitPandey29 <149410125+ArpitPandey29@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:59:46 +0530 Subject: [PATCH 223/347] Update chat_combine_prompt.txt --- application/prompts/chat_combine_prompt.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/prompts/chat_combine_prompt.txt b/application/prompts/chat_combine_prompt.txt index 194b8537..f36a31ad 100644 --- a/application/prompts/chat_combine_prompt.txt +++ b/application/prompts/chat_combine_prompt.txt @@ -1,9 +1,9 @@ You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible. -Use the following pieces of context to help answer the users question. If it's not relevant to the question, provide friendly responses. +Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses. You have access to chat history, and can use it to help answer the question. When using code examples, use the following format: ```(language) (code) ``` ---------------- -{summaries} \ No newline at end of file +{summaries} From 9f3c962ea4e1ac916bf6f08b0181bd9b8f5ccd90 Mon Sep 17 00:00:00 2001 From: ArpitPandey29 <149410125+ArpitPandey29@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:01:43 +0530 Subject: [PATCH 224/347] Update chat_combine_prompt.txt --- application/prompts/chat_combine_prompt.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/prompts/chat_combine_prompt.txt b/application/prompts/chat_combine_prompt.txt index f36a31ad..41da7ffa 100644 --- a/application/prompts/chat_combine_prompt.txt +++ b/application/prompts/chat_combine_prompt.txt @@ -5,5 +5,5 @@ When using code examples, use the following format: ```(language) (code) ``` ----------------- +--------------- {summaries} From 3e983b121e8a2dff5ed514ee9dcc67b4564bb201 Mon Sep 17 00:00:00 2001 From: ArpitPandey29 <149410125+ArpitPandey29@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:02:03 +0530 Subject: [PATCH 225/347] Update chat_combine_prompt.txt --- application/prompts/chat_combine_prompt.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/prompts/chat_combine_prompt.txt b/application/prompts/chat_combine_prompt.txt index 41da7ffa..f36a31ad 100644 --- a/application/prompts/chat_combine_prompt.txt +++ b/application/prompts/chat_combine_prompt.txt @@ -5,5 +5,5 @@ When using code examples, use the following format: ```(language) (code) ``` ---------------- +---------------- {summaries} From 4c70e922936b16454826ac38f10d75746ba21e32 Mon Sep 17 00:00:00 2001 From: ArpitPandey29 <149410125+ArpitPandey29@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:03:50 +0530 Subject: [PATCH 226/347] Update chat_reduce_prompt.txt --- application/prompts/chat_reduce_prompt.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/prompts/chat_reduce_prompt.txt b/application/prompts/chat_reduce_prompt.txt index b4525c2d..209dfd0f 100644 --- a/application/prompts/chat_reduce_prompt.txt +++ b/application/prompts/chat_reduce_prompt.txt @@ -1,3 +1,3 @@ -Use the following pieces of context to help answer the users question. If it's not relevant to the question, respond with "-" +Use the following pieces of context to help answer the users question. If its not relevant to the question, respond with "-" ---------------- -{context} \ No newline at end of file +{context} From 8e553e7a93da42fefdf4dba0eefb39a09b232849 Mon Sep 17 00:00:00 2001 From: ArpitPandey29 <149410125+ArpitPandey29@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:04:30 +0530 Subject: [PATCH 227/347] Update combine_prompt.txt --- application/prompts/combine_prompt.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/prompts/combine_prompt.txt b/application/prompts/combine_prompt.txt index c9ce63de..fcbd5c90 100644 --- a/application/prompts/combine_prompt.txt +++ b/application/prompts/combine_prompt.txt @@ -2,7 +2,7 @@ You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help QUESTION: How to merge tables in pandas? ========= -Content: pandas provides various facilities for easily combining Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. +Content: pandas provides various facilities for easily combining together Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. Source: 28-pl Content: pandas provides a single function, merge(), as the entry point for all standard database join operations between DataFrame or named Series objects: \n\npandas.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes=('_x', '_y'), copy=True, indicator=False, validate=None) Source: 30-pl @@ -22,4 +22,4 @@ QUESTION: {{ question }} ========= {{ summaries }} ========= -FINAL ANSWER: \ No newline at end of file +FINAL ANSWER: From 51ad3fdb0b663941c6a7d15bcae7fa9018e4a658 Mon Sep 17 00:00:00 2001 From: ArpitPandey29 <149410125+ArpitPandey29@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:04:53 +0530 Subject: [PATCH 228/347] Update combine_prompt.txt From df9723a011e30edfcbae57417769e3aa307359d7 Mon Sep 17 00:00:00 2001 From: ArpitPandey29 <149410125+ArpitPandey29@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:06:54 +0530 Subject: [PATCH 229/347] Update combine_prompt.txt --- application/prompts/combine_prompt.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/prompts/combine_prompt.txt b/application/prompts/combine_prompt.txt index fcbd5c90..1c214735 100644 --- a/application/prompts/combine_prompt.txt +++ b/application/prompts/combine_prompt.txt @@ -22,4 +22,4 @@ QUESTION: {{ question }} ========= {{ summaries }} ========= -FINAL ANSWER: +FINAL ANSWER: From eb768f20765a3f85c8a91b2cf0d20bf4da435231 Mon Sep 17 00:00:00 2001 From: ArpitPandey29 <149410125+ArpitPandey29@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:07:25 +0530 Subject: [PATCH 230/347] Update combine_prompt.txt --- application/prompts/combine_prompt.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/prompts/combine_prompt.txt b/application/prompts/combine_prompt.txt index 1c214735..fcbd5c90 100644 --- a/application/prompts/combine_prompt.txt +++ b/application/prompts/combine_prompt.txt @@ -22,4 +22,4 @@ QUESTION: {{ question }} ========= {{ summaries }} ========= -FINAL ANSWER: +FINAL ANSWER: From e4973f572ff3664ef554696626e7dc2f250cbffb Mon Sep 17 00:00:00 2001 From: ArpitPandey29 <149410125+ArpitPandey29@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:08:36 +0530 Subject: [PATCH 231/347] Update combine_prompt_hist.txt --- application/prompts/combine_prompt_hist.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/prompts/combine_prompt_hist.txt b/application/prompts/combine_prompt_hist.txt index 0d072902..2f4317b6 100644 --- a/application/prompts/combine_prompt_hist.txt +++ b/application/prompts/combine_prompt_hist.txt @@ -2,7 +2,7 @@ You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help QUESTION: How to merge tables in pandas? ========= -Content: pandas provides various facilities for easily combining Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. +Content: pandas provides various facilities for easily combining together Series or DataFrame with various kinds of set logic for the indexes and relational algebra functionality in the case of join / merge-type operations. Source: 28-pl Content: pandas provides a single function, merge(), as the entry point for all standard database join operations between DataFrame or named Series objects: \n\npandas.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes=('_x', '_y'), copy=True, indicator=False, validate=None) Source: 30-pl @@ -30,4 +30,4 @@ QUESTION: {{ question }} ========= {{ summaries }} ========= -FINAL ANSWER: \ No newline at end of file +FINAL ANSWER: From 7f6fef137349255d6756e0891ceff755df6251ac Mon Sep 17 00:00:00 2001 From: arpitpandey0209 Date: Wed, 1 Nov 2023 10:11:40 +0530 Subject: [PATCH 232/347] Revert txt files --- application/prompts/chat_combine_prompt.txt | 2 +- application/prompts/chat_reduce_prompt.txt | 2 +- application/prompts/combine_prompt.txt | 2 +- application/prompts/combine_prompt_hist.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/prompts/chat_combine_prompt.txt b/application/prompts/chat_combine_prompt.txt index f36a31ad..2f9a61c9 100644 --- a/application/prompts/chat_combine_prompt.txt +++ b/application/prompts/chat_combine_prompt.txt @@ -6,4 +6,4 @@ When using code examples, use the following format: (code) ``` ---------------- -{summaries} +{summaries} \ No newline at end of file diff --git a/application/prompts/chat_reduce_prompt.txt b/application/prompts/chat_reduce_prompt.txt index 209dfd0f..a5842d87 100644 --- a/application/prompts/chat_reduce_prompt.txt +++ b/application/prompts/chat_reduce_prompt.txt @@ -1,3 +1,3 @@ Use the following pieces of context to help answer the users question. If its not relevant to the question, respond with "-" ---------------- -{context} +{context} \ No newline at end of file diff --git a/application/prompts/combine_prompt.txt b/application/prompts/combine_prompt.txt index fcbd5c90..a008da32 100644 --- a/application/prompts/combine_prompt.txt +++ b/application/prompts/combine_prompt.txt @@ -22,4 +22,4 @@ QUESTION: {{ question }} ========= {{ summaries }} ========= -FINAL ANSWER: +FINAL ANSWER: \ No newline at end of file diff --git a/application/prompts/combine_prompt_hist.txt b/application/prompts/combine_prompt_hist.txt index 2f4317b6..509a4a0f 100644 --- a/application/prompts/combine_prompt_hist.txt +++ b/application/prompts/combine_prompt_hist.txt @@ -30,4 +30,4 @@ QUESTION: {{ question }} ========= {{ summaries }} ========= -FINAL ANSWER: +FINAL ANSWER: \ No newline at end of file From 9f7c9180d9253e7574bb245bec4baaad2c5d44fb Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 1 Nov 2023 21:45:40 +0000 Subject: [PATCH 233/347] prep settings slightly --- frontend/src/Navigation.tsx | 22 ++++++---------------- frontend/src/Setting.tsx | 10 +++++----- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index f81d5eac..063e9cae 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -11,7 +11,6 @@ import Github from './assets/github.svg'; import Hamburger from './assets/hamburger.svg'; import Info from './assets/info.svg'; import SettingGear from './assets/settingGear.svg'; -import Key from './assets/key.svg'; import Add from './assets/add.svg'; import UploadIcon from './assets/upload.svg'; import { ActiveState } from './models/misc'; @@ -229,7 +228,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { className={({ isActive }) => `${ isActive ? 'bg-gray-3000' : '' - } group my-auto mx-4 mt-4 flex cursor-pointer gap-2.5 rounded-3xl border border-silver p-3 hover:border-rainy-gray hover:bg-gray-3000` + } group mx-4 mt-4 flex cursor-pointer gap-2.5 rounded-3xl border border-silver p-3 hover:border-rainy-gray hover:bg-gray-3000` } > +

Chats

{conversations && ( -
-

Chats

+
{conversations?.map((conversation) => (

Source Docs

-
-
{ - setApiKeyModalState('ACTIVE'); - }} - > - key -

Reset Key

-
-
-

Settings

+
+ +
diff --git a/frontend/src/Setting.tsx b/frontend/src/Setting.tsx index 91071518..05555cb9 100644 --- a/frontend/src/Setting.tsx +++ b/frontend/src/Setting.tsx @@ -74,9 +74,9 @@ const Setting = () => { const General = () => { const [theme, setTheme] = useState('Light'); const [isThemeListOpen, setIsThemeListOpen] = useState(false); - const themes = ['Light', 'Dark']; + const themes = ['Light', 'Dark (WIP)']; const [language, setLanguage] = useState('English'); - const languages = ['English', 'French']; + const languages = ['English']; const [isLanguageListOpen, setIsLanguageListOpen] = useState(false); return ( <> @@ -165,12 +165,12 @@ const General = () => { ); }; const Prompts = () => { - return
This is prompts
; + return
This is prompts WIP
; }; const Documents = () => { - return
This is Documents
; + return
This is Documents WIP
; }; const Widgets = () => { - return
This is widgets
; + return
This is widgets WIP
; }; export default Setting; From 2d202088c769f56721090f12039dd59c319f44e8 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 1 Nov 2023 21:48:52 +0000 Subject: [PATCH 234/347] syntax --- frontend/src/conversation/Conversation.tsx | 2 +- frontend/src/index.css | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 34b146a7..fcef2400 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -192,7 +192,7 @@ export default function Conversation() {
)}
-

+

This is a chatbot that uses the GPT-3, Faiss and LangChain to answer questions.

diff --git a/frontend/src/index.css b/frontend/src/index.css index 4d881fe0..244d7870 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -367,7 +367,7 @@ template { /* third container laylout for Firefox */ @-moz-document url-prefix() { - .firefox{ + .firefox { padding: 32px; } } @@ -377,4 +377,4 @@ template { .firefox { padding: 16px; } -} \ No newline at end of file +} From c9dd219565f8b8e74f0ec4d675f1d7815901566b Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 2 Nov 2023 11:11:58 +0000 Subject: [PATCH 235/347] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5cfd1206..5200794b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,8 +2,6 @@ Thank you for choosing to contribute to DocsGPT! We are all very grateful! -### [πŸŽ‰ Join the Hacktoberfest with DocsGPT and Earn a Free T-shirt! πŸŽ‰](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md) - # We accept different types of contributions πŸ“£ **Discussions** - Engage in conversations, start new topics, or help answer questions. From ae5e484506d6169cefcdf17d9690c4bb0b24ba47 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 2 Nov 2023 18:25:43 +0000 Subject: [PATCH 236/347] fix docx file --- application/api/user/routes.py | 4 +++- application/requirements.txt | 1 + frontend/src/Navigation.tsx | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/application/api/user/routes.py b/application/api/user/routes.py index b80562b2..e62f52fb 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -153,7 +153,9 @@ def upload_file(): os.makedirs(save_dir) file.save(os.path.join(save_dir, filename)) - task = ingest.delay(settings.UPLOAD_FOLDER, [".rst", ".md", ".pdf", ".txt"], job_name, filename, user) + task = ingest.delay(settings.UPLOAD_FOLDER, [".rst", ".md", ".pdf", ".txt", ".docx", + ".csv", ".epub", ".html", ".mdx"], + job_name, filename, user) # task id task_id = task.id return {"status": "ok", "task_id": task_id} diff --git a/application/requirements.txt b/application/requirements.txt index b6f5f8d0..5b4db647 100644 --- a/application/requirements.txt +++ b/application/requirements.txt @@ -20,6 +20,7 @@ click-repl==0.2.0 cryptography==41.0.4 dataclasses-json==0.5.7 decorator==5.1.1 +docx2txt==0.8 dill==0.3.6 dnspython==2.3.0 ecdsa==0.18.0 diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 063e9cae..87bab842 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -280,7 +280,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { onClick={() => setUploadModalState('ACTIVE')} > {isDocsListOpen && ( -
+
{docs ? ( docs.map((doc, index) => { if (doc.model === embeddingsName) { From 1e7741e341b4c79b7c85a81635143c78118bbf89 Mon Sep 17 00:00:00 2001 From: Alexander Deshkevich Date: Thu, 2 Nov 2023 18:51:15 -0300 Subject: [PATCH 237/347] Render tables in conversation --- frontend/package-lock.json | 314 +++++++++++++++++- frontend/package.json | 3 +- .../src/conversation/ConversationBubble.tsx | 31 ++ 3 files changed, 346 insertions(+), 2 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 4a67cc0c..419a1f10 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -17,7 +17,8 @@ "react-markdown": "^8.0.7", "react-redux": "^8.0.5", "react-router-dom": "^6.8.1", - "react-syntax-highlighter": "^15.5.0" + "react-syntax-highlighter": "^15.5.0", + "remark-gfm": "^3.0.0" }, "devDependencies": { "@types/react": "^18.0.27", @@ -2077,6 +2078,15 @@ } ] }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -4740,6 +4750,15 @@ "node": ">=8" } }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -4785,6 +4804,15 @@ "node": ">=12" } }, + "node_modules/markdown-table": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", + "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/mdast-util-definitions": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz", @@ -4799,6 +4827,32 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-find-and-replace": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz", + "integrity": "sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==", + "dependencies": { + "@types/mdast": "^3.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mdast-util-from-markdown": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.0.tgz", @@ -4822,6 +4876,107 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-gfm": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-2.0.2.tgz", + "integrity": "sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg==", + "dependencies": { + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-gfm-autolink-literal": "^1.0.0", + "mdast-util-gfm-footnote": "^1.0.0", + "mdast-util-gfm-strikethrough": "^1.0.0", + "mdast-util-gfm-table": "^1.0.0", + "mdast-util-gfm-task-list-item": "^1.0.0", + "mdast-util-to-markdown": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-autolink-literal": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.3.tgz", + "integrity": "sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==", + "dependencies": { + "@types/mdast": "^3.0.0", + "ccount": "^2.0.0", + "mdast-util-find-and-replace": "^2.0.0", + "micromark-util-character": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-footnote": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.2.tgz", + "integrity": "sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ==", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-to-markdown": "^1.3.0", + "micromark-util-normalize-identifier": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.3.tgz", + "integrity": "sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ==", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-to-markdown": "^1.3.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.7.tgz", + "integrity": "sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==", + "dependencies": { + "@types/mdast": "^3.0.0", + "markdown-table": "^3.0.0", + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-to-markdown": "^1.3.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.2.tgz", + "integrity": "sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ==", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-to-markdown": "^1.3.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-phrasing": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-3.0.1.tgz", + "integrity": "sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==", + "dependencies": { + "@types/mdast": "^3.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-to-hast": { "version": "12.3.0", "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.3.0.tgz", @@ -4841,6 +4996,25 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-to-markdown": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.5.0.tgz", + "integrity": "sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==", + "dependencies": { + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^3.0.0", + "mdast-util-to-string": "^3.0.0", + "micromark-util-decode-string": "^1.0.0", + "unist-util-visit": "^4.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-to-string": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", @@ -4935,6 +5109,120 @@ "uvu": "^0.5.0" } }, + "node_modules/micromark-extension-gfm": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-2.0.3.tgz", + "integrity": "sha512-vb9OoHqrhCmbRidQv/2+Bc6pkP0FrtlhurxZofvOEy5o8RtuuvTq+RQ1Vw5ZDNrVraQZu3HixESqbG+0iKk/MQ==", + "dependencies": { + "micromark-extension-gfm-autolink-literal": "^1.0.0", + "micromark-extension-gfm-footnote": "^1.0.0", + "micromark-extension-gfm-strikethrough": "^1.0.0", + "micromark-extension-gfm-table": "^1.0.0", + "micromark-extension-gfm-tagfilter": "^1.0.0", + "micromark-extension-gfm-task-list-item": "^1.0.0", + "micromark-util-combine-extensions": "^1.0.0", + "micromark-util-types": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-autolink-literal": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-1.0.5.tgz", + "integrity": "sha512-z3wJSLrDf8kRDOh2qBtoTRD53vJ+CWIyo7uyZuxf/JAbNJjiHsOpG1y5wxk8drtv3ETAHutCu6N3thkOOgueWg==", + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-sanitize-uri": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-footnote": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.1.2.tgz", + "integrity": "sha512-Yxn7z7SxgyGWRNa4wzf8AhYYWNrwl5q1Z8ii+CSTTIqVkmGZF1CElX2JI8g5yGoM3GAman9/PVCUFUSJ0kB/8Q==", + "dependencies": { + "micromark-core-commonmark": "^1.0.0", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-sanitize-uri": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-strikethrough": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.7.tgz", + "integrity": "sha512-sX0FawVE1o3abGk3vRjOH50L5TTLr3b5XMqnP9YDRb34M0v5OoZhG+OHFz1OffZ9dlwgpTBKaT4XW/AsUVnSDw==", + "dependencies": { + "micromark-util-chunked": "^1.0.0", + "micromark-util-classify-character": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-table": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.7.tgz", + "integrity": "sha512-3ZORTHtcSnMQEKtAOsBQ9/oHp9096pI/UvdPtN7ehKvrmZZ2+bbWhi0ln+I9drmwXMt5boocn6OlwQzNXeVeqw==", + "dependencies": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-tagfilter": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.2.tgz", + "integrity": "sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==", + "dependencies": { + "micromark-util-types": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-task-list-item": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.5.tgz", + "integrity": "sha512-RMFXl2uQ0pNQy6Lun2YBYT9g9INXtWJULgbt01D/x8/6yJ2qpKyzdZD3pi6UIkzF++Da49xAelVKUeUMqd5eIQ==", + "dependencies": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/micromark-factory-destination": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.0.0.tgz", @@ -6353,6 +6641,21 @@ "url": "https://github.com/sponsors/mysticatea" } }, + "node_modules/remark-gfm": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-3.0.1.tgz", + "integrity": "sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-gfm": "^2.0.0", + "micromark-extension-gfm": "^2.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-parse": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.1.tgz", @@ -7489,6 +7792,15 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } } } } diff --git a/frontend/package.json b/frontend/package.json index 0d9c3fd4..bb7b6db5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -28,7 +28,8 @@ "react-markdown": "^8.0.7", "react-redux": "^8.0.5", "react-router-dom": "^6.8.1", - "react-syntax-highlighter": "^15.5.0" + "react-syntax-highlighter": "^15.5.0", + "remark-gfm": "^3.0.0" }, "devDependencies": { "@types/react": "^18.0.27", diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 8dca54af..9289567e 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -1,5 +1,6 @@ import { forwardRef, useState } from 'react'; import Avatar from '../components/Avatar'; +import remarkGfm from 'remark-gfm'; import { FEEDBACK, MESSAGE_TYPE } from './conversationModels'; import classes from './ConversationBubble.module.css'; import Alert from './../assets/alert.svg'; @@ -89,6 +90,7 @@ const ConversationBubble = forwardRef< )} ); }, + table({ children }) { + return ( +
+ + {children} +
+
+ ); + }, + thead({ children }) { + return ( + + {children} + + ); + }, + tr({ children }) { + return ( + + {children} + + ); + }, + td({ children }) { + return {children}; + }, + th({ children }) { + return {children}; + }, }} > {message} From 87a59a6de3851af96931cd14c02ca5990b50e4d3 Mon Sep 17 00:00:00 2001 From: Saksham Tyagi Date: Fri, 3 Nov 2023 13:06:18 +0530 Subject: [PATCH 238/347] =?UTF-8?q?=E2=9C=A8=20Prompt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/Setting.tsx | 433 ++++++++++++++++++++++++++------------- 1 file changed, 287 insertions(+), 146 deletions(-) diff --git a/frontend/src/Setting.tsx b/frontend/src/Setting.tsx index 05555cb9..3bc45be7 100644 --- a/frontend/src/Setting.tsx +++ b/frontend/src/Setting.tsx @@ -1,176 +1,317 @@ -import React, { useState, useRef } from 'react'; +import React, { useState } from 'react'; import Arrow2 from './assets/dropdown-arrow.svg'; import ArrowLeft from './assets/arrow-left.svg'; import ArrowRight from './assets/arrow-right.svg'; -const Setting = () => { - const list = ['General', 'Prompts', 'Documents', 'Widgets']; - const [active, setActive] = useState('General'); - const returnActiveTabs = (): JSX.Element => { - if (active === 'General') return ; - else if (active === 'Prompts') return ; - else if (active === 'Documents') return ; - else if (active === 'Widgets') return ; - else return <>; - }; - const scrollableRef = useRef(null); - const scrollStep = 100; - const scrollLeft = () => { - if (scrollableRef.current) { - if (scrollableRef.current.scrollLeft > 0) { - scrollableRef.current.scrollLeft -= scrollStep; // Adjust the scroll amount as needed - } - } +type PromptProps = { + prompts: string[]; + selectedPrompt: string; + onSelectPrompt: (prompt: string) => void; + onAddPrompt: (name: string) => void; + newPromptName: string; + onNewPromptNameChange: (name: string) => void; + isAddPromptModalOpen: boolean; + onToggleAddPromptModal: () => void; + onDeletePrompt: (name: string) => void; +}; + +const Setting: React.FC = () => { + const tabs = ['General', 'Prompts', 'Documents', 'Widgets']; + const [activeTab, setActiveTab] = useState('General'); + const [prompts, setPrompts] = useState(['Prompt 1', 'Prompt 2']); + const [selectedPrompt, setSelectedPrompt] = useState(''); + const [newPromptName, setNewPromptName] = useState(''); + const [isAddPromptModalOpen, setAddPromptModalOpen] = useState(false); + const onDeletePrompt = (name: string) => { + setPrompts(prompts.filter((prompt) => prompt !== name)); + setSelectedPrompt(''); // Clear the selected prompt }; - const scrollRight = () => { - if (scrollableRef.current) { - scrollableRef.current.scrollLeft += scrollStep; // Adjust the scroll amount as needed - } - }; return ( -
+

Settings

-
-
-
- -
+
+
+
-
- {list.map((item, index) => ( -
+ {tabs.map((tab, index) => ( +
+ {tab} + ))}
-
-
- -
+
+
- {returnActiveTabs()} + {renderActiveTab()} +
+ ); + + function scrollTabs(direction: number) { + const container = document.querySelector('.flex-nowrap'); + if (container) { + container.scrollLeft += direction * 100; // Adjust the scroll amount as needed + } + } + + function renderActiveTab() { + switch (activeTab) { + case 'General': + return ; + case 'Prompts': + return ( + + ); + case 'Documents': + return ; + case 'Widgets': + return ; + default: + return null; + } + } + + function addPrompt(name: string) { + if (name) { + setPrompts([...prompts, name]); + setNewPromptName(''); + toggleAddPromptModal(); + } + } + + function toggleAddPromptModal() { + setAddPromptModalOpen(!isAddPromptModalOpen); + } +}; + +const General: React.FC = () => { + const themes = ['Light', 'Dark']; + const languages = ['English', 'French', 'Hindi']; + const [selectedTheme, setSelectedTheme] = useState(themes[0]); + const [selectedLanguage, setSelectedLanguage] = useState(languages[0]); + + return ( +
+
+

Select Theme

+ +
+
+

Select Language

+ +
); }; -const General = () => { - const [theme, setTheme] = useState('Light'); - const [isThemeListOpen, setIsThemeListOpen] = useState(false); - const themes = ['Light', 'Dark (WIP)']; - const [language, setLanguage] = useState('English'); - const languages = ['English']; - const [isLanguageListOpen, setIsLanguageListOpen] = useState(false); +export default Setting; + +const Prompts: React.FC = ({ + prompts, + selectedPrompt, + onSelectPrompt, + onAddPrompt, + onDeletePrompt, +}) => { + const [isAddPromptModalOpen, setAddPromptModalOpen] = useState(false); + const [newPromptName, setNewPromptName] = useState(''); + + const openAddPromptModal = () => { + setAddPromptModalOpen(true); + }; + + const closeAddPromptModal = () => { + setAddPromptModalOpen(false); + }; + + const handleDeletePrompt = () => { + if (selectedPrompt) { + onDeletePrompt(selectedPrompt); // Remove the selected prompt + } + }; + return ( - <> -
-

Select Theme

-
-
setIsThemeListOpen(!isThemeListOpen)} - > - {theme && ( -

{theme}

- )} - arrow -
- {isThemeListOpen && ( -
- {themes.map((item, index) => ( -
{ - setTheme(item); - setIsThemeListOpen(false); - }} - className="flex h-10 w-full cursor-pointer items-center justify-between border-x-2 border-b-2 hover:bg-gray-100" - > -

- {item} -

-
- ))} -
- )} -
+
+
+

Select Prompt

+
-
-

Select Language

-
-
setIsLanguageListOpen(!isLanguageListOpen)} - > - {language && ( -

- {language} -

- )} - arrow -
- {isLanguageListOpen && ( -
- {languages.map((item, index) => ( -
{ - setLanguage(item); - setIsLanguageListOpen(false); - }} - className="flex h-10 w-full cursor-pointer items-center justify-between border-x-2 border-b-2 hover:bg-gray-100" - > -

- {item} -

-
- ))} -
- )} -
+
+
- + {isAddPromptModalOpen && ( + { + onAddPrompt(newPromptName); + closeAddPromptModal(); + }} + onClose={closeAddPromptModal} + /> + )} +
+ +
+
); }; -const Prompts = () => { - return
This is prompts WIP
; + +function Dropdown({ + options, + selectedValue, + onSelect, +}: { + options: string[]; + selectedValue: string; + onSelect: (value: string) => void; +}) { + const [isOpen, setIsOpen] = useState(false); + + return ( +
+ + {isOpen && ( +
+ {options.map((option, index) => ( +
{ + onSelect(option); + setIsOpen(false); + }} + className="flex cursor-pointer items-center justify-between border-b-2 py-3 hover:bg-gray-100" + > + + {option} + +
+ ))} +
+ )} +
+ ); +} + +type AddPromptModalProps = { + newPromptName: string; + onNewPromptNameChange: (name: string) => void; + onAddPrompt: () => void; + onClose: () => void; }; -const Documents = () => { - return
This is Documents WIP
; + +const AddPromptModal: React.FC = ({ + newPromptName, + onNewPromptNameChange, + onAddPrompt, + onClose, +}) => { + return ( +
+
+

Add New Prompt

+ onNewPromptNameChange(e.target.value)} + className="mb-4 w-full rounded-lg border-2 p-2" + /> + + +
+
+ ); }; -const Widgets = () => { - return
This is widgets WIP
; + +const Documents: React.FC = () => { + return ( +
+

This is the Documents section.

+
+ ); +}; + +const Widgets: React.FC = () => { + return
This is widgets
; }; -export default Setting; From 06eef5779d5a042855f80a87dc33b89183e55491 Mon Sep 17 00:00:00 2001 From: Saksham Tyagi Date: Fri, 3 Nov 2023 22:52:16 +0530 Subject: [PATCH 239/347] =?UTF-8?q?=E2=9C=A8=20Documents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/Setting.tsx | 198 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 192 insertions(+), 6 deletions(-) diff --git a/frontend/src/Setting.tsx b/frontend/src/Setting.tsx index 3bc45be7..a52bde02 100644 --- a/frontend/src/Setting.tsx +++ b/frontend/src/Setting.tsx @@ -22,11 +22,46 @@ const Setting: React.FC = () => { const [selectedPrompt, setSelectedPrompt] = useState(''); const [newPromptName, setNewPromptName] = useState(''); const [isAddPromptModalOpen, setAddPromptModalOpen] = useState(false); + const [documents, setDocuments] = useState([]); + const [isAddDocumentModalOpen, setAddDocumentModalOpen] = useState(false); + const [newDocument, setNewDocument] = useState({ + name: '', + vectorDate: '', + vectorLocation: '', + }); const onDeletePrompt = (name: string) => { setPrompts(prompts.filter((prompt) => prompt !== name)); setSelectedPrompt(''); // Clear the selected prompt }; + // Function to add a new document + const addDocument = () => { + if ( + newDocument.name && + newDocument.vectorDate && + newDocument.vectorLocation + ) { + setDocuments([...documents, newDocument]); + setNewDocument({ + name: '', + vectorDate: '', + vectorLocation: '', + }); + toggleAddDocumentModal(); + } + }; + + // Function to toggle the Add Document modal + const toggleAddDocumentModal = () => { + setAddDocumentModalOpen(!isAddDocumentModalOpen); + }; + + const handleDeleteDocument = (index: number) => { + const updatedDocuments = [...documents]; + updatedDocuments.splice(index, 1); + setDocuments(updatedDocuments); + }; + return (

Settings

@@ -64,6 +99,15 @@ const Setting: React.FC = () => {
{renderActiveTab()} + + {isAddDocumentModalOpen && ( + + )}
); @@ -97,7 +141,15 @@ const Setting: React.FC = () => { /> ); case 'Documents': - return ; + return ( + + ); case 'Widgets': return ; default: @@ -185,7 +237,7 @@ const Prompts: React.FC = ({
@@ -204,7 +256,7 @@ const Prompts: React.FC = ({
@@ -289,7 +341,7 @@ const AddPromptModal: React.FC = ({ /> @@ -304,10 +356,144 @@ const AddPromptModal: React.FC = ({ ); }; -const Documents: React.FC = () => { +type DocumentsProps = { + documents: Document[]; + isAddDocumentModalOpen: boolean; + newDocument: Document; + handleDeleteDocument: (index: number) => void; + toggleAddDocumentModal: () => void; +}; + +const Documents: React.FC = ({ + documents, + isAddDocumentModalOpen, + newDocument, + handleDeleteDocument, + toggleAddDocumentModal, +}) => { return (
-

This is the Documents section.

+
+ {/*

Documents

*/} + +
+ + + + + + + + + + + {documents.map((document, index) => ( + + + + + + + ))} + +
Document NameVector DateVector LocationActions
{document.name}{document.vectorDate} + {document.vectorLocation} + + +
+
+ +
+ + {/* {isAddDocumentModalOpen && ( + + )} */} +
+ ); +}; + +type Document = { + name: string; + vectorDate: string; + vectorLocation: string; +}; + +// Modal for adding a new document +type AddDocumentModalProps = { + newDocument: Document; + onNewDocumentChange: (document: Document) => void; + onAddDocument: () => void; + onClose: () => void; +}; + +const AddDocumentModal: React.FC = ({ + newDocument, + onNewDocumentChange, + onAddDocument, + onClose, +}) => { + return ( +
+
+

Add New Document

+ + onNewDocumentChange({ ...newDocument, name: e.target.value }) + } + className="mb-4 w-full rounded-lg border-2 p-2" + /> + + onNewDocumentChange({ ...newDocument, vectorDate: e.target.value }) + } + className="mb-4 w-full rounded-lg border-2 p-2" + /> + + onNewDocumentChange({ + ...newDocument, + vectorLocation: e.target.value, + }) + } + className="mb-4 w-full rounded-lg border-2 p-2" + /> + + +
); }; From 3d54a1abf375f94699b6ebd3eb9e8d66eefe59c9 Mon Sep 17 00:00:00 2001 From: Saksham Tyagi Date: Sat, 4 Nov 2023 02:33:56 +0530 Subject: [PATCH 240/347] =?UTF-8?q?=E2=9C=A8=20widget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/Setting.tsx | 125 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 122 insertions(+), 3 deletions(-) diff --git a/frontend/src/Setting.tsx b/frontend/src/Setting.tsx index a52bde02..f68df653 100644 --- a/frontend/src/Setting.tsx +++ b/frontend/src/Setting.tsx @@ -33,6 +33,11 @@ const Setting: React.FC = () => { setPrompts(prompts.filter((prompt) => prompt !== name)); setSelectedPrompt(''); // Clear the selected prompt }; + const [widgetScreenshot, setWidgetScreenshot] = useState(null); + + const updateWidgetScreenshot = (screenshot: File | null) => { + setWidgetScreenshot(screenshot); + }; // Function to add a new document const addDocument = () => { @@ -108,6 +113,13 @@ const Setting: React.FC = () => { onClose={toggleAddDocumentModal} /> )} + + {/* {activeTab === 'Widgets' && ( + + )} */}
); @@ -151,7 +163,12 @@ const Setting: React.FC = () => { /> ); case 'Widgets': - return ; + return ( + + ); default: return null; } @@ -498,6 +515,108 @@ const AddDocumentModal: React.FC = ({ ); }; -const Widgets: React.FC = () => { - return
This is widgets
; +const Widgets: React.FC<{ + widgetScreenshot: File | null; + onWidgetScreenshotChange: (screenshot: File | null) => void; +}> = ({ widgetScreenshot, onWidgetScreenshotChange }) => { + const widgetSources = ['Source 1', 'Source 2', 'Source 3']; + const widgetMethods = ['Method 1', 'Method 2', 'Method 3']; + const widgetTypes = ['Type 1', 'Type 2', 'Type 3']; + + const [selectedWidgetSource, setSelectedWidgetSource] = useState( + widgetSources[0], + ); + const [selectedWidgetMethod, setSelectedWidgetMethod] = useState( + widgetMethods[0], + ); + const [selectedWidgetType, setSelectedWidgetType] = useState(widgetTypes[0]); + + // const [widgetScreenshot, setWidgetScreenshot] = useState(null); + const [widgetCode, setWidgetCode] = useState(''); // Your widget code state + + const handleScreenshotChange = ( + event: React.ChangeEvent, + ) => { + const files = event.target.files; + + if (files && files.length > 0) { + const selectedScreenshot = files[0]; + onWidgetScreenshotChange(selectedScreenshot); // Update the screenshot in the parent component + } + }; + + const handleCopyToClipboard = () => { + // Create a new textarea element to select the text + const textArea = document.createElement('textarea'); + textArea.value = widgetCode; + document.body.appendChild(textArea); + + // Select and copy the text + textArea.select(); + document.execCommand('copy'); + + // Clean up the textarea element + document.body.removeChild(textArea); + }; + + return ( +
+
+

Widget Source

+ +
+
+

Widget Method

+ +
+
+

Widget Type

+ +
+
+

Widget Code Snippet

+