From 261c9eefe1e30542bfd096d9f8a17776e6916287 Mon Sep 17 00:00:00 2001 From: SoumyadiptoPal Date: Fri, 6 Oct 2023 02:10:21 +0530 Subject: [PATCH 01/46] Updated navigation bar and also added discord and github icons --- frontend/src/App.tsx | 11 ++++++-- frontend/src/Navigation.tsx | 48 ++++++++++++++++++++++++--------- frontend/src/assets/discord.svg | 1 + frontend/src/assets/github.svg | 5 ++++ 4 files changed, 50 insertions(+), 15 deletions(-) create mode 100644 frontend/src/assets/discord.svg create mode 100644 frontend/src/assets/github.svg diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 29f2bd2b..4802ab82 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -4,17 +4,24 @@ import Conversation from './conversation/Conversation'; import About from './About'; import { inject } from '@vercel/analytics'; import { useMediaQuery } from './hooks'; +import { useState } from 'react'; inject(); export default function App() { const { isMobile } = useMediaQuery(); + const [navOpen, setNavOpen] = useState(!isMobile); + return (
- +
diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index cb5d0218..260639b6 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -8,6 +8,8 @@ import Hamburger from './assets/hamburger.svg'; import Key from './assets/key.svg'; import Info from './assets/info.svg'; import Link from './assets/link.svg'; +import Discord from './assets/discord.svg'; +import Github from './assets/github.svg'; import UploadIcon from './assets/upload.svg'; import { ActiveState } from './models/misc'; import APIKeyModal from './preferences/APIKeyModal'; @@ -31,14 +33,18 @@ import Upload from './upload/Upload'; import { Doc, getConversations } from './preferences/preferenceApi'; import SelectDocsModal from './preferences/SelectDocsModal'; -export default function Navigation() { +interface NavigationProps { + navOpen: boolean; + setNavOpen: React.Dispatch>; +} + +export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { const dispatch = useDispatch(); const docs = useSelector(selectSourceDocs); const selectedDocs = useSelector(selectSelectedDocs); const conversations = useSelector(selectConversations); const conversationId = useSelector(selectConversationId); const { isMobile } = useMediaQuery(); - const [navOpen, setNavOpen] = useState(!isMobile); const [isDocsListOpen, setIsDocsListOpen] = useState(false); @@ -142,15 +148,31 @@ export default function Navigation() { return ( <> + {!navOpen && ( + + )}
-
+
{ setApiKeyModalState('ACTIVE'); }} @@ -305,7 +327,7 @@ export default function Navigation() { - `my-auto mx-4 flex h-12 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 ${ + `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 ${ isActive ? 'bg-gray-3000' : '' }` } @@ -318,7 +340,7 @@ export default function Navigation() { href="https://docs.docsgpt.co.uk/" target="_blank" rel="noreferrer" - className="my-auto mx-4 flex h-12 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" + className="my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" > link

Documentation

@@ -328,9 +350,9 @@ export default function Navigation() { href="https://discord.gg/WHJdfbQDR4" target="_blank" rel="noreferrer" - className="my-auto mx-4 flex h-12 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" + className="my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" > - link + link

Discord

@@ -338,9 +360,9 @@ export default function Navigation() { href="https://github.com/arc53/DocsGPT" target="_blank" rel="noreferrer" - className="my-auto mx-4 flex h-12 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" + className="my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" > - link + link

Github

diff --git a/frontend/src/assets/discord.svg b/frontend/src/assets/discord.svg new file mode 100644 index 00000000..ca54be77 --- /dev/null +++ b/frontend/src/assets/discord.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/github.svg b/frontend/src/assets/github.svg new file mode 100644 index 00000000..15e93c43 --- /dev/null +++ b/frontend/src/assets/github.svg @@ -0,0 +1,5 @@ + + github + + + \ No newline at end of file From 9c96a4d81bccb932f57c3658d99ffefeeddb8029 Mon Sep 17 00:00:00 2001 From: Aindree Chatterjee <68018372+aindree-2005@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:28:32 +0530 Subject: [PATCH 02/46] Update About.tsx Text decorations added --- frontend/src/About.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index 24da8134..07494e72 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -12,7 +12,7 @@ export default function About() {

Find the information in your documentation through AI-powered

- Currently It uses DocsGPT documentation, so it will respond to - information relevant to DocsGPT. If you want to train it on different + 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 If you want to launch it on your own server - follow Date: Fri, 6 Oct 2023 16:19:05 +0530 Subject: [PATCH 03/46] Update About.tsx --- frontend/src/About.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index 07494e72..034fe805 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -51,8 +51,8 @@ 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 + 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 Date: Fri, 6 Oct 2023 18:01:50 +0530 Subject: [PATCH 04/46] Update README.md -- Fixed ##453 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit βœ… Added code of conduct section to documentation. βœ… Added license section into the repository. βœ… Fixed some Typos. --- README.md | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index aba1401f..f9a04ae3 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ When deploying your DocsGPT to a live environment, we're eager to provide person You can find our [Roadmap](https://github.com/orgs/arc53/projects/2) here. Please don't hesitate to contribute or create issues, it helps us make DocsGPT better! -## Our Open-Source models optimised for DocsGPT: +## Our Open-Source models optimized for DocsGPT: | Name | Base Model | Requirements (or similar) | |-------------------|------------|----------------------------------------------------------| @@ -47,7 +47,7 @@ You can find our [Roadmap](https://github.com/orgs/arc53/projects/2) here. Pleas | [Docsgpt-40b-falcon](https://huggingface.co/Arc53/docsgpt-40b-falcon) | falcon-40b | 8xA10G gpu's | -If you don't have enough resources to run it you can use bitsnbytes to quantize +If you don't have enough resources to run it you can use bits bytes to quantize. ## Features @@ -72,11 +72,11 @@ If you don't have enough resources to run it you can use bitsnbytes to quantize ## Project structure - Application - Flask app (main application) -- Extensions - Chrome extension +- Extensions - Chrome extension. -- Scripts - Script that creates similarity search index and store for other libraries. +- Scripts - Script that creates similarity search index and stores for other libraries. -- Frontend - Frontend uses Vite and React +- Frontend - Frontend uses Vite and React. ## QuickStart @@ -86,9 +86,9 @@ On Mac OS or Linux just write: `./setup.sh` -It will install all the dependencies and give you an option to download local model or use OpenAI +It will install all the dependencies and give you the option to download the local model or use OpenAI -Otherwise refer to this Guide: +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 @@ -107,12 +107,12 @@ To stop just run Ctrl + C ## Development environments ### Spin up mongo and redis -For development only 2 containers are used from docker-compose.yaml (by deleting all services except for Redis and Mongo). +For development, only 2 containers are used from docker-compose.yaml (by deleting all services except for Redis and Mongo). See file [docker-compose-dev.yaml](./docker-compose-dev.yaml). Run ``` -docker compose -f docker-compose-dev.yaml build +docker-compose -f docker-compose-dev.yaml build docker compose -f docker-compose-dev.yaml up -d ``` @@ -120,18 +120,18 @@ 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 prep .env file in application folder +1. Export required environment variables or prep .env file in the application folder Prepare .env file Copy `.env_sample` and create `.env` with your OpenAI API token for the API_KEY and EMBEDDINGS_KEY fields (check out application/core/settings.py if you want to see more config options) 3. (optional) Create a Python virtual environment -```commandline +```command line python -m venv venv . venv/bin/activate ``` -4. Change to `application/` subdir and install dependencies for the backend -```commandline +4. Change to the `application/` sub dir and install dependencies for the backend +```command-line pip install -r application/requirements.txt ``` 5. Run the app `flask run --host=0.0.0.0 --port=7091` @@ -140,18 +140,27 @@ pip install -r application/requirements.txt ### Start frontend Make sure you have Node version 16 or higher. -1. Navigate to `/frontend` folder +1. Navigate to the `/frontend` folder 2. Install dependencies `npm install` 3. Run the app `npm run dev` +## Contributing + +Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for information about how to get involved. We welcome issues, questions, and pull requests. + +## Code Of Conduct +We as members, contributors, and leaders, pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. Please refer to the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file for more information about contributing. + ## All Thanks To Our Contributors +## License +The source code license is MIT, as described in the LICENSE file. -Built with [πŸ¦œοΈπŸ”— LangChain](https://github.com/hwchase17/langchain) +## Built with [πŸ¦œοΈπŸ”— LangChain](https://github.com/hwchase17/langchain) From 425a8a641204fa636b7b3ee1236161a1316b8cf6 Mon Sep 17 00:00:00 2001 From: Shuvadipta Das Date: Fri, 6 Oct 2023 21:39:18 +0530 Subject: [PATCH 05/46] 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 0585fb4c8098615213d2f55cde77063ca2fffffb Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Sat, 7 Oct 2023 11:21:55 +0530 Subject: [PATCH 06/46] synced the branch --- frontend/src/Hero.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index 8ed80fcf..0644da67 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -48,7 +48,7 @@ export default function Hero({ className = '' }: { className?: string }) {

-
+
lock Date: Sat, 7 Oct 2023 13:24:12 +0530 Subject: [PATCH 07/46] Fix: Sources feature doesn't look as intended --- frontend/src/conversation/ConversationBubble.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 2793a9bf..09238e29 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -131,7 +131,7 @@ const ConversationBubble = forwardRef< : 'text-[#007DFF]' }`} > - {index + 1}. {source.title} + {index + 1}. {source.title.substring(0, 45)}

))} @@ -173,15 +173,13 @@ const ConversationBubble = forwardRef<
{sources && openSource !== null && sources[openSource] && ( -
-

+

+

Source: {sources[openSource].title}

-
-

- {sources[openSource].text} -

+
+

{sources[openSource].text}

)} From ea49296cfe23dd3dbe5201073e899ff73b813545 Mon Sep 17 00:00:00 2001 From: Pratik Gupta <91310568+GuptaPratik02@users.noreply.github.com> Date: Sat, 7 Oct 2023 14:15:17 +0530 Subject: [PATCH 08/46] 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 09/46] 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 10/46] 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 11/46] 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 8d6fbddd67adb97da1472123376518e20174c2ed Mon Sep 17 00:00:00 2001 From: Mohit Dhote <146939900+mohitd404@users.noreply.github.com> Date: Sat, 7 Oct 2023 15:11:53 +0530 Subject: [PATCH 12/46] Update README.md #453 made the required changes #453 --- README.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index f9a04ae3..33db5b62 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ When deploying your DocsGPT to a live environment, we're eager to provide person You can find our [Roadmap](https://github.com/orgs/arc53/projects/2) here. Please don't hesitate to contribute or create issues, it helps us make DocsGPT better! -## Our Open-Source models optimized for DocsGPT: +## Our Open-Source models optimised for DocsGPT: | Name | Base Model | Requirements (or similar) | |-------------------|------------|----------------------------------------------------------| @@ -47,7 +47,7 @@ You can find our [Roadmap](https://github.com/orgs/arc53/projects/2) here. Pleas | [Docsgpt-40b-falcon](https://huggingface.co/Arc53/docsgpt-40b-falcon) | falcon-40b | 8xA10G gpu's | -If you don't have enough resources to run it you can use bits bytes to quantize. +If you don't have enough resources to run it you can use bitsnbytes to quantize ## Features @@ -72,11 +72,11 @@ If you don't have enough resources to run it you can use bits bytes to quantize. ## Project structure - Application - Flask app (main application) -- Extensions - Chrome extension. +- Extensions - Chrome extension -- Scripts - Script that creates similarity search index and stores for other libraries. +- Scripts - Script that creates similarity search index and store for other libraries. -- Frontend - Frontend uses Vite and React. +- Frontend - Frontend uses Vite and React ## QuickStart @@ -86,9 +86,9 @@ On Mac OS or Linux just write: `./setup.sh` -It will install all the dependencies and give you the option to download the local model or use OpenAI +It will install all the dependencies and give you an option to download local model or use OpenAI -Otherwise, refer to this Guide: +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 @@ -107,7 +107,7 @@ To stop just run Ctrl + C ## Development environments ### Spin up mongo and redis -For development, only 2 containers are used from docker-compose.yaml (by deleting all services except for Redis and Mongo). +For development only 2 containers are used from docker-compose.yaml (by deleting all services except for Redis and Mongo). See file [docker-compose-dev.yaml](./docker-compose-dev.yaml). Run @@ -120,7 +120,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 prep .env file in the application folder +1. Export required environment variables or prep .env file in application folder Prepare .env file Copy `.env_sample` and create `.env` with your OpenAI API token for the API_KEY and EMBEDDINGS_KEY fields @@ -130,8 +130,8 @@ Copy `.env_sample` and create `.env` with your OpenAI API token for the API_KEY python -m venv venv . venv/bin/activate ``` -4. Change to the `application/` sub dir and install dependencies for the backend -```command-line +4. Change to `application/` subdir and install dependencies for the backend +```commandline pip install -r application/requirements.txt ``` 5. Run the app `flask run --host=0.0.0.0 --port=7091` @@ -140,14 +140,13 @@ pip install -r application/requirements.txt ### Start frontend Make sure you have Node version 16 or higher. -1. Navigate to the `/frontend` folder +1. Navigate to `/frontend` folder 2. Install dependencies `npm install` 3. Run the app `npm run dev` ## Contributing - Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for information about how to get involved. We welcome issues, questions, and pull requests. ## Code Of Conduct @@ -162,5 +161,5 @@ 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. -## Built with [πŸ¦œοΈπŸ”— LangChain](https://github.com/hwchase17/langchain) +Built with [πŸ¦œοΈπŸ”— LangChain](https://github.com/hwchase17/langchain) From 7c2e72aebb143e46bc1900d405ed78f1dd653ccc Mon Sep 17 00:00:00 2001 From: Mohit Dhote <146939900+mohitd404@users.noreply.github.com> Date: Sat, 7 Oct 2023 15:13:15 +0530 Subject: [PATCH 13/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 33db5b62..09427686 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ See file [docker-compose-dev.yaml](./docker-compose-dev.yaml). Run ``` -docker-compose -f docker-compose-dev.yaml build +docker compose -f docker-compose-dev.yaml build docker compose -f docker-compose-dev.yaml up -d ``` From 3fcec069ed5d023f27b6301365863ba7e209c86a Mon Sep 17 00:00:00 2001 From: Mohit Dhote <146939900+mohitd404@users.noreply.github.com> Date: Sat, 7 Oct 2023 15:14:04 +0530 Subject: [PATCH 14/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09427686..ef892c51 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ Copy `.env_sample` and create `.env` with your OpenAI API token for the API_KEY (check out application/core/settings.py if you want to see more config options) 3. (optional) Create a Python virtual environment -```command line +```commandline python -m venv venv . venv/bin/activate ``` From 0e330f983b324b7ccba9ec6c13cf3d8d081de6fc Mon Sep 17 00:00:00 2001 From: KRISH SONI <67964054+krishvsoni@users.noreply.github.com> Date: Sat, 7 Oct 2023 16:44:55 +0530 Subject: [PATCH 15/46] Added alternative virtual environment activation command for Windows users in README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index edeb7b66..c9296ba8 100644 --- a/README.md +++ b/README.md @@ -124,10 +124,16 @@ 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: + On Mac OS or Linux ```commandline python -m venv venv . venv/bin/activate ``` +On Windows +```commandline +python -m venv venv +venv/Scripts/activate +``` 3. Change to the `application/` subdir and install dependencies for the backend: ```commandline pip install -r application/requirements.txt From 50d48ee3ec621b2c7c3e7536890c088b4cd32964 Mon Sep 17 00:00:00 2001 From: KRISH SONI <67964054+krishvsoni@users.noreply.github.com> Date: Sat, 7 Oct 2023 16:46:02 +0530 Subject: [PATCH 16/46] Added alternative virtual environment activation command for Windows users in README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c9296ba8..8fde021c 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,8 @@ 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: - On Mac OS or Linux + +On Mac OS or Linux ```commandline python -m venv venv . venv/bin/activate From b311b7620c26e54d934ec07a441771f92bf7503b Mon Sep 17 00:00:00 2001 From: Aindree Chatterjee <68018372+aindree-2005@users.noreply.github.com> Date: Sat, 7 Oct 2023 18:41:01 +0530 Subject: [PATCH 17/46] Update About.tsx --- frontend/src/About.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index 034fe805..2d339211 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -12,7 +12,7 @@ export default function About() {

Find the information in your documentation through AI-powered DocsGPT . If you want to train it on different documentation - please follow If you want to launch it on your own server - follow Date: Sat, 7 Oct 2023 18:41:39 +0530 Subject: [PATCH 18/46] Update About.tsx --- 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 2d339211..303708ca 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -55,7 +55,7 @@ export default function About() { information relevant to DocsGPT . If you want to train it on different documentation - please follow Date: Sat, 7 Oct 2023 19:43:45 +0530 Subject: [PATCH 19/46] added venv official Python documentation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8fde021c..387ad8ae 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,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 official Python documentation for virtual environments [here](https://docs.python.org/3/tutorial/venv.html). On Mac OS or Linux ```commandline @@ -135,6 +136,7 @@ On Windows python -m venv venv venv/Scripts/activate ``` + 3. Change to the `application/` subdir and install dependencies for the backend: ```commandline pip install -r application/requirements.txt From a0739a18e8dc87bca72586d465bdd073690afa4b Mon Sep 17 00:00:00 2001 From: KRISH SONI <67964054+krishvsoni@users.noreply.github.com> Date: Sat, 7 Oct 2023 19:53:23 +0530 Subject: [PATCH 20/46] added one line for the venv documentation --- README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/README.md b/README.md index 387ad8ae..3481ab6a 100644 --- a/README.md +++ b/README.md @@ -126,17 +126,6 @@ Make sure you have Python 3.10 or 3.11 installed. 2. (optional) Create a Python virtual environment: You can follow the official Python documentation for virtual environments [here](https://docs.python.org/3/tutorial/venv.html). -On Mac OS or Linux -```commandline -python -m venv venv -. venv/bin/activate -``` -On Windows -```commandline -python -m venv venv -venv/Scripts/activate -``` - 3. Change to the `application/` subdir and install dependencies for the backend: ```commandline pip install -r application/requirements.txt From 6f8394a086aa4c67c4c49e8af7a877e3feda7c18 Mon Sep 17 00:00:00 2001 From: KRISH SONI <67964054+krishvsoni@users.noreply.github.com> Date: Sat, 7 Oct 2023 20:00:17 +0530 Subject: [PATCH 21/46] git commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3481ab6a..e62f4bd5 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,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 official Python documentation for virtual environments [here](https://docs.python.org/3/tutorial/venv.html). +You can follow the [Python official documentation](https://docs.python.org/3/tutorial/venv.html) for virtual environments . 3. Change to the `application/` subdir and install dependencies for the backend: ```commandline From dd6e018e46a934d88f36627f1c0f16d9d77303fd Mon Sep 17 00:00:00 2001 From: KRISH SONI <67964054+krishvsoni@users.noreply.github.com> Date: Sat, 7 Oct 2023 20:09:48 +0530 Subject: [PATCH 22/46] Update README.md --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e62f4bd5..707ed10f 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,18 @@ Make sure you have Python 3.10 or 3.11 installed. 2. (optional) Create a Python virtual environment: You can follow the [Python official documentation](https://docs.python.org/3/tutorial/venv.html) for virtual environments . -3. Change to the `application/` subdir and install dependencies for the backend: +a) On Mac OS and Linux +```commandline +python -m venv venv +. venv/bin/activate +``` +b) On Windows +```commandline +python -m venv venv + venv/Scripts/activate +``` + +4. Change to the `application/` subdir and install dependencies for the backend: ```commandline pip install -r application/requirements.txt ``` From b983095e130435f0c0707f83d144240a56a66516 Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 7 Oct 2023 22:47:21 +0800 Subject: [PATCH 23/46] Fix About page to Conversation navigation --- frontend/src/Navigation.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 9507cfe1..aa1367a6 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -1,5 +1,5 @@ import { useEffect, useRef, useState } from 'react'; -import { NavLink } from 'react-router-dom'; +import { NavLink, useNavigate } from 'react-router-dom'; import Arrow1 from './assets/arrow.svg'; import Arrow2 from './assets/dropdown-arrow.svg'; import Exit from './assets/exit.svg'; @@ -60,6 +60,8 @@ export default function Navigation() { const embeddingsName = import.meta.env.VITE_EMBEDDINGS_NAME || 'openai_text-embedding-ada-002'; + const navigate = useNavigate(); + useEffect(() => { if (!conversations) { getConversations() @@ -111,6 +113,7 @@ export default function Navigation() { }) .then((response) => response.json()) .then((data) => { + navigate('/'); dispatch(setConversation(data)); dispatch( updateConversationId({ From b0085f274179d889033bc7925ceabfa3b5d33094 Mon Sep 17 00:00:00 2001 From: Ankit Matth Date: Sat, 7 Oct 2023 20:42:32 +0530 Subject: [PATCH 24/46] Color of all buttons and elements changed from blue to #7D54D1 --- docs/pages/Developing/API-docs.md | 2 +- extensions/chrome/popup.html | 4 ++-- extensions/chrome/popup.js | 2 +- frontend/src/conversation/ConversationBubble.tsx | 6 +++--- frontend/src/upload/Upload.tsx | 10 +++++----- frontend/tailwind.config.cjs | 1 + 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/pages/Developing/API-docs.md b/docs/pages/Developing/API-docs.md index 25838742..eabd29c0 100644 --- a/docs/pages/Developing/API-docs.md +++ b/docs/pages/Developing/API-docs.md @@ -73,7 +73,7 @@ HTML example: - diff --git a/extensions/chrome/popup.html b/extensions/chrome/popup.html index 432d31ae..98921086 100644 --- a/extensions/chrome/popup.html +++ b/extensions/chrome/popup.html @@ -20,7 +20,7 @@

-
+

How to create API key for Api gateway?

@@ -46,7 +46,7 @@
- +
diff --git a/extensions/chrome/popup.js b/extensions/chrome/popup.js index 20f7bce3..70b7415d 100644 --- a/extensions/chrome/popup.js +++ b/extensions/chrome/popup.js @@ -3,7 +3,7 @@ document.getElementById("message-form").addEventListener("submit", function(even var message = document.getElementById("message-input").value; chrome.runtime.sendMessage({msg: "sendMessage", message: message}, function(response) { console.log(response.response); - msg_html = '

' + msg_html = '

' msg_html += message msg_html += '

' document.getElementById("messages").innerHTML += msg_html; diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 2793a9bf..37349660 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -42,7 +42,7 @@ const ConversationBubble = forwardRef< bubble = (
-
+
{message} @@ -148,7 +148,7 @@ const ConversationBubble = forwardRef< handleFeedback?.('LIKE')} @@ -173,7 +173,7 @@ const ConversationBubble = forwardRef<
{sources && openSource !== null && sources[openSource] && ( -
+

Source: {sources[openSource].title}

diff --git a/frontend/src/upload/Upload.tsx b/frontend/src/upload/Upload.tsx index 0edc971b..755a9ad4 100644 --- a/frontend/src/upload/Upload.tsx +++ b/frontend/src/upload/Upload.tsx @@ -41,9 +41,9 @@ export default function Upload({

{progress?.percentage || 0}%

-
+
@@ -55,7 +55,7 @@ export default function Upload({ setProgress(undefined); setModalState('INACTIVE'); }} - className={`rounded-3xl bg-blue-3000 px-4 py-2 text-sm font-medium text-white ${ + className={`rounded-3xl bg-purple-30 px-4 py-2 text-sm font-medium text-white ${ isCancellable ? '' : 'hidden' }`} > @@ -189,7 +189,7 @@ export default function Upload({ Name
- + Choose Files @@ -206,7 +206,7 @@ export default function Upload({
diff --git a/frontend/tailwind.config.cjs b/frontend/tailwind.config.cjs index 64fb76f2..8e395a07 100644 --- a/frontend/tailwind.config.cjs +++ b/frontend/tailwind.config.cjs @@ -24,6 +24,7 @@ module.exports = { 'blue-1000': '#7D54D1', 'blue-2000': '#002B49', 'blue-3000': '#4B02E2', + 'purple-30': '#7D54D1', 'blue-4000': 'rgba(0, 125, 255, 0.36)', 'blue-5000': 'rgba(0, 125, 255)', }, From 5ca5e0d00fd0e6b29b41479b28e4f2eb775ba428 Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Sat, 7 Oct 2023 21:22:48 +0530 Subject: [PATCH 25/46] Revert "synced the branch" This reverts commit 0585fb4c8098615213d2f55cde77063ca2fffffb. --- frontend/src/Hero.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index 0644da67..8ed80fcf 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -48,7 +48,7 @@ export default function Hero({ className = '' }: { className?: string }) {
-
+
lock Date: Sat, 7 Oct 2023 21:40:29 +0530 Subject: [PATCH 26/46] git commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 707ed10f..172c075b 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ python -m venv venv venv/Scripts/activate ``` -4. Change to the `application/` subdir and install dependencies for the backend: +3. Change to the `application/` subdir and install dependencies for the backend: ```commandline pip install -r application/requirements.txt ``` From d261ed074e64ac15281a906c27db0ead794886da Mon Sep 17 00:00:00 2001 From: ankur0904 Date: Sat, 7 Oct 2023 23:54:47 +0530 Subject: [PATCH 27/46] Make text bold --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b759fd46..b83ed691 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,13 +6,13 @@ Thank you for choosing this project to contribute to. We are all very grateful! # We accept different types of contributions -πŸ“£ Discussions - where you can start a new topic or answer some questions +πŸ“£ **Discussions** - where you can start a new topic or answer some questions -🐞 Issues - This is how we track tasks, sometimes it is bugs that need fixing, and sometimes it is new features +🐞 **Issues** - This is how we track tasks, sometimes it is bugs that need fixing, and sometimes it is 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** - This is how you can suggest changes to our repository, to work on existing issues or add new features -πŸ“š Wiki - where we have our documentation +πŸ“š **Wiki** - where we have our documentation ## 🐞 Issues and Pull requests From accd65a26ab47114852fc295d5af6097e267e341 Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Sun, 8 Oct 2023 05:27:03 +0530 Subject: [PATCH 28/46] 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 29/46] 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 30/46] 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 14:17:26 +0530 Subject: [PATCH 31/46] 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 32/46] 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 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 33/46] 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 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 34/46] 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 35/46] 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 36/46] 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 37/46] 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 38/46] 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 39/46] 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 40/46] 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 41/46] 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 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 42/46] 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 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 43/46] 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 44/46] 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 45/46] 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 3197c356e9e9c5cd4ee0c27177e73cf1a6401637 Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Mon, 9 Oct 2023 02:36:48 +0530 Subject: [PATCH 46/46] 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)} - >