From 5bbf6d2ae9afa5744a89f2c1de8d9204c68c96e2 Mon Sep 17 00:00:00 2001 From: Digvijay Shelar <82649533+shelar1423@users.noreply.github.com> Date: Thu, 5 Oct 2023 20:38:02 +0530 Subject: [PATCH 001/151] Update README.md --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index aba1401f..b734af6c 100644 --- a/README.md +++ b/README.md @@ -56,17 +56,19 @@ If you don't have enough resources to run it you can use bitsnbytes to quantize ## Useful links - [Live preview](https://docsgpt.arc53.com/) - - [Join Our Discord](https://discord.gg/n5BX8dh8rU) - - [Guides](https://docs.docsgpt.co.uk/) + Audit [Live preview](https://docsgpt.arc53.com/) - [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) + Discord [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) +external-guide-lifestyles-flaticons-lineal-color-flat-icons [Guides](https://docs.docsgpt.co.uk/) + + +external-contribution-achievements-flaticons-lineal-color-flat-icons-2 [Interested in contributing?](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md) + +document--v1 [How to use any other documentation](https://docs.docsgpt.co.uk/Guides/How-to-train-on-other-documentation) + +virtual-machine2 [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 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 002/151] 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 425a8a641204fa636b7b3ee1236161a1316b8cf6 Mon Sep 17 00:00:00 2001 From: Shuvadipta Das Date: Fri, 6 Oct 2023 21:39:18 +0530 Subject: [PATCH 003/151] Update How-to-train-on-other-documentation.md --- docs/pages/Guides/How-to-train-on-other-documentation.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 c9549aed..0a39929f 100644 --- a/docs/pages/Guides/How-to-train-on-other-documentation.md +++ b/docs/pages/Guides/How-to-train-on-other-documentation.md @@ -12,9 +12,9 @@ It currently uses OPEN_AI to create vector store, so make sure your documentatio You can usually find documentation on github in `docs/` folder for most open-source projects. ### 1. Find documentation in .rst/.md 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 +- 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 and feed it. (don't forget to change the extension in script) @@ -56,4 +56,4 @@ You can learn more about options while running ingest.py by running: | | | | **convert** | Creates documentation in .md format from source code | | --dir TEXT | Path to a directory with source code. E.g. --dir inputs [default: inputs] | -| --formats TEXT | Source code language from which to create documentation. Supports py, js and java. E.g. --formats py [default: py] | \ No newline at end of file +| --formats TEXT | Source code language from which to create documentation. Supports py, js and java. E.g. --formats py [default: py] | From 35fef11d2a3d3766a18a0bb2a4d6416e3ead4ca2 Mon Sep 17 00:00:00 2001 From: Digvijay Shelar <82649533+shelar1423@users.noreply.github.com> Date: Fri, 6 Oct 2023 22:40:46 +0530 Subject: [PATCH 004/151] Update README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b734af6c..5c115b4d 100644 --- a/README.md +++ b/README.md @@ -56,19 +56,21 @@ If you don't have enough resources to run it you can use bitsnbytes to quantize ## Useful links - Audit [Live preview](https://docsgpt.arc53.com/) + Audit [Live preview](https://docsgpt.arc53.com/) Discord [Join Our Discord](https://discord.gg/n5BX8dh8rU) -external-guide-lifestyles-flaticons-lineal-color-flat-icons [Guides](https://docs.docsgpt.co.uk/) +external-guide-lifestyles-flaticons-lineal-color-flat-icons[Guides](https://docs.docsgpt.co.uk/) -external-contribution-achievements-flaticons-lineal-color-flat-icons-2 [Interested in contributing?](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md) +external-contribution-achievements-flaticons-lineal-color-flat-icons-2 [Interested in contributing?](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md) + +document--v1 [How to use any other documentation](https://docs.docsgpt.co.uk/Guides/How-to-train-on-other-documentation) + +virtual-machine2 [How to host it locally (so all data will stay on-premises)](https://docs.docsgpt.co.uk/Guides/How-to-use-different-LLM) -document--v1 [How to use any other documentation](https://docs.docsgpt.co.uk/Guides/How-to-train-on-other-documentation) -virtual-machine2 [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 From bdfcf6591e58b8a5984108c4877e58a4dcf1f609 Mon Sep 17 00:00:00 2001 From: Nick Rogers Date: Fri, 6 Oct 2023 21:20:40 -0700 Subject: [PATCH 005/151] Fix missing documentation for using Llama_cpp --- docs/pages/Guides/How-to-use-different-LLM.md | 6 +++++- 1 file changed, 5 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 aa5815f0..f9a2fecf 100644 --- a/docs/pages/Guides/How-to-use-different-LLM.md +++ b/docs/pages/Guides/How-to-use-different-LLM.md @@ -21,9 +21,13 @@ By default, we use OpenAI's models but if you want to change it or even run it l 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`. Options: -LLM_NAME (openai, manifest, cohere, Arc53/docsgpt-14b, Arc53/docsgpt-7b-falcon) +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) +If using Llama, set the `EMBEDDINGS_NAME` to `huggingface_sentence-transformers/all-mpnet-base-v2`. + +Alternatively, if you wish to run Llama locally, you can run `setup.sh` and choose option 1 when prompted. + That's it! ### Hosting everything locally and privately (for using our optimised open-source models) From 36528fceabed84fa8b8fea2fdbb241c120e3365a Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sat, 7 Oct 2023 12:20:47 +0530 Subject: [PATCH 006/151] add issue fixes --- frontend/src/Hero.tsx | 52 +++++++++++----------- frontend/src/conversation/Conversation.tsx | 2 +- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index df0ad280..0644da67 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -5,26 +5,28 @@ export default function Hero({ className = '' }: { className?: string }) {

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. + 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 -

-

+

+
+
+ 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 @@ -33,13 +35,11 @@ export default function Hero({ className = '' }: { className?: string }) {

-
-
- 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 @@ -47,17 +47,15 @@ export default function Hero({ className = '' }: { className?: string }) {

-
-
+
+
lock -

- Open Source Code -

-

+

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 diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index ab435768..e6b5d9cd 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -134,7 +134,7 @@ export default function Conversation() { return ( Date: Sat, 7 Oct 2023 14:15:17 +0530 Subject: [PATCH 007/151] Update HACKTOBERFEST.md Improved the HACKTOBERFEST.md file. Fixed and added 7 links. --- HACKTOBERFEST.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HACKTOBERFEST.md b/HACKTOBERFEST.md index 1a39e561..6265ddd3 100644 --- a/HACKTOBERFEST.md +++ b/HACKTOBERFEST.md @@ -17,14 +17,14 @@ Familiarize yourself with the current contributions and our [Roadmap](https://gi Deciding to contribute with code? Here are some insights based on the area of your interest: - Frontend (βš›οΈReact, Vite): - - Most of the code is located in `/frontend` folder. You can also check out our React extension in /extensions/react-widget. + - Most of the code is located in [/frontend](https://github.com/arc53/DocsGPT/tree/main/frontend) folder. You can also check out our React extension in [/extensions/react-widget](https://github.com/arc53/DocsGPT/tree/main/extensions/react-widget). - For design references, here's the [Figma](https://www.figma.com/file/OXLtrl1EAy885to6S69554/DocsGPT?node-id=0%3A1&t=hjWVuxRg9yi5YkJ9-1). - Ensure you adhere to the established guidelines. - Backend (🐍Python): - - Focus on `/application` or `/scripts`. However, avoid the files ingest_rst.py and ingest_rst_sphinx.py, as they will soon be deprecated. + - Focus on [/application](https://github.com/arc53/DocsGPT/tree/main/application) or [/scripts](https://github.com/arc53/DocsGPT/tree/main/scripts). However, avoid the files [ingest_rst.py](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst.py) and [ingest_rst_sphinx.py](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst_sphinx.py), as they will soon be deprecated. - Newly added code should come with relevant unit tests (pytest). - - Refer to the `/tests` folder for test suites. + - Refer to the [/tests](https://github.com/arc53/DocsGPT/tree/main/tests) folder for test suites. Check out our [Contributing Guidelines](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md) From a8317ccacd9e786ff83e1602aced045da352b90a Mon Sep 17 00:00:00 2001 From: Pratik Gupta <91310568+GuptaPratik02@users.noreply.github.com> Date: Sat, 7 Oct 2023 14:37:54 +0530 Subject: [PATCH 008/151] Update README.md Fixed and added the necessary links in README file --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index edeb7b66..16706df1 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 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.

@@ -89,15 +89,15 @@ 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 if 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,7 +105,7 @@ 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 @@ -119,7 +119,7 @@ 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.) @@ -139,7 +139,7 @@ pip install -r application/requirements.txt Make sure you have Node version 16 or higher. -1. Navigate to the `/frontend` folder. +1. Navigate to the [/frontend](https://github.com/arc53/DocsGPT/tree/main/frontend) folder. 2. Install dependencies by running `npm install`. 3. Run the app using `npm run dev`. From e034fc12ebb171905f5e3312968f38dcd7082297 Mon Sep 17 00:00:00 2001 From: Pratik Gupta <91310568+GuptaPratik02@users.noreply.github.com> Date: Sat, 7 Oct 2023 14:46:56 +0530 Subject: [PATCH 009/151] Update CONTRIBUTING.md Fixed and added the necessary links in contributing file --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b759fd46..1e127f00 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,14 +25,14 @@ We have a frontend in React (Vite) and backend in Python. ### If you are looking to contribute to frontend (βš›οΈReact, Vite): -- The current frontend is being migrated from `/application` to `/frontend` with a new design, so please contribute to the new one. +- The current frontend is being migrated from [`/application`](https://github.com/arc53/DocsGPT/tree/main/application) to [`/frontend`](https://github.com/arc53/DocsGPT/tree/main/frontend) with a new design, so please contribute to the new one. - Check out this [milestone](https://github.com/arc53/DocsGPT/milestone/1) and its issues. - The Figma design can be found [here](https://www.figma.com/file/OXLtrl1EAy885to6S69554/DocsGPT?node-id=0%3A1&t=hjWVuxRg9yi5YkJ9-1). Please try to follow the guidelines. ### If you are looking to contribute to Backend (🐍 Python): -- Check out our issues and contribute to `/application` or `/scripts` (ignore old `ingest_rst.py` `ingest_rst_sphinx.py` files; they will be deprecated soon). +- Check out our issues and contribute to [`/application`](https://github.com/arc53/DocsGPT/tree/main/application) or [`/scripts`](https://github.com/arc53/DocsGPT/tree/main/scripts) (ignore old [`ingest_rst.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst.py) [`ingest_rst_sphinx.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst_sphinx.py) files; they will be deprecated soon). - All new code should be covered with unit tests ([pytest](https://github.com/pytest-dev/pytest)). Please find tests under [`/tests`](https://github.com/arc53/DocsGPT/tree/main/tests) folder. - Before submitting your PR, ensure it is queryable after ingesting some test data. From 66b5ac8ff1174605a7c1bf4bff58ab40085b7ccf Mon Sep 17 00:00:00 2001 From: Pratik Gupta <91310568+GuptaPratik02@users.noreply.github.com> Date: Sat, 7 Oct 2023 14:51:22 +0530 Subject: [PATCH 010/151] Update HACKTOBERFEST.md Improvements --- HACKTOBERFEST.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HACKTOBERFEST.md b/HACKTOBERFEST.md index 6265ddd3..b1646619 100644 --- a/HACKTOBERFEST.md +++ b/HACKTOBERFEST.md @@ -17,14 +17,14 @@ Familiarize yourself with the current contributions and our [Roadmap](https://gi Deciding to contribute with code? Here are some insights based on the area of your interest: - Frontend (βš›οΈReact, Vite): - - Most of the code is located in [/frontend](https://github.com/arc53/DocsGPT/tree/main/frontend) folder. You can also check out our React extension in [/extensions/react-widget](https://github.com/arc53/DocsGPT/tree/main/extensions/react-widget). + - Most of the code is located in [`/frontend`](https://github.com/arc53/DocsGPT/tree/main/frontend) folder. You can also check out our React extension in [`/extensions/react-widget`](https://github.com/arc53/DocsGPT/tree/main/extensions/react-widget). - For design references, here's the [Figma](https://www.figma.com/file/OXLtrl1EAy885to6S69554/DocsGPT?node-id=0%3A1&t=hjWVuxRg9yi5YkJ9-1). - Ensure you adhere to the established guidelines. - Backend (🐍Python): - - Focus on [/application](https://github.com/arc53/DocsGPT/tree/main/application) or [/scripts](https://github.com/arc53/DocsGPT/tree/main/scripts). However, avoid the files [ingest_rst.py](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst.py) and [ingest_rst_sphinx.py](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst_sphinx.py), as they will soon be deprecated. + - Focus on [`/application`](https://github.com/arc53/DocsGPT/tree/main/application) or [`/scripts`](https://github.com/arc53/DocsGPT/tree/main/scripts). However, avoid the files [`ingest_rst.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst.py) and [`ingest_rst_sphinx.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst_sphinx.py), as they will soon be deprecated. - Newly added code should come with relevant unit tests (pytest). - - Refer to the [/tests](https://github.com/arc53/DocsGPT/tree/main/tests) folder for test suites. + - Refer to the [`/tests`](https://github.com/arc53/DocsGPT/tree/main/tests) folder for test suites. Check out our [Contributing Guidelines](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md) From a17390c157a643e99dc9c53f5234becfaecfb32c Mon Sep 17 00:00:00 2001 From: Harsh Mahajan <127186841+HarshMN2345@users.noreply.github.com> Date: Sat, 7 Oct 2023 21:37:58 +0530 Subject: [PATCH 011/151] Update CONTRIBUTING.md i made it easy to understand --- CONTRIBUTING.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b759fd46..d8e35596 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,27 +1,27 @@ # Welcome to DocsGPT Contributing Guidelines -Thank you for choosing this project to contribute to. We are all very grateful! +Thank you for choosing to contribute to our project! We greatly appreciate your help! ### [πŸŽ‰ 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 - where you can start a new topic or answer some questions +πŸ“£ Discussions - Engage in conversations, start new topics, or help answer questions. -🐞 Issues - This is how we track tasks, sometimes it is bugs that need fixing, and sometimes it is new features +🐞 Issues - This is where we keep track of tasks. It could be bug fixes or suggestions for new features. -πŸ› οΈ Pull requests - This is how you can suggest changes to our repository, to work on existing issues or add new features +πŸ› οΈ Pull requests - Suggest changes to our repository, either by working on existing issues or adding new features. -πŸ“š Wiki - where we have our documentation +πŸ“š Wiki - This is where our documentation resides. ## 🐞 Issues and Pull requests -We value contributions to our issues in the form of discussion or suggestions. We recommend that you check out existing issues and our [roadmap](https://github.com/orgs/arc53/projects/2). +We highly 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 want to contribute by writing code, there are a few things that you should know before doing it: +If you're interested in contributing code, here are some important things to know: -We have a frontend in React (Vite) and backend in Python. +We have a frontend built with React (Vite) and a backend in Python. ### If you are looking to contribute to frontend (βš›οΈReact, Vite): @@ -32,10 +32,10 @@ We have a frontend in React (Vite) and backend in Python. Please try to follow the guidelines. ### If you are looking to contribute to Backend (🐍 Python): -- Check out our issues and contribute to `/application` or `/scripts` (ignore old `ingest_rst.py` `ingest_rst_sphinx.py` files; they will be deprecated soon). +- Review our issues and contribute to /application or /scripts (please disregard old ingest_rst.py and ingest_rst_sphinx.py files; they will be phased out soon). - All new code should be covered with unit tests ([pytest](https://github.com/pytest-dev/pytest)). Please find tests under [`/tests`](https://github.com/arc53/DocsGPT/tree/main/tests) folder. -- Before submitting your PR, ensure it is queryable after ingesting some test data. - +- Before submitting your Pull Request, ensure it can be queried after ingesting some test data. + ### Testing To run unit tests from the root of the repository, execute: @@ -44,9 +44,8 @@ python -m pytest ``` ### Workflow: -Create a fork, make changes on your forked repository, and submit changes as a pull request. +Fork the repository, make your changes on your forked version, and then submit those changes as a pull request. ## Questions/collaboration -Please join our [Discord](https://discord.gg/n5BX8dh8rU). Don't hesitate; we are very friendly and welcoming to new contributors. - +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. # Thank you so much for considering contributing to DocsGPT!πŸ™ From accd65a26ab47114852fc295d5af6097e267e341 Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Sun, 8 Oct 2023 05:27:03 +0530 Subject: [PATCH 012/151] added the copy msg feature --- frontend/package-lock.json | 26 +++++++++++++++++++ frontend/package.json | 1 + frontend/src/assets/copy.svg | 3 +++ .../src/conversation/ConversationBubble.tsx | 7 +++++ 4 files changed, 37 insertions(+) create mode 100644 frontend/src/assets/copy.svg diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 8cf969d7..7c08dfb7 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -11,6 +11,7 @@ "@reduxjs/toolkit": "^1.9.2", "@vercel/analytics": "^0.1.10", "react": "^18.2.0", + "react-copy-to-clipboard": "^5.1.0", "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", "react-markdown": "^8.0.7", @@ -2248,6 +2249,14 @@ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, + "node_modules/copy-to-clipboard": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz", + "integrity": "sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==", + "dependencies": { + "toggle-selection": "^1.0.6" + } + }, "node_modules/cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", @@ -6072,6 +6081,18 @@ "node": ">=0.10.0" } }, + "node_modules/react-copy-to-clipboard": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/react-copy-to-clipboard/-/react-copy-to-clipboard-5.1.0.tgz", + "integrity": "sha512-k61RsNgAayIJNoy9yDsYzDe/yAZAzEbEgcz3DZMhF686LEyukcE1hzurxe85JandPUG+yTfGVFzuEw3xt8WP/A==", + "dependencies": { + "copy-to-clipboard": "^3.3.1", + "prop-types": "^15.8.1" + }, + "peerDependencies": { + "react": "^15.3.0 || 16 || 17 || 18" + } + }, "node_modules/react-dom": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", @@ -6907,6 +6928,11 @@ "node": ">=8.0" } }, + "node_modules/toggle-selection": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz", + "integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==" + }, "node_modules/trim-lines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index 66d14ddc..9dcbf4ae 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -22,6 +22,7 @@ "@reduxjs/toolkit": "^1.9.2", "@vercel/analytics": "^0.1.10", "react": "^18.2.0", + "react-copy-to-clipboard": "^5.1.0", "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", "react-markdown": "^8.0.7", diff --git a/frontend/src/assets/copy.svg b/frontend/src/assets/copy.svg new file mode 100644 index 00000000..d0da8857 --- /dev/null +++ b/frontend/src/assets/copy.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index b74c65fe..3f38ee9a 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -4,7 +4,9 @@ import { FEEDBACK, MESSAGE_TYPE } from './conversationModels'; 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 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'; @@ -145,6 +147,11 @@ const ConversationBubble = forwardRef< : 'md:invisible' }`} > + copy(message)} + > Date: Sun, 8 Oct 2023 05:33:13 +0530 Subject: [PATCH 013/151] fix --- frontend/src/About.tsx | 8 +++++--- frontend/src/conversation/ConversationBubble.tsx | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index 303708ca..2365536c 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -51,9 +51,11 @@ export default function About() {

- Currently It uses DocsGPT documentation, so it will respond to - information relevant to DocsGPT . If you want to train it on different - documentation - please follow + Currently It uses{' '} + DocsGPT{' '} + documentation, so it will respond to information relevant to{' '} + DocsGPT . If you + want to train it on different documentation - please follow copy(message)} > Date: Sun, 8 Oct 2023 06:26:08 +0530 Subject: [PATCH 014/151] UI checks --- frontend/.env.development | 2 +- frontend/src/conversation/ConversationBubble.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/.env.development b/frontend/.env.development index 2bb67110..7a87f762 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -1,3 +1,3 @@ # Please put appropriate value -VITE_API_HOST=http://localhost:7091 +VITE_API_HOST=http://0.0.0.0:7091 VITE_API_STREAMING=true \ No newline at end of file diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 2e881314..471970a8 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -148,7 +148,7 @@ const ConversationBubble = forwardRef< }`} > copy(message)} > Date: Sun, 8 Oct 2023 11:20:28 +0530 Subject: [PATCH 015/151] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4b2247bc..543bfb12 100644 --- a/README.md +++ b/README.md @@ -55,19 +55,19 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize ## Useful links + - πŸ”πŸ”₯ [Live preview](https://docsgpt.arc53.com/) + + - Discord [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) - Discord [Join Our Discord](https://discord.gg/n5BX8dh8rU) + - πŸ—‚οΈπŸš€ [How to use any other documentation](https://docs.docsgpt.co.uk/Guides/How-to-train-on-other-documentation) -external-guide-lifestyles-flaticons-lineal-color-flat-icons[Guides](https://docs.docsgpt.co.uk/) + - πŸ πŸ’ΎπŸ” [How to host it locally (so all data will stay on-premises)](https://docs.docsgpt.co.uk/Guides/How-to-use-different-LLM) -external-contribution-achievements-flaticons-lineal-color-flat-icons-2 [Interested in contributing?](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md) - -document--v1 [How to use any other documentation](https://docs.docsgpt.co.uk/Guides/How-to-train-on-other-documentation) - -virtual-machine2 [How to host it locally (so all data will stay on-premises)](https://docs.docsgpt.co.uk/Guides/How-to-use-different-LLM) - From a6783e537b3ee39ebbe98dd597f06d350a5737c2 Mon Sep 17 00:00:00 2001 From: Akshit Arora Date: Sun, 8 Oct 2023 14:17:26 +0530 Subject: [PATCH 016/151] fix css --- 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 303708ca..f5107991 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -4,7 +4,7 @@ export default function About() { return (

-
+

About DocsGPT

πŸ¦–

From a064066e42112eb4c10dabb77e920d4de45d154c Mon Sep 17 00:00:00 2001 From: Pratik Gupta <91310568+GuptaPratik02@users.noreply.github.com> Date: Sun, 8 Oct 2023 16:52:56 +0530 Subject: [PATCH 017/151] Update README.md Updated the DocsGPT link as mentioned by the maintainer. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 16706df1..898a57f2 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 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.

From fc50bb6e57893fd9ea712c049bb9e51e419930c6 Mon Sep 17 00:00:00 2001 From: "beKool.sh" <76424367+beKoool@users.noreply.github.com> Date: Sun, 8 Oct 2023 17:10:33 +0545 Subject: [PATCH 018/151] Add Backlink to Vector Stores --- docs/pages/Developing/API-docs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pages/Developing/API-docs.md b/docs/pages/Developing/API-docs.md index eabd29c0..99d98965 100644 --- a/docs/pages/Developing/API-docs.md +++ b/docs/pages/Developing/API-docs.md @@ -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 task is still running, where "current" will show progress from 0 to 100: ```json { "result": { @@ -114,7 +114,7 @@ There are two types of responses: } ``` -2. When task is completed +2. When task is completed: ```json { "result": { @@ -133,7 +133,7 @@ There are two types of responses: ``` ### /api/delete_old -Deletes old vectorstores: +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) fetch("http://localhost:5001/api/task_status?task_id=b2d2a0f4-387c-44fd-a443-e4fe2e7454d1", { From 2993bd8c0526c2a11d4829ebb9bfcda3ec353433 Mon Sep 17 00:00:00 2001 From: Sanket Pol <68698332+sanketmp@users.noreply.github.com> Date: Sun, 8 Oct 2023 17:02:44 +0530 Subject: [PATCH 019/151] add license link to readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fa6a7af..902b32ac 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,6 @@ We as members, contributors, and leaders, pledge to make participation in our co ## License -The source code license is MIT, as described in the LICENSE file. +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 396697ead2f0ae12bf080d468453e9a43d7bb250 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sun, 8 Oct 2023 17:36:57 +0530 Subject: [PATCH 020/151] Query overlay text input issues --- frontend/src/conversation/Conversation.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index e6b5d9cd..d50ed854 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -81,7 +81,7 @@ export default function Conversation() { responseView = ( )} -
+
{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); @@ -170,10 +170,10 @@ export default function Conversation() { {status === 'loading' ? ( ) : ( -
+
{ From e9883647665bfeb411fc605eee7a954309c1ac65 Mon Sep 17 00:00:00 2001 From: Harsh Mahajan <127186841+HarshMN2345@users.noreply.github.com> Date: Sun, 8 Oct 2023 17:47:27 +0530 Subject: [PATCH 021/151] Update CONTRIBUTING.md i made it easy to understand --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d8e35596..188a90d1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Welcome to DocsGPT Contributing Guidelines -Thank you for choosing to contribute to our project! We greatly appreciate your help! +Thank you for choosing to contribute to DocsGPT! We greatly appreciate your help! ### [πŸŽ‰ Join the Hacktoberfest with DocsGPT and Earn a Free T-shirt! πŸŽ‰](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md) @@ -8,7 +8,7 @@ Thank you for choosing to contribute to our project! We greatly appreciate your πŸ“£ Discussions - Engage in conversations, start new topics, or help answer questions. -🐞 Issues - This is where we keep track of tasks. It could be bug fixes or suggestions for new features. +🐞 Issues - This is where we keep track of tasks. It could be bug,fixes or suggestions for new features. πŸ› οΈ Pull requests - Suggest changes to our repository, either by working on existing issues or adding new features. @@ -17,7 +17,7 @@ Thank you for choosing to contribute to our project! We greatly appreciate your ## 🐞 Issues and Pull requests -We highly 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: @@ -32,7 +32,7 @@ We have a frontend built with React (Vite) and a backend in Python. Please try to follow the guidelines. ### If you are looking to contribute to Backend (🐍 Python): -- Review our issues and contribute to /application or /scripts (please disregard old ingest_rst.py and ingest_rst_sphinx.py files; they will be phased out soon). +- Review our issues and contribute to /application or /scripts (please disregard old ingest_rst.py and ingest_rst_sphinx.py files; they will be deprecated soon). - All new code should be covered with unit tests ([pytest](https://github.com/pytest-dev/pytest)). Please find tests under [`/tests`](https://github.com/arc53/DocsGPT/tree/main/tests) folder. - Before submitting your Pull Request, ensure it can be queried after ingesting some test data. 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 022/151] 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 c451d00eb4db238730070aa20e05fc28e401d812 Mon Sep 17 00:00:00 2001 From: Suryansh <58465650+drk1rd@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:52:52 +0530 Subject: [PATCH 023/151] Update Hosting-the-app.md --- docs/pages/Deploying/Hosting-the-app.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/pages/Deploying/Hosting-the-app.md b/docs/pages/Deploying/Hosting-the-app.md index 7505f60d..13296b49 100644 --- a/docs/pages/Deploying/Hosting-the-app.md +++ b/docs/pages/Deploying/Hosting-the-app.md @@ -18,7 +18,7 @@ After that, it is time to pick your Instance Image. We recommend using "Linux/Un 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. -Lastly, Identify your instance by giving it a unique name and then hit "Create instance". +Lastly, identify your instance by giving it a unique name and then hit "Create instance". PS: Once you create your instance, it'll likely take a few minutes for the setup to be completed. @@ -42,7 +42,7 @@ A terminal window will pop up, and the first step will be to clone the DocsGPT g #### 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` @@ -64,7 +64,7 @@ Enter the following command to access the folder in which DocsGPT docker-compose #### 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` @@ -95,7 +95,7 @@ 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 From 4d5de8176ad34793b1035c3d3f6f975c67e90afd Mon Sep 17 00:00:00 2001 From: Suryansh <58465650+drk1rd@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:55:43 +0530 Subject: [PATCH 024/151] Update Quickstart.md --- docs/pages/Deploying/Quickstart.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pages/Deploying/Quickstart.md b/docs/pages/Deploying/Quickstart.md index 2cc03c5a..5ed37a5b 100644 --- a/docs/pages/Deploying/Quickstart.md +++ b/docs/pages/Deploying/Quickstart.md @@ -1,7 +1,7 @@ ## Launching Web App Note: Make sure you have Docker installed -On Mac OS or Linux just write: +On macOS or Linux, just write: `./setup.sh` @@ -10,11 +10,11 @@ It will install all the dependencies and give you an option to download the loca Otherwise, refer to this Guide: 1. Open and download this repository with `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). +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 `docker-compose build && docker-compose up`. 4. Navigate to `http://localhost:5173/`. -To stop just run `Ctrl + C`. +To stop, just run `Ctrl + C`. ### Chrome Extension From d2424ce540a7cd536669afb3add54c4040f9559a Mon Sep 17 00:00:00 2001 From: Suryansh <58465650+drk1rd@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:59:27 +0530 Subject: [PATCH 025/151] Update API-docs.md --- docs/pages/Developing/API-docs.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/pages/Developing/API-docs.md b/docs/pages/Developing/API-docs.md index eabd29c0..1b908a8b 100644 --- a/docs/pages/Developing/API-docs.md +++ b/docs/pages/Developing/API-docs.md @@ -18,7 +18,7 @@ fetch("http://127.0.0.1:5000/api/answer", { .then(console.log.bind(console)) ``` -In response you will get a json document like this one: +In response, you will get a JSON document like this one: ```json { @@ -30,7 +30,7 @@ In response you will get a json document like this one: ### /api/docs_check It will make sure documentation is loaded on a server (just run it every time user is switching between libraries (documentations)). -It's a POST request that sends a JSON in body with 1 value. Here is a JavaScript fetch example: +It's a POST request that sends a JSON in a body with 1 value. Here is a JavaScript fetch example: ```js // answer (POST http://127.0.0.1:5000/api/docs_check) @@ -45,7 +45,7 @@ fetch("http://127.0.0.1:5000/api/docs_check", { .then(console.log.bind(console)) ``` -In response you will get a json document like this one: +In response, you will get a JSON document like this one: ```json { "status": "exists" @@ -54,17 +54,17 @@ In response you will get a json document like this one: ### /api/combine -Provides json that tells UI which vectors are available and where they are located with a simple get request. +Provides JSON that tells UI which vectors are available and where they are located with a simple get request. Response will include: `date`, `description`, `docLink`, `fullName`, `language`, `location` (local or docshub), `model`, `name`, `version`. -Example of json in Docshub and local: +Example of JSON in Docshub and local: image ### /api/upload -Uploads file that needs to be trained, response is json with task id, which can be used to check on tasks progress +Uploads file that needs to be trained, response is JSON with task ID, which can be used to check on task's progress HTML example: ```html @@ -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 task is still running, where "current" will show progress from 0 to 100 ```json { "result": { From 4d5d407655ce7e95ca4a4f02ba6683e41cfef9b7 Mon Sep 17 00:00:00 2001 From: Suryansh <58465650+drk1rd@users.noreply.github.com> Date: Sun, 8 Oct 2023 22:00:46 +0530 Subject: [PATCH 026/151] Update Chatwoot-extension.md --- docs/pages/Extensions/Chatwoot-extension.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/Extensions/Chatwoot-extension.md b/docs/pages/Extensions/Chatwoot-extension.md index 4dd57820..e95891a4 100644 --- a/docs/pages/Extensions/Chatwoot-extension.md +++ b/docs/pages/Extensions/Chatwoot-extension.md @@ -13,7 +13,7 @@ chatwoot_token= 5. Start with `flask run` command. -If you want for bot to stop responding to questions for a specific user or session just add label `human-requested` in your conversation. +If you want for bot to stop responding to questions for a specific user or session, just add a label `human-requested` in your conversation. ### Optional (extra validation) @@ -26,4 +26,4 @@ account_id=(optional) 1 assignee_id=(optional) 1 ``` -Those are chatwoot values and will allow you to check if you are responding to correct widget and responding to questions assigned to specific user. \ No newline at end of file +Those are chatwoot values and will allow you to check if you are responding to correct widget and responding to questions assigned to specific user. From dc85f93423aaba0a3b104a5c2a27fdc5a4bc9a74 Mon Sep 17 00:00:00 2001 From: Suryansh <58465650+drk1rd@users.noreply.github.com> Date: Sun, 8 Oct 2023 22:02:10 +0530 Subject: [PATCH 027/151] Update react-widget.md --- docs/pages/Extensions/react-widget.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/pages/Extensions/react-widget.md b/docs/pages/Extensions/react-widget.md index be4d6bdc..1cc11321 100644 --- a/docs/pages/Extensions/react-widget.md +++ b/docs/pages/Extensions/react-widget.md @@ -4,7 +4,7 @@ Got 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: +Go to your project and in the file where you want to use the widget, import it: ```js import { DocsGPTWidget } from "docsgpt"; import "docsgpt/dist/style.css"; @@ -14,12 +14,12 @@ import "docsgpt/dist/style.css"; Then you can use it like this: `` DocsGPTWidget takes 3 props: -- `apiHost` β€” url of your DocsGPT API. -- `selectDocs` β€” documentation that you want to use for your widget (eg. `default` or `local/docs1.zip`). -- `apiKey` β€” usually its empty. +- `apiHost` β€” URL of your DocsGPT API. +- `selectDocs` β€” documentation that you want to use for your widget (e.g. `default` or `local/docs1.zip`). +- `apiKey` β€” usually it's empty. ### How to use DocsGPTWidget with [Nextra](https://nextra.site/) (Next.js + MDX) -Install you widget as described above and then go to your `pages/` folder and create a new file `_app.js` with the following content: +Install your widget as described above and then go to your `pages/` folder and create a new file `_app.js` with the following content: ```js import { DocsGPTWidget } from "docsgpt"; import "docsgpt/dist/style.css"; From 31e0dfef76d5f713d03a24d573509f0cdf1cf30f Mon Sep 17 00:00:00 2001 From: Suryansh <58465650+drk1rd@users.noreply.github.com> Date: Sun, 8 Oct 2023 22:03:18 +0530 Subject: [PATCH 028/151] 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 1d3a7d4a..19dcdefd 100644 --- a/docs/pages/Guides/Customising-prompts.md +++ b/docs/pages/Guides/Customising-prompts.md @@ -1,4 +1,4 @@ -## To customize a main prompt navigate to `/application/prompt/combine_prompt.txt` +## To customize a main prompt, navigate to `/application/prompt/combine_prompt.txt` You can try editing it to see how the model responses. From 64cecb4931ed903be521336643c5f80b08114793 Mon Sep 17 00:00:00 2001 From: Suryansh <58465650+drk1rd@users.noreply.github.com> Date: Sun, 8 Oct 2023 22:07:00 +0530 Subject: [PATCH 029/151] Update How-to-train-on-other-documentation.md --- .../Guides/How-to-train-on-other-documentation.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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 9f4e5032..aef6f008 100644 --- a/docs/pages/Guides/How-to-train-on-other-documentation.md +++ b/docs/pages/Guides/How-to-train-on-other-documentation.md @@ -5,18 +5,18 @@ This AI can use any documentation, but first it needs to be prepared for similar 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`. +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 vector store, so make sure your documentation is not too big. Pandas cost me around 3-4$. +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. -You can usually find documentation on github in `docs/` folder for most open-source projects. +You can usually find documentation on Github in `docs/` folder for most open-source projects. ### 1. Find documentation in .rst/.md 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 and feed it. (don't forget to change the extension in script) +If there are no .rst/.md files just convert whatever you find to .txt and feed it. (don't forget to change the extension in script) ### 2. Create .env file in `scripts/` folder And write your OpenAI API key inside @@ -32,7 +32,7 @@ It will tell you how much it will cost ### 5. Run web app -Once you run it will use new context that is relevant to your documentation +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 ## Customization @@ -41,7 +41,7 @@ You can learn more about options while running ingest.py by running: `python ingest.py --help` | Options | | |:--------------------------------:|:------------------------------------------------------------------------------------------------------------------------------:| -| **ingest** | Runs 'ingest' function converting documentation to Faiss plus Index format | +| **ingest** | Runs 'ingest' function, converting documentation to Faiss plus Index format | | --dir TEXT | List of paths to directory for index creation. E.g. --dir inputs --dir inputs2 [default: inputs] | | --file TEXT | File paths to use (Optional; overrides directory) E.g. --files inputs/1.md --files inputs/2.md | | --recursive / --no-recursive | Whether to recursively search in subdirectories [default: recursive] | @@ -56,4 +56,4 @@ You can learn more about options while running ingest.py by running: | | | | **convert** | Creates documentation in .md format from source code | | --dir TEXT | Path to a directory with source code. E.g. --dir inputs [default: inputs] | -| --formats TEXT | Source code language from which to create documentation. Supports py, js and java. E.g. --formats py [default: py] | \ No newline at end of file +| --formats TEXT | Source code language from which to create documentation. Supports py, js and java. E.g. --formats py [default: py] | From 706e6c01aaa6397c09d6e29f957a6b5b4c348eb5 Mon Sep 17 00:00:00 2001 From: Suryansh <58465650+drk1rd@users.noreply.github.com> Date: Sun, 8 Oct 2023 22:08:18 +0530 Subject: [PATCH 030/151] Update How-to-use-different-LLM.md --- docs/pages/Guides/How-to-use-different-LLM.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/Guides/How-to-use-different-LLM.md b/docs/pages/Guides/How-to-use-different-LLM.md index aa5815f0..c0245a15 100644 --- a/docs/pages/Guides/How-to-use-different-LLM.md +++ b/docs/pages/Guides/How-to-use-different-LLM.md @@ -1,4 +1,4 @@ -Fortunately there are many providers for LLM's and some of them can even be ran locally +Fortunately, there are many providers for LLM's and some of them can even be run locally There are two models used in the app: 1. Embeddings. @@ -29,4 +29,4 @@ 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. -Make sure you set `SELF_HOSTED_MODEL` as true in you `.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's on Hugging Face. From 5c9d11861efb41c2a1f07f98ddfbd62c7579969b Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sun, 8 Oct 2023 22:08:19 +0530 Subject: [PATCH 031/151] add the coversation tile in the chat section --- frontend/src/Navigation.tsx | 51 ++++++++++++------------------------- 1 file changed, 16 insertions(+), 35 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index e6c5bb64..4c5aac3a 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -32,6 +32,7 @@ import { useMediaQuery, useOutsideAlerter } from './hooks'; import Upload from './upload/Upload'; import { Doc, getConversations } from './preferences/preferenceApi'; import SelectDocsModal from './preferences/SelectDocsModal'; +import ConversationTile from './conversation/ConversationTile'; interface NavigationProps { navOpen: boolean; @@ -126,6 +127,10 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { ); }); }; + + function updateConversationName(updatedConversation: object) { + console.log(updatedConversation); + } useOutsideAlerter( navRef, () => { @@ -210,41 +215,17 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
{conversations - ? conversations.map((conversation) => { - return ( -
{ - handleConversationClick(conversation.id); - }} - className={`my-auto mx-4 mt-4 flex h-12 cursor-pointer items-center justify-between gap-4 rounded-3xl hover:bg-gray-100 ${ - conversationId === conversation.id ? 'bg-gray-100' : '' - }`} - > -
- -

- {conversation.name.length > 45 - ? conversation.name.substring(0, 45) + '...' - : conversation.name} -

-
- - {conversationId === conversation.id ? ( - Exit { - event.stopPropagation(); - handleDeleteConversation(conversation.id); - }} - /> - ) : null} -
- ); - }) + ? conversations.map((conversation, index) => ( + handleConversationClick(id)} + onDeleteConversation={(id) => handleDeleteConversation(id)} + onSave={(conversation) => + updateConversationName(conversation) + } + /> + )) : null}
From ceb9c70fbae464f537c45d612f0f10cd777ddf73 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sun, 8 Oct 2023 22:08:42 +0530 Subject: [PATCH 032/151] add the edit icons in the assets --- frontend/src/assets/edit.svg | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 frontend/src/assets/edit.svg diff --git a/frontend/src/assets/edit.svg b/frontend/src/assets/edit.svg new file mode 100644 index 00000000..25653776 --- /dev/null +++ b/frontend/src/assets/edit.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file From 7f1fb41d4821b9df2a695e3b3e64f3e339f995be Mon Sep 17 00:00:00 2001 From: Suryansh <58465650+drk1rd@users.noreply.github.com> Date: Sun, 8 Oct 2023 22:08:55 +0530 Subject: [PATCH 033/151] 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 be1bffa5..fb15835f 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 @@ -If your AI uses external knowledge and is not explicit enough it is ok, because we try to make docsgpt friendly. +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 f91ca796deadf8bc1fc35367f7bc5df5f5caa8d5 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sun, 8 Oct 2023 22:09:16 +0530 Subject: [PATCH 034/151] add the check Mark icons --- frontend/src/assets/checkMark.svg | 3 +++ 1 file changed, 3 insertions(+) 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..9ed02cbd --- /dev/null +++ b/frontend/src/assets/checkMark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file From 10cf0470cb3453312b1800c11fd2a5d808d1a679 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sun, 8 Oct 2023 22:09:38 +0530 Subject: [PATCH 035/151] add the conversation Tile --- .../src/conversation/ConversationTile.tsx | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 frontend/src/conversation/ConversationTile.tsx diff --git a/frontend/src/conversation/ConversationTile.tsx b/frontend/src/conversation/ConversationTile.tsx new file mode 100644 index 00000000..e97d9982 --- /dev/null +++ b/frontend/src/conversation/ConversationTile.tsx @@ -0,0 +1,84 @@ +import React, { useState } from 'react'; +import { useSelector } from 'react-redux'; +import Edit from '../assets/edit.svg'; +import Exit from '../assets/exit.svg'; +import Message from '../assets/message.svg'; + +import { selectConversationId } from '../preferences/preferenceSlice'; + +interface ConversationTileProps { + conversation: { name: string; id: string }; + selectConversation: (arg1: string) => void; + onDeleteConversation: (arg1: string) => void; + onSave: ({ name, id }: { name: string; id: string }) => void; +} + +export default function ConversationTile({ + conversation, + selectConversation, + onDeleteConversation, + onSave, +}: ConversationTileProps) { + const conversationId = useSelector(selectConversationId); + + const [isEdit, setIsEdit] = useState(false); + const [conversationName, setConversationsName] = useState(conversation.name); + + function handleEditConversation() { + setIsEdit(true); + } + return ( +
{ + selectConversation(conversation.id); + }} + className={`my-auto mx-4 mt-4 flex h-12 cursor-pointer items-center justify-between gap-4 rounded-3xl hover:bg-gray-100 ${ + conversationId === conversation.id ? 'bg-gray-100' : '' + }`} + > +
+ + {isEdit ? ( + setConversationsName(e.target.value)} + /> + ) : ( +

+ {conversationName.length > 45 + ? conversationName.substring(0, 45) + '...' + : conversationName} +

+ )} +
+ {conversationId === conversation.id ? ( + <> + Edit { + event.stopPropagation(); + isEdit + ? onSave({ id: conversationId, name: conversationName }) + : handleEditConversation(); + }} + /> + Exit { + event.stopPropagation(); + onDeleteConversation(conversation.id); + }} + /> + + ) : null} +
+ ); +} From 6b617955b7433eade76f8b765687084ee9c31cb2 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sun, 8 Oct 2023 22:31:17 +0530 Subject: [PATCH 036/151] add the check mark logics --- .../src/conversation/ConversationTile.tsx | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/frontend/src/conversation/ConversationTile.tsx b/frontend/src/conversation/ConversationTile.tsx index e97d9982..b7e0058d 100644 --- a/frontend/src/conversation/ConversationTile.tsx +++ b/frontend/src/conversation/ConversationTile.tsx @@ -1,8 +1,9 @@ -import React, { useState } from 'react'; +import React, { useRef, useState } from 'react'; 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 { selectConversationId } from '../preferences/preferenceSlice'; @@ -20,12 +21,26 @@ export default function ConversationTile({ onSave, }: ConversationTileProps) { const conversationId = useSelector(selectConversationId); + const inputRef = useRef(null); const [isEdit, setIsEdit] = useState(false); const [conversationName, setConversationsName] = useState(conversation.name); function handleEditConversation() { setIsEdit(true); + // inputRef?.current?.focus(); + } + function handleSaveConversation(changedConversation: any) { + onSave(changedConversation); + setIsEdit(false); + } + function handleBlur() { + if (conversation.name !== conversationName) { + handleSaveConversation({ + id: conversationId, + name: conversationName, + }); + } } return (
{isEdit ? ( setConversationsName(e.target.value)} /> ) : ( @@ -56,14 +74,17 @@ export default function ConversationTile({ {conversationId === conversation.id ? ( <> Edit { event.stopPropagation(); isEdit - ? onSave({ id: conversationId, name: conversationName }) + ? handleSaveConversation({ + id: conversationId, + name: conversationName, + }) : handleEditConversation(); }} /> From 65d431c7a0586cb27ac2b5babadd6797a0d5e04a Mon Sep 17 00:00:00 2001 From: timoransky <15653065+timoransky@users.noreply.github.com> Date: Sun, 8 Oct 2023 19:18:11 +0200 Subject: [PATCH 037/151] fix: margin left on content container --- frontend/src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4802ab82..ad9d72a3 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -19,7 +19,7 @@ export default function App() { className={`transition-all duration-200 ${ !isMobile ? `ml-0 ${ - !navOpen ? '-mt-5 md:mx-auto lg:mx-auto' : 'md:ml-72 lg:ml-60' + !navOpen ? '-mt-5 md:mx-auto lg:mx-auto' : 'md:ml-72' }` : 'ml-0 md:ml-16' }`} From 16a2b3b19ba271d3ba72f9eba9c349d6ef58c5af Mon Sep 17 00:00:00 2001 From: SoumyadiptoPal Date: Sun, 8 Oct 2023 23:48:49 +0530 Subject: [PATCH 038/151] Rounded the components to 3xl --- frontend/src/Navigation.tsx | 2 +- frontend/src/conversation/Conversation.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 260639b6..6fdcb10c 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -247,7 +247,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
setIsDocsListOpen(!isDocsListOpen)} > {selectedDocs && ( diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 79e62da7..f805a64e 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -154,7 +154,7 @@ export default function Conversation() { placeholder="Type your message here..." contentEditable onPaste={handlePaste} - className={`border-000000 overflow-x-hidden; max-h-24 min-h-[2.6rem] w-full overflow-y-auto whitespace-pre-wrap rounded-xl border bg-white py-2 pl-4 pr-9 leading-7 opacity-100 focus:outline-none`} + className={`border-000000 overflow-x-hidden; max-h-24 min-h-[2.6rem] w-full overflow-y-auto whitespace-pre-wrap rounded-3xl border bg-white py-2 pl-4 pr-9 leading-7 opacity-100 focus:outline-none`} onKeyDown={(e) => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); From b1f863cc4da2fcfc59c71a06dea07b28f0146834 Mon Sep 17 00:00:00 2001 From: Soumyadipto Pal <119007659+SoumyadiptoPal@users.noreply.github.com> Date: Sun, 8 Oct 2023 23:59:08 +0530 Subject: [PATCH 039/151] 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 e6c5bb64..e065d65d 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -252,7 +252,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
setIsDocsListOpen(!isDocsListOpen)} > {selectedDocs && ( From cdad083d7fec09ca77a2a0d7655971c3b4c60a25 Mon Sep 17 00:00:00 2001 From: Harsh Mahajan <127186841+HarshMN2345@users.noreply.github.com> Date: Mon, 9 Oct 2023 01:21:36 +0530 Subject: [PATCH 040/151] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 188a90d1..3e969801 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Welcome to DocsGPT Contributing Guidelines -Thank you for choosing to contribute to DocsGPT! We greatly appreciate your help! +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) @@ -8,7 +8,7 @@ Thank you for choosing to contribute to DocsGPT! We greatly appreciate your help πŸ“£ Discussions - Engage in conversations, start new topics, or help answer questions. -🐞 Issues - This is where we keep track of tasks. It could be bug,fixes or suggestions for new features. +🐞 Issues - This is where we keep track of tasks. It could be bugs,fixes or suggestions for new features. πŸ› οΈ Pull requests - Suggest changes to our repository, either by working on existing issues or adding new features. From 3197c356e9e9c5cd4ee0c27177e73cf1a6401637 Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Mon, 9 Oct 2023 02:36:48 +0530 Subject: [PATCH 041/151] UI corrections --- frontend/src/assets/checkmark.svg | 3 ++ frontend/src/assets/copy.svg | 2 +- .../src/conversation/ConversationBubble.tsx | 32 ++++++++++++++++--- 3 files changed, 32 insertions(+), 5 deletions(-) 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..682c29d7 --- /dev/null +++ b/frontend/src/assets/checkmark.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/assets/copy.svg b/frontend/src/assets/copy.svg index d0da8857..846d285f 100644 --- a/frontend/src/assets/copy.svg +++ b/frontend/src/assets/copy.svg @@ -1,3 +1,3 @@ - + diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 471970a8..19019613 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -5,6 +5,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 ReactMarkdown from 'react-markdown'; import copy from 'copy-to-clipboard'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; @@ -28,6 +29,17 @@ const ConversationBubble = forwardRef< ) { const [showFeedback, setShowFeedback] = useState(false); const [openSource, setOpenSource] = useState(null); + const [copied, setCopied] = useState(false); + + const handleCopyClick = (text: string) => { + copy(text); + setCopied(true); + // Reset copied to false after a few seconds + setTimeout(() => { + setCopied(false); + }, 2000); + }; + const List = ({ ordered, children, @@ -140,6 +152,22 @@ const ConversationBubble = forwardRef<
+
+ {copied ? ( + + ) : ( + { + handleCopyClick(message); + }} + > + )} +
- copy(message)} - > Date: Sun, 8 Oct 2023 23:30:21 +0100 Subject: [PATCH 042/151] Update Conversation.tsx --- frontend/src/conversation/Conversation.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index c7f49411..5b2e6981 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -170,10 +170,10 @@ export default function Conversation() { {status === 'loading' ? ( ) : ( -
+
{ From 261c674832e4a61655ab82d574c5664feeb81e14 Mon Sep 17 00:00:00 2001 From: "beKool.sh" <76424367+beKoool@users.noreply.github.com> Date: Mon, 9 Oct 2023 05:48:27 +0545 Subject: [PATCH 043/151] 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 99d98965..26ad6401 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) fetch("http://localhost:5001/api/task_status?task_id=b2d2a0f4-387c-44fd-a443-e4fe2e7454d1", { From f88806fc3c10977cff952a67a56964246eceebc7 Mon Sep 17 00:00:00 2001 From: Digvijay Shelar <82649533+shelar1423@users.noreply.github.com> Date: Mon, 9 Oct 2023 07:26:34 +0530 Subject: [PATCH 044/151] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f326f426..3784278d 100644 --- a/README.md +++ b/README.md @@ -57,16 +57,15 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize - πŸ”πŸ”₯ [Live preview](https://docsgpt.arc53.com/) - - Discord [Join our Discord](https://discord.gg/n5BX8dh8rU) + - πŸ’¬πŸŽ‰[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) + - πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» [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) - + - πŸ πŸ” [How to host it locally (so all data will stay on-premises)](https://docs.docsgpt.co.uk/Guides/How-to-use-different-LLM) From f8ca6c019f5d8fdea8a5fe6d08b84d861cd9e609 Mon Sep 17 00:00:00 2001 From: Shuvadipta Das Date: Mon, 9 Oct 2023 09:46:54 +0530 Subject: [PATCH 045/151] Update My-AI-answers-questions-using-external-knowledge.md --- .../My-AI-answers-questions-using-external-knowledge.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 fb15835f..a546116e 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,10 +1,10 @@ -If your AI uses external knowledge and is not explicit enough, it is ok, because we try to make docsgpt friendly. +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. +But if you want to adjust it, here is a simple way:- -Got to `application/prompts/chat_combine_prompt.txt` +- Got to `application/prompts/chat_combine_prompt.txt` -And change it to +- And change it to ``` From a032164a99ca07d4b1f75fb48f4998671917d563 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 10:25:38 +0530 Subject: [PATCH 046/151] Add update conversation name API --- application/api/user/routes.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/api/user/routes.py b/application/api/user/routes.py index 02a0876c..aa0d15b7 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -53,6 +53,15 @@ def get_single_conversation(): conversation = conversations_collection.find_one({"_id": ObjectId(conversation_id)}) return jsonify(conversation['queries']) +@user.route("/api/update_conversation_name", methods=["POST"]) +def update_conversation_name(): + # update data for a conversation + data = request.get_json() + id = data["id"] + name = data["name"] + conversation = conversations_collection.update_one({"_id": ObjectId(id)},{"$set":{"name":name}}) + return {"status": "ok"} + @user.route("/api/feedback", methods=["POST"]) def api_feedback(): From 7bf67869b015d65b894f7ea3f6bee269f70420c6 Mon Sep 17 00:00:00 2001 From: Nick Rogers Date: Sun, 8 Oct 2023 22:03:32 -0700 Subject: [PATCH 047/151] Reference DocsGPT model in custom model steps. --- docs/pages/Guides/How-to-use-different-LLM.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/Guides/How-to-use-different-LLM.md b/docs/pages/Guides/How-to-use-different-LLM.md index 413bef12..0eaf483e 100644 --- a/docs/pages/Guides/How-to-use-different-LLM.md +++ b/docs/pages/Guides/How-to-use-different-LLM.md @@ -24,9 +24,9 @@ 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) -If using Llama, set the `EMBEDDINGS_NAME` to `huggingface_sentence-transformers/all-mpnet-base-v2`. +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`. -Alternatively, if you wish to run Llama locally, you can run `setup.sh` and choose option 1 when prompted. +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! From 4ca906a51808628885f8760386699e7886db43ef Mon Sep 17 00:00:00 2001 From: Vaibhav91one Date: Mon, 9 Oct 2023 10:44:14 +0530 Subject: [PATCH 048/151] bug(front): The text seems to go out of screen when the result is too big, needed some tailwind --- frontend/src/conversation/ConversationBubble.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index b74c65fe..e872d874 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -60,7 +60,7 @@ const ConversationBubble = forwardRef<
)} Date: Mon, 9 Oct 2023 12:48:48 +0530 Subject: [PATCH 049/151] add the update conversation callbacks --- frontend/src/Navigation.tsx | 41 +++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 4c5aac3a..97034eab 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -69,16 +69,20 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { useEffect(() => { if (!conversations) { - getConversations() - .then((fetchedConversations) => { - dispatch(setConversations(fetchedConversations)); - }) - .catch((error) => { - console.error('Failed to fetch conversations: ', error); - }); + fetchConversations(); } }, [conversations, dispatch]); + async function fetchConversations() { + return await getConversations() + .then((fetchedConversations) => { + dispatch(setConversations(fetchedConversations)); + }) + .catch((error) => { + console.error('Failed to fetch conversations: ', error); + }); + } + const handleDeleteConversation = (id: string) => { fetch(`${apiHost}/api/delete_conversation?id=${id}`, { method: 'POST', @@ -128,8 +132,27 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { }); }; - function updateConversationName(updatedConversation: object) { - console.log(updatedConversation); + async function updateConversationName(updatedConversation: { + name: string; + id: string; + }) { + await fetch(`${apiHost}/api/update_conversation_name`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(updatedConversation), + }) + .then((response) => response.json()) + .then((data) => { + if (data) { + navigate('/'); + fetchConversations(); + } + }) + .catch((err) => { + console.error(err); + }); } useOutsideAlerter( navRef, From 022c0c3a890fb469936d74da5726d576b4f1ed3d Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 12:49:09 +0530 Subject: [PATCH 050/151] add trash icons changes --- frontend/src/assets/trash.svg | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 frontend/src/assets/trash.svg diff --git a/frontend/src/assets/trash.svg b/frontend/src/assets/trash.svg new file mode 100644 index 00000000..d0e4546a --- /dev/null +++ b/frontend/src/assets/trash.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file From 17264e787242d93f7eddd4f87dcc463e15c7d82a Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 12:50:12 +0530 Subject: [PATCH 051/151] add the outside click listioner --- .../src/conversation/ConversationTile.tsx | 74 ++++++++++++------- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/frontend/src/conversation/ConversationTile.tsx b/frontend/src/conversation/ConversationTile.tsx index b7e0058d..b578e381 100644 --- a/frontend/src/conversation/ConversationTile.tsx +++ b/frontend/src/conversation/ConversationTile.tsx @@ -1,11 +1,13 @@ -import React, { useRef, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; 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 Trash from '../assets/trash.svg'; import { selectConversationId } from '../preferences/preferenceSlice'; +import { useOutsideAlerter } from '../hooks'; interface ConversationTileProps { conversation: { name: string; id: string }; @@ -21,29 +23,47 @@ export default function ConversationTile({ onSave, }: ConversationTileProps) { const conversationId = useSelector(selectConversationId); - const inputRef = useRef(null); + const tileRef = useRef(null); const [isEdit, setIsEdit] = useState(false); - const [conversationName, setConversationsName] = useState(conversation.name); + const [conversationName, setConversationsName] = useState(''); + useOutsideAlerter( + tileRef, + () => + handleSaveConversation({ + id: conversationId || conversation.id, + name: conversationName, + }), + [conversationName], + ); + + useEffect(() => { + setConversationsName(conversation.name); + }, [conversation.name]); function handleEditConversation() { setIsEdit(true); - // inputRef?.current?.focus(); } - function handleSaveConversation(changedConversation: any) { - onSave(changedConversation); - setIsEdit(false); - } - function handleBlur() { - if (conversation.name !== conversationName) { - handleSaveConversation({ - id: conversationId, - name: conversationName, - }); + + function handleSaveConversation(changedConversation: { + name: string; + id: string; + }) { + if (changedConversation.name.trim().length) { + onSave(changedConversation); + setIsEdit(false); + } else { + onClear(); } } + + function onClear() { + setConversationsName(conversation.name); + setIsEdit(false); + } return (
{ selectConversation(conversation.id); }} @@ -51,32 +71,28 @@ export default function ConversationTile({ conversationId === conversation.id ? 'bg-gray-100' : '' }`} > -
+
{isEdit ? ( setConversationsName(e.target.value)} /> ) : ( -

- {conversationName.length > 45 - ? conversationName.substring(0, 45) + '...' - : conversationName} +

+ {conversationName}

)}
{conversationId === conversation.id ? ( - <> +
Edit { event.stopPropagation(); @@ -89,16 +105,18 @@ export default function ConversationTile({ }} /> Exit { event.stopPropagation(); - onDeleteConversation(conversation.id); + isEdit ? onClear() : onDeleteConversation(conversation.id); }} /> - +
) : null}
); From b49e8deb3ef427cff6b5a8da954c57b455665823 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 14:13:09 +0530 Subject: [PATCH 052/151] add the typescript props interface --- .../src/conversation/ConversationTile.tsx | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/frontend/src/conversation/ConversationTile.tsx b/frontend/src/conversation/ConversationTile.tsx index b578e381..29a0d51f 100644 --- a/frontend/src/conversation/ConversationTile.tsx +++ b/frontend/src/conversation/ConversationTile.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; import { useSelector } from 'react-redux'; import Edit from '../assets/edit.svg'; import Exit from '../assets/exit.svg'; @@ -9,11 +9,15 @@ import Trash from '../assets/trash.svg'; import { selectConversationId } from '../preferences/preferenceSlice'; import { useOutsideAlerter } from '../hooks'; +interface ConversationProps { + name: string; + id: string; +} interface ConversationTileProps { - conversation: { name: string; id: string }; + conversation: ConversationProps; selectConversation: (arg1: string) => void; onDeleteConversation: (arg1: string) => void; - onSave: ({ name, id }: { name: string; id: string }) => void; + onSave: ({ name, id }: ConversationProps) => void; } export default function ConversationTile({ @@ -45,10 +49,7 @@ export default function ConversationTile({ setIsEdit(true); } - function handleSaveConversation(changedConversation: { - name: string; - id: string; - }) { + function handleSaveConversation(changedConversation: ConversationProps) { if (changedConversation.name.trim().length) { onSave(changedConversation); setIsEdit(false); @@ -71,7 +72,11 @@ export default function ConversationTile({ conversationId === conversation.id ? 'bg-gray-100' : '' }`} > -
+
{isEdit ? ( Date: Mon, 9 Oct 2023 14:44:43 +0530 Subject: [PATCH 053/151] Change the width in the tile --- frontend/src/conversation/ConversationTile.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/conversation/ConversationTile.tsx b/frontend/src/conversation/ConversationTile.tsx index 29a0d51f..b5cb7553 100644 --- a/frontend/src/conversation/ConversationTile.tsx +++ b/frontend/src/conversation/ConversationTile.tsx @@ -74,7 +74,7 @@ export default function ConversationTile({ >
From 95fe1037180fbb1f958a1b81ca27fed26bbf626f Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 15:17:32 +0530 Subject: [PATCH 054/151] add the conversation in the result response --- application/api/user/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/api/user/routes.py b/application/api/user/routes.py index aa0d15b7..9853f9a6 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -60,7 +60,7 @@ def update_conversation_name(): id = data["id"] name = data["name"] conversation = conversations_collection.update_one({"_id": ObjectId(id)},{"$set":{"name":name}}) - return {"status": "ok"} + return {"status": "ok","result":conversation} @user.route("/api/feedback", methods=["POST"]) From a06369dd7b89ac111ca103f3f13d81ba62cca3f8 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 15:19:29 +0530 Subject: [PATCH 055/151] add the checkmark icons --- frontend/src/assets/checkmark.svg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/assets/checkmark.svg b/frontend/src/assets/checkmark.svg index 682c29d7..9ed02cbd 100644 --- a/frontend/src/assets/checkmark.svg +++ b/frontend/src/assets/checkmark.svg @@ -1,3 +1,3 @@ - - - + + + \ No newline at end of file From 340647cb220e9cebe75b850524436ec49d0aaced Mon Sep 17 00:00:00 2001 From: Robbie Walmsley <65429016+robbiebusinessacc@users.noreply.github.com> Date: Mon, 9 Oct 2023 10:53:03 +0100 Subject: [PATCH 056/151] Update ingest.py --- scripts/ingest.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/ingest.py b/scripts/ingest.py index 6ab9cce1..e0d5ce13 100644 --- a/scripts/ingest.py +++ b/scripts/ingest.py @@ -78,14 +78,12 @@ def ingest(yes: bool = typer.Option(False, "-y", "--yes", prompt=False, # Here we check for command line arguments for bot calls. # If no argument exists or the yes is not True, then the # user permission is requested to call the API. - if len(sys.argv) > 1: - if yes: - call_openai_api(docs, folder_name) - else: - get_user_permission(docs, folder_name) + if len(sys.argv) > 1 and yes: + call_openai_api(docs, folder_name) else: get_user_permission(docs, folder_name) + folder_counts = defaultdict(int) folder_names = [] for dir_path in dir: From 57fb29b6008e38f6445f91066d3fbacd7eaf25b2 Mon Sep 17 00:00:00 2001 From: Robbie Walmsley <65429016+robbiebusinessacc@users.noreply.github.com> Date: Mon, 9 Oct 2023 10:55:34 +0100 Subject: [PATCH 057/151] Update worker.py --- application/worker.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/worker.py b/application/worker.py index 5c87c707..71fcd615 100644 --- a/application/worker.py +++ b/application/worker.py @@ -21,8 +21,7 @@ except FileExistsError: def metadata_from_filename(title): - store = title.split('/') - store = store[1] + '/' + store[2] + store = '/'.join(title.split('/')[1:3]) return {'title': title, 'store': store} From 2d0b6bcfcc0c852a65444594c2ed85d1d79f88e8 Mon Sep 17 00:00:00 2001 From: Robbie Walmsley <65429016+robbiebusinessacc@users.noreply.github.com> Date: Mon, 9 Oct 2023 11:04:55 +0100 Subject: [PATCH 058/151] Update ingest.py --- scripts/ingest.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/ingest.py b/scripts/ingest.py index e0d5ce13..48348448 100644 --- a/scripts/ingest.py +++ b/scripts/ingest.py @@ -108,14 +108,19 @@ def convert(dir: Optional[str] = typer.Option("inputs", Creates documentation linked to original functions from specified location. By default /inputs folder is used, .py is parsed. """ - if formats == 'py': - functions_dict, classes_dict = extract_py(dir) - elif formats == 'js': - functions_dict, classes_dict = extract_js(dir) - elif formats == 'java': - functions_dict, classes_dict = extract_java(dir) + # Using a dictionary to map between the formats and their respective extraction functions + # makes the code more scalable. When adding more formats in the future, + # you only need to update the extraction_functions dictionary. + extraction_functions = { + 'py': extract_py, + 'js': extract_js, + 'java': extract_java + } + + if formats in extraction_functions: + functions_dict, classes_dict = extraction_functions[formats](dir) else: - raise Exception("Sorry, language not supported yet") + raise Exception("Sorry, language not supported yet") transform_to_docs(functions_dict, classes_dict, formats, dir) From 4d92606562c3cb553ebf6b55210bce4e822b3193 Mon Sep 17 00:00:00 2001 From: Robbie Walmsley <65429016+robbiebusinessacc@users.noreply.github.com> Date: Mon, 9 Oct 2023 11:11:07 +0100 Subject: [PATCH 059/151] Update ingest.py --- scripts/ingest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ingest.py b/scripts/ingest.py index 48348448..8c74fd03 100644 --- a/scripts/ingest.py +++ b/scripts/ingest.py @@ -120,7 +120,7 @@ def convert(dir: Optional[str] = typer.Option("inputs", if formats in extraction_functions: functions_dict, classes_dict = extraction_functions[formats](dir) else: - raise Exception("Sorry, language not supported yet") + raise Exception("Sorry, language not supported yet") transform_to_docs(functions_dict, classes_dict, formats, dir) From 3753f7d138e104c3ac043842c19482f335cea270 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 16:12:56 +0530 Subject: [PATCH 060/151] change the input outline border color --- frontend/src/conversation/ConversationTile.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/conversation/ConversationTile.tsx b/frontend/src/conversation/ConversationTile.tsx index b5cb7553..592c52b2 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 CheckMark from '../assets/checkmark.svg'; import Trash from '../assets/trash.svg'; import { selectConversationId } from '../preferences/preferenceSlice'; @@ -82,7 +82,7 @@ export default function ConversationTile({ setConversationsName(e.target.value)} /> From 72481e845344f1c01e807ac73c939c475e95e5bc Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 16:16:20 +0530 Subject: [PATCH 061/151] Fix the post API issues --- application/api/user/routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/user/routes.py b/application/api/user/routes.py index 9853f9a6..fdff2e97 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -59,8 +59,8 @@ def update_conversation_name(): data = request.get_json() id = data["id"] name = data["name"] - conversation = conversations_collection.update_one({"_id": ObjectId(id)},{"$set":{"name":name}}) - return {"status": "ok","result":conversation} + conversations_collection.update_one({"_id": ObjectId(id)},{"$set":{"name":name}}) + return {"status": "ok"} @user.route("/api/feedback", methods=["POST"]) From c79ec45adb9ab3fedac84c005d1f4a8913f38297 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 16:16:56 +0530 Subject: [PATCH 062/151] Fix the lint issues --- frontend/src/About.tsx | 2 +- frontend/src/App.tsx | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index ca318a6e..fe26835e 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -4,7 +4,7 @@ export default function About() { return (
-
+

About DocsGPT

πŸ¦–

diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index ad9d72a3..44540943 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -18,9 +18,7 @@ export default function App() {
From a998db057028aaa14e8688f32be60b83f64eee04 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 16:30:09 +0530 Subject: [PATCH 063/151] add fetch conversations in the delete callbacks --- frontend/src/Navigation.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index bf43cbd0..7a55cd09 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -94,6 +94,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { ) as HTMLElement; const parentElement = imageElement.parentNode as HTMLElement; parentElement.parentNode?.removeChild(parentElement); + fetchConversations(); }) .catch((error) => console.error(error)); }; 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 064/151] 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 065/151] 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 ce7ac78b425c15ae3da31c844e20d291de2de8e6 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 19:48:17 +0530 Subject: [PATCH 066/151] add the darkmode in config file --- frontend/tailwind.config.cjs | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/tailwind.config.cjs b/frontend/tailwind.config.cjs index 8e395a07..b76b0222 100644 --- a/frontend/tailwind.config.cjs +++ b/frontend/tailwind.config.cjs @@ -1,6 +1,7 @@ /** @type {import('tailwindcss').Config} */ module.exports = { content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], + darkMode: 'class', theme: { extend: { spacing: { From 16df8d803ca9150ee53a551cf7b2ac0be8dcb1aa Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 19:48:35 +0530 Subject: [PATCH 067/151] Fix the error state issues --- .../src/conversation/ConversationBubble.tsx | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 19019613..aa9514cc 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -74,10 +74,10 @@ const ConversationBubble = forwardRef<
{type === 'ERROR' && ( @@ -115,18 +115,14 @@ const ConversationBubble = forwardRef< {message} {DisableSourceFE || type === 'ERROR' ? null : ( - - )} -
- {DisableSourceFE || type === 'ERROR' ? null : ( -
- Sources: -
- )} -
- {DisableSourceFE - ? null - : sources?.map((source, index) => ( + <> + +
+
+ Sources: +
+
+ {sources?.map((source, index) => (
))} -
-
+
+
+ + )}
Date: Mon, 9 Oct 2023 15:37:40 +0100 Subject: [PATCH 068/151] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 05a5feb7..55b54482 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Say goodbye to time-consuming manual searches, and let ) : ( { handleCopyClick(message); }} @@ -167,14 +167,14 @@ const ConversationBubble = forwardRef< )}
Date: Tue, 10 Oct 2023 12:12:25 +0530 Subject: [PATCH 071/151] 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 e718feb1f7981a9100d3db809bc5d0bd50b240b7 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 10 Oct 2023 11:36:54 +0100 Subject: [PATCH 072/151] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2ec3780..db561862 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Say goodbye to time-consuming manual searches, and let
{ 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 074/151] 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 075/151] 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 076/151] 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 077/151] 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 078/151] 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 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 079/151] 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 080/151] 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 081/151] 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 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 082/151] 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 083/151] 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 084/151] 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 085/151] 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 086/151] 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 087/151] 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 088/151] 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 089/151] 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 090/151] 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 104/151] 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 105/151] 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 106/151] 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 107/151] 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`} >