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/114] Update README.md --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index aba1401..b734af6 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 261c9eefe1e30542bfd096d9f8a17776e6916287 Mon Sep 17 00:00:00 2001 From: SoumyadiptoPal Date: Fri, 6 Oct 2023 02:10:21 +0530 Subject: [PATCH 002/114] 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 29f2bd2..4802ab8 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 cb5d021..260639b 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 0000000..ca54be7 --- /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 0000000..15e93c4 --- /dev/null +++ b/frontend/src/assets/github.svg @@ -0,0 +1,5 @@ + + github + + + \ No newline at end of file From 4f5e363452862406034b61a2cf80f6d5b5f0966a Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 6 Oct 2023 01:52:29 +0100 Subject: [PATCH 003/114] sagemaker streaming --- application/core/settings.py | 6 ++ application/llm/sagemaker.py | 134 ++++++++++++++++++++++++++++++++--- 2 files changed, 130 insertions(+), 10 deletions(-) diff --git a/application/core/settings.py b/application/core/settings.py index a05fd00..116735a 100644 --- a/application/core/settings.py +++ b/application/core/settings.py @@ -32,6 +32,12 @@ class Settings(BaseSettings): ELASTIC_URL: str = None # url for elasticsearch ELASTIC_INDEX: str = "docsgpt" # index name for elasticsearch + # SageMaker config + SAGEMAKER_ENDPOINT: str = None # SageMaker endpoint name + SAGEMAKER_REGION: str = None # SageMaker region name + SAGEMAKER_ACCESS_KEY: str = None # SageMaker access key + SAGEMAKER_SECRET_KEY: str = None # SageMaker secret key + path = Path(__file__).parent.parent.absolute() settings = Settings(_env_file=path.joinpath(".env"), _env_file_encoding="utf-8") diff --git a/application/llm/sagemaker.py b/application/llm/sagemaker.py index 9ef5d0a..55617cc 100644 --- a/application/llm/sagemaker.py +++ b/application/llm/sagemaker.py @@ -2,26 +2,140 @@ from application.llm.base import BaseLLM from application.core.settings import settings import requests import json +import io +import json + + + +class LineIterator: + """ + A helper class for parsing the byte stream input. + + The output of the model will be in the following format: + ``` + b'{"outputs": [" a"]}\n' + b'{"outputs": [" challenging"]}\n' + b'{"outputs": [" problem"]}\n' + ... + ``` + + While usually each PayloadPart event from the event stream will contain a byte array + with a full json, this is not guaranteed and some of the json objects may be split across + PayloadPart events. For example: + ``` + {'PayloadPart': {'Bytes': b'{"outputs": '}} + {'PayloadPart': {'Bytes': b'[" problem"]}\n'}} + ``` + + This class accounts for this by concatenating bytes written via the 'write' function + and then exposing a method which will return lines (ending with a '\n' character) within + the buffer via the 'scan_lines' function. It maintains the position of the last read + position to ensure that previous bytes are not exposed again. + """ + + def __init__(self, stream): + self.byte_iterator = iter(stream) + self.buffer = io.BytesIO() + self.read_pos = 0 + + def __iter__(self): + return self + + def __next__(self): + while True: + self.buffer.seek(self.read_pos) + line = self.buffer.readline() + if line and line[-1] == ord('\n'): + self.read_pos += len(line) + return line[:-1] + try: + chunk = next(self.byte_iterator) + except StopIteration: + if self.read_pos < self.buffer.getbuffer().nbytes: + continue + raise + if 'PayloadPart' not in chunk: + print('Unknown event type:' + chunk) + continue + self.buffer.seek(0, io.SEEK_END) + self.buffer.write(chunk['PayloadPart']['Bytes']) class SagemakerAPILLM(BaseLLM): def __init__(self, *args, **kwargs): - self.url = settings.SAGEMAKER_API_URL + import boto3 + runtime = boto3.client( + 'runtime.sagemaker', + aws_access_key_id=settings.SAGEMAKER_ACCESS_KEY, + aws_secret_access_key=settings.SAGEMAKER_SECRET_KEY, + region_name=settings.SAGEMAKER_REGION + ) + + + self.endpoint = settings.SAGEMAKER_ENDPOINT + self.runtime = runtime + def gen(self, model, engine, messages, stream=False, **kwargs): context = messages[0]['content'] user_question = messages[-1]['content'] prompt = f"### Instruction \n {user_question} \n ### Context \n {context} \n ### Answer \n" + - response = requests.post( - url=self.url, - headers={ - "Content-Type": "application/json; charset=utf-8", - }, - data=json.dumps({"input": prompt}) - ) + # Construct payload for endpoint + payload = { + "inputs": prompt, + "stream": False, + "parameters": { + "do_sample": True, + "temperature": 0.1, + "max_new_tokens": 30, + "repetition_penalty": 1.03, + "stop": ["", "###"] + } + } + body_bytes = json.dumps(payload).encode('utf-8') - return response.json()['answer'] + # Invoke the endpoint + response = self.runtime.invoke_endpoint(EndpointName=self.endpoint, + ContentType='application/json', + Body=body_bytes) + result = json.loads(response['Body'].read().decode()) + import sys + print(result[0]['generated_text'], file=sys.stderr) + return result[0]['generated_text'][len(prompt):] def gen_stream(self, model, engine, messages, stream=True, **kwargs): - raise NotImplementedError("Sagemaker does not support streaming") \ No newline at end of file + context = messages[0]['content'] + user_question = messages[-1]['content'] + prompt = f"### Instruction \n {user_question} \n ### Context \n {context} \n ### Answer \n" + + + # Construct payload for endpoint + payload = { + "inputs": prompt, + "stream": True, + "parameters": { + "do_sample": True, + "temperature": 0.1, + "max_new_tokens": 512, + "repetition_penalty": 1.03, + "stop": ["", "###"] + } + } + body_bytes = json.dumps(payload).encode('utf-8') + + # Invoke the endpoint + response = self.runtime.invoke_endpoint_with_response_stream(EndpointName=self.endpoint, + ContentType='application/json', + Body=body_bytes) + #result = json.loads(response['Body'].read().decode()) + event_stream = response['Body'] + start_json = b'{' + for line in LineIterator(event_stream): + if line != b'' and start_json in line: + #print(line) + data = json.loads(line[line.find(start_json):].decode('utf-8')) + if data['token']['text'] not in ["", "###"]: + print(data['token']['text'],end='') + yield data['token']['text'] \ 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 004/114] 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 24da813..07494e7 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 005/114] 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 07494e7..034fe80 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 13:22:51 +0100 Subject: [PATCH 006/114] sagemaker fixes + test --- application/llm/sagemaker.py | 2 - tests/llm/test_sagemaker.py | 96 ++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 tests/llm/test_sagemaker.py diff --git a/application/llm/sagemaker.py b/application/llm/sagemaker.py index 55617cc..ed5fc67 100644 --- a/application/llm/sagemaker.py +++ b/application/llm/sagemaker.py @@ -1,9 +1,7 @@ from application.llm.base import BaseLLM from application.core.settings import settings -import requests import json import io -import json diff --git a/tests/llm/test_sagemaker.py b/tests/llm/test_sagemaker.py new file mode 100644 index 0000000..f8d02d8 --- /dev/null +++ b/tests/llm/test_sagemaker.py @@ -0,0 +1,96 @@ +# FILEPATH: /path/to/test_sagemaker.py + +import json +import unittest +from unittest.mock import MagicMock, patch +from application.llm.sagemaker import SagemakerAPILLM, LineIterator + +class TestSagemakerAPILLM(unittest.TestCase): + + def setUp(self): + self.sagemaker = SagemakerAPILLM() + self.context = "This is the context" + self.user_question = "What is the answer?" + self.messages = [ + {"content": self.context}, + {"content": "Some other message"}, + {"content": self.user_question} + ] + self.prompt = f"### Instruction \n {self.user_question} \n ### Context \n {self.context} \n ### Answer \n" + self.payload = { + "inputs": self.prompt, + "stream": False, + "parameters": { + "do_sample": True, + "temperature": 0.1, + "max_new_tokens": 30, + "repetition_penalty": 1.03, + "stop": ["", "###"] + } + } + self.payload_stream = { + "inputs": self.prompt, + "stream": True, + "parameters": { + "do_sample": True, + "temperature": 0.1, + "max_new_tokens": 512, + "repetition_penalty": 1.03, + "stop": ["", "###"] + } + } + self.body_bytes = json.dumps(self.payload).encode('utf-8') + self.body_bytes_stream = json.dumps(self.payload_stream).encode('utf-8') + self.response = { + "Body": MagicMock() + } + self.result = [ + { + "generated_text": "This is the generated text" + } + ] + self.response['Body'].read.return_value.decode.return_value = json.dumps(self.result) + + def test_gen(self): + with patch.object(self.sagemaker.runtime, 'invoke_endpoint', + return_value=self.response) as mock_invoke_endpoint: + output = self.sagemaker.gen(None, None, self.messages) + mock_invoke_endpoint.assert_called_once_with( + EndpointName=self.sagemaker.endpoint, + ContentType='application/json', + Body=self.body_bytes + ) + self.assertEqual(output, + self.result[0]['generated_text'][len(self.prompt):]) + + def test_gen_stream(self): + with patch.object(self.sagemaker.runtime, 'invoke_endpoint_with_response_stream', + return_value=self.response) as mock_invoke_endpoint: + output = list(self.sagemaker.gen_stream(None, None, self.messages)) + mock_invoke_endpoint.assert_called_once_with( + EndpointName=self.sagemaker.endpoint, + ContentType='application/json', + Body=self.body_bytes_stream + ) + self.assertEqual(output, []) + +class TestLineIterator(unittest.TestCase): + + def setUp(self): + self.stream = [ + {'PayloadPart': {'Bytes': b'{"outputs": [" a"]}\n'}}, + {'PayloadPart': {'Bytes': b'{"outputs": [" challenging"]}\n'}}, + {'PayloadPart': {'Bytes': b'{"outputs": [" problem"]}\n'}} + ] + self.line_iterator = LineIterator(self.stream) + + def test_iter(self): + self.assertEqual(iter(self.line_iterator), self.line_iterator) + + def test_next(self): + self.assertEqual(next(self.line_iterator), b'{"outputs": [" a"]}') + self.assertEqual(next(self.line_iterator), b'{"outputs": [" challenging"]}') + self.assertEqual(next(self.line_iterator), b'{"outputs": [" problem"]}') + +if __name__ == '__main__': + unittest.main() \ No newline at end of file From 245e09c723d2317a213e082851757723c4f01470 Mon Sep 17 00:00:00 2001 From: mohitd404 <146939900+mohitd404@users.noreply.github.com> Date: Fri, 6 Oct 2023 18:01:50 +0530 Subject: [PATCH 007/114] 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 aba1401..f9a04ae 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 b3a0368b952c58f0cb77302dbd97809ad2398aa9 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 6 Oct 2023 13:54:03 +0100 Subject: [PATCH 008/114] Update app.py --- application/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/app.py b/application/app.py index e97febc..ae61997 100644 --- a/application/app.py +++ b/application/app.py @@ -27,7 +27,10 @@ celery.config_from_object("application.celeryconfig") @app.route("/") def home(): - return redirect('http://localhost:5173') if request.remote_addr in ('0.0.0.0', '127.0.0.1', 'localhost', '172.18.0.1') else 'Welcome to DocsGPT Backend!' + if request.remote_addr in ('0.0.0.0', '127.0.0.1', 'localhost', '172.18.0.1'): + return redirect('http://localhost:5173') + else: + return 'Welcome to DocsGPT Backend!' @app.after_request def after_request(response): From 43a22f84d9c934ee1aa11481acf55eb70e2b1bd4 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 6 Oct 2023 14:43:05 +0100 Subject: [PATCH 009/114] Update sagemaker.py --- application/llm/sagemaker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/llm/sagemaker.py b/application/llm/sagemaker.py index ed5fc67..84ae09a 100644 --- a/application/llm/sagemaker.py +++ b/application/llm/sagemaker.py @@ -64,9 +64,9 @@ class SagemakerAPILLM(BaseLLM): import boto3 runtime = boto3.client( 'runtime.sagemaker', - aws_access_key_id=settings.SAGEMAKER_ACCESS_KEY, - aws_secret_access_key=settings.SAGEMAKER_SECRET_KEY, - region_name=settings.SAGEMAKER_REGION + aws_access_key_id='xxx', + aws_secret_access_key='xxx', + region_name='us-west-2' ) From 86c2f0716ea16ccc5c8d7179060147cf70859ae5 Mon Sep 17 00:00:00 2001 From: Adarsh Jha <132337675+adarsh-jha-dev@users.noreply.github.com> Date: Fri, 6 Oct 2023 19:36:48 +0530 Subject: [PATCH 010/114] Update conversationSlice.ts --- frontend/src/conversation/conversationSlice.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/conversation/conversationSlice.ts b/frontend/src/conversation/conversationSlice.ts index d1d4e19..ffe402b 100644 --- a/frontend/src/conversation/conversationSlice.ts +++ b/frontend/src/conversation/conversationSlice.ts @@ -142,14 +142,14 @@ export const conversationSlice = createSlice({ state, action: PayloadAction<{ index: number; query: Partial }>, ) { - const index = action.payload.index; - if (action.payload.query.response) { + const { index, query } = action.payload; + if (query.response) { state.queries[index].response = - (state.queries[index].response || '') + action.payload.query.response; + (state.queries[index].response || '') + query.response; } else { state.queries[index] = { ...state.queries[index], - ...action.payload.query, + ...query, }; } }, @@ -163,21 +163,21 @@ export const conversationSlice = createSlice({ state, action: PayloadAction<{ index: number; query: Partial }>, ) { - const index = action.payload.index; + const { index, query } = action.payload; if (!state.queries[index].sources) { - state.queries[index].sources = [action.payload.query.sources![0]]; + state.queries[index].sources = [query.sources![0]]; } else { - state.queries[index].sources!.push(action.payload.query.sources![0]); + state.queries[index].sources!.push(query.sources![0]); } }, updateQuery( state, action: PayloadAction<{ index: number; query: Partial }>, ) { - const index = action.payload.index; + const { index, query } = action.payload; state.queries[index] = { ...state.queries[index], - ...action.payload.query, + ...query, }; }, setStatus(state, action: PayloadAction) { From 32ea0213f7bcf05268b6e75953bb6d8212cf5fcd Mon Sep 17 00:00:00 2001 From: John Bampton Date: Fri, 6 Oct 2023 23:49:22 +1000 Subject: [PATCH 011/114] Remove unneeded duplicate words --- application/parser/file/html_parser.py | 2 +- docs/pages/Guides/How-to-train-on-other-documentation.md | 2 +- extensions/react-widget/dist/index.es.js | 2 +- extensions/react-widget/dist/index.es.js.map | 2 +- extensions/react-widget/dist/index.umd.js | 2 +- extensions/react-widget/dist/index.umd.js.map | 2 +- scripts/parser/file/html_parser.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/application/parser/file/html_parser.py b/application/parser/file/html_parser.py index 7c192b6..2a74a97 100644 --- a/application/parser/file/html_parser.py +++ b/application/parser/file/html_parser.py @@ -57,7 +57,7 @@ class HTMLParser(BaseParser): title_indexes = [i for i, isd_el in enumerate(isd) if isd_el['type'] == 'Title'] # Creating 'Chunks' - List of lists of strings - # each list starting with with isd_el['type'] = 'Title' and all the data till the next 'Title' + # each list starting with isd_el['type'] = 'Title' and all the data till the next 'Title' # Each Chunk can be thought of as an individual set of data, which can be sent to the model # Where Each Title is grouped together with the data under it 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 c9549ae..9f4e503 100644 --- a/docs/pages/Guides/How-to-train-on-other-documentation.md +++ b/docs/pages/Guides/How-to-train-on-other-documentation.md @@ -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 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] | diff --git a/extensions/react-widget/dist/index.es.js b/extensions/react-widget/dist/index.es.js index e63a3d2..3bf3cfb 100644 --- a/extensions/react-widget/dist/index.es.js +++ b/extensions/react-widget/dist/index.es.js @@ -366,7 +366,7 @@ function fr() { } function ye(e) { if (Je(e)) - return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qe(e)), ge(e); + return g("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", qe(e)), ge(e); } var W = O.ReactCurrentOwner, Be = { key: !0, diff --git a/extensions/react-widget/dist/index.es.js.map b/extensions/react-widget/dist/index.es.js.map index 77e8ba4..a4c7a98 100644 --- a/extensions/react-widget/dist/index.es.js.map +++ b/extensions/react-widget/dist/index.es.js.map @@ -1 +1 @@ -{"version":3,"file":"index.es.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/components/DocsGPTWidget.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, attribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.

\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","\"use client\";\nimport {useEffect, useRef, useState} from 'react'\n//import './style.css'\n\ninterface HistoryItem {\n prompt: string;\n response: string;\n}\n\ninterface FetchAnswerStreamingProps {\n question?: string;\n apiKey?: string;\n selectedDocs?: string;\n history?: HistoryItem[];\n conversationId?: string | null;\n apiHost?: string;\n onEvent?: (event: MessageEvent) => void;\n}\n\n\nenum ChatStates {\n Init = 'init',\n Processing = 'processing',\n Typing = 'typing',\n Answer = 'answer',\n Minimized = 'minimized',\n}\n\nfunction fetchAnswerStreaming({\n question = '',\n apiKey = '',\n selectedDocs = '',\n history = [],\n conversationId = null,\n apiHost = '',\n onEvent = () => {console.log(\"Event triggered, but no handler provided.\");}\n}: FetchAnswerStreamingProps): Promise {\n let docPath = 'default';\n if (selectedDocs) {\n docPath = selectedDocs;\n }\n\n return new Promise((resolve, reject) => {\n const body = {\n question: question,\n api_key: apiKey,\n embeddings_key: apiKey,\n active_docs: docPath,\n history: JSON.stringify(history),\n conversation_id: conversationId,\n model: 'default'\n };\n\n fetch(apiHost + '/stream', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n })\n .then((response) => {\n if (!response.body) throw Error('No response body');\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder('utf-8');\n let counterrr = 0;\n const processStream = ({\n done,\n value,\n }: ReadableStreamReadResult) => {\n if (done) {\n console.log(counterrr);\n resolve();\n return;\n }\n\n counterrr += 1;\n\n const chunk = decoder.decode(value);\n\n const lines = chunk.split('\\n');\n\n for (let line of lines) {\n if (line.trim() == '') {\n continue;\n }\n if (line.startsWith('data:')) {\n line = line.substring(5);\n }\n\n const messageEvent = new MessageEvent('message', {\n data: line,\n });\n\n onEvent(messageEvent); // handle each message\n }\n\n reader.read().then(processStream).catch(reject);\n };\n\n reader.read().then(processStream).catch(reject);\n })\n .catch((error) => {\n console.error('Connection failed:', error);\n reject(error);\n });\n });\n}\n\nexport const DocsGPTWidget = ({ apiHost = 'https://gptcloud.arc53.com', selectDocs = 'default', apiKey = 'docsgpt-public'}) => {\n // processing states\n const [chatState, setChatState] = useState(() => {\n if (typeof window !== 'undefined') {\n return localStorage.getItem('docsGPTChatState') as ChatStates || ChatStates.Init;\n }\n return ChatStates.Init;\n });\n\n const [answer, setAnswer] = useState('');\n\n //const selectDocs = 'local/1706.03762.pdf/'\n const answerRef = useRef(null);\n\n useEffect(() => {\n if (answerRef.current) {\n const element = answerRef.current;\n element.scrollTop = element.scrollHeight;\n }\n }, [answer]);\n\n useEffect(() => {\n localStorage.setItem('docsGPTChatState', chatState);\n }, [chatState]);\n\n\n\n // submit handler\n const handleSubmit = (e: React.FormEvent) => {\n setAnswer('')\n e.preventDefault()\n // get question\n setChatState(ChatStates.Processing)\n setTimeout(() => {\n setChatState(ChatStates.Answer)\n }, 800)\n const inputElement = e.currentTarget[0] as HTMLInputElement;\n const questionValue = inputElement.value;\n\n fetchAnswerStreaming({\n question: questionValue,\n apiKey: apiKey,\n selectedDocs: selectDocs,\n history: [],\n conversationId: null,\n apiHost: apiHost,\n onEvent: (event) => {\n const data = JSON.parse(event.data);\n\n // check if the 'end' event has been received\n if (data.type === 'end') {\n setChatState(ChatStates.Answer)\n } else if (data.type === 'source') {\n // check if data.metadata exists\n let result;\n if (data.metadata && data.metadata.title) {\n const titleParts = data.metadata.title.split('/');\n result = {\n title: titleParts[titleParts.length - 1],\n text: data.doc,\n };\n } else {\n result = { title: data.doc, text: data.doc };\n }\n console.log(result)\n\n } else if (data.type === 'id') {\n console.log(data.id);\n } else {\n const result = data.answer;\n // set answer by appending answer\n setAnswer(prevAnswer => prevAnswer + result);\n }\n },\n });\n }\n\n return (\n <>\n
\n
setChatState(ChatStates.Init)}\n className={`${chatState !== 'minimized' ? 'hidden' : ''} cursor-pointer`}>\n
\n \n
\n
\n
\n
\n {\n event.stopPropagation();\n setChatState(ChatStates.Minimized);\n }}\n />\n
\n
\n

Need help with documentation?

\n

DocsGPT AI assistant will help you with docs

\n
\n
\n

{answer}

\n
\n
\n
\n
\n \n { (chatState === 'typing' || chatState === 'answer') && (\n \n \n \n \n )}\n

\n Processing...\n

\n
\n
\n
\n\n \n )\n}"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","React","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactSharedInternals","error","format","_len2","args","_key2","printWarning","level","ReactDebugCurrentFrame","stack","argsWithFormat","item","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","REACT_MODULE_REFERENCE","isValidElementType","type","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","context","provider","outerName","lazyComponent","payload","init","assign","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","props","reenableLogs","ReactCurrentDispatcher","prefix","describeBuiltInComponentFrame","name","source","ownerFn","x","match","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","Component","prototype","describeUnknownElementTypeFrameInDEV","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","checkPropTypes","typeSpecs","values","location","componentName","has","typeSpecName","error$1","err","ex","isArrayImpl","isArray","typeName","value","hasToStringTag","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","ReactCurrentOwner","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","didWarnAboutStringRefs","hasValidRef","config","getter","hasValidKey","warnIfStringRefCannotBeAutoConverted","self","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","ReactElement","key","ref","jsxDEV","maybeKey","propName","defaultProps","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","isValidElement","object","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","fileName","lineNumber","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","info","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","i","child","iteratorFn","iterator","step","validatePropTypes","propTypes","_name","validateFragmentProps","fragment","keys","jsxWithValidation","isStaticChildren","validType","sourceInfo","typeString","children","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","jsxRuntimeModule","require$$1","fetchAnswerStreaming","question","apiKey","selectedDocs","history","conversationId","apiHost","onEvent","docPath","resolve","reject","body","response","reader","decoder","counterrr","processStream","done","lines","line","messageEvent","DocsGPTWidget","selectDocs","chatState","setChatState","useState","answer","setAnswer","answerRef","useRef","useEffect","handleSubmit","questionValue","event","data","result","titleParts","prevAnswer","Fragment"],"mappings":";;;;;;;;;;;;;;;;AASa,MAAIA,IAAEC,IAAiBC,IAAE,OAAO,IAAI,eAAe,GAAEC,IAAE,OAAO,IAAI,gBAAgB,GAAEC,IAAE,OAAO,UAAU,gBAAeC,IAAEL,EAAE,mDAAmD,mBAAkBM,IAAE,EAAC,KAAI,IAAG,KAAI,IAAG,QAAO,IAAG,UAAS,GAAE;AAClP,WAASC,EAAEC,GAAEC,GAAEC,GAAE;AAAC,QAAIC,GAAEC,IAAE,IAAGC,IAAE,MAAKC,IAAE;AAAK,IAASJ,MAAT,WAAaG,IAAE,KAAGH,IAAYD,EAAE,QAAX,WAAiBI,IAAE,KAAGJ,EAAE,MAAcA,EAAE,QAAX,WAAiBK,IAAEL,EAAE;AAAK,SAAIE,KAAKF;AAAE,MAAAL,EAAE,KAAKK,GAAEE,CAAC,KAAG,CAACL,EAAE,eAAeK,CAAC,MAAIC,EAAED,CAAC,IAAEF,EAAEE,CAAC;AAAG,QAAGH,KAAGA,EAAE;AAAa,WAAIG,KAAKF,IAAED,EAAE,cAAaC;AAAE,QAASG,EAAED,CAAC,MAAZ,WAAgBC,EAAED,CAAC,IAAEF,EAAEE,CAAC;AAAG,WAAM,EAAC,UAAST,GAAE,MAAKM,GAAE,KAAIK,GAAE,KAAIC,GAAE,OAAMF,GAAE,QAAOP,EAAE,QAAO;AAAA,EAAC;AAAC,SAAAU,aAAiBZ,GAAEY,EAAW,MAACR,GAAEQ,EAAA,OAAaR;;;;;;;;;;;;;;wBCEtW,QAAQ,IAAI,aAAa,gBAC1B,WAAW;AAGd,QAAIS,IAAQf,IAMRgB,IAAqB,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,UAAC;AAAA,UAAA;AAAA,YACG,UAAUmC;AAAA,YACV,WAAU;AAAA,YAAsB,OAAO,EAAE,SAAS,EAAE;AAAA,YACtD,UAAA;AAAA,cAAApC,gBAAAA,EAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBAAM,MAAK;AAAA,kBACL,WAAU;AAAA,kBAAgG,aAAY;AAAA,gBAAA;AAAA,cAA0B;AAAA,oCACtJ,UAAO,EAAA,WAAU,kFAAiF,MAAK,UAAU,UAAM,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAC1H;AAAA,QAEFC,gBAAAA,EAAAA,KAAC,OAAE,WAAW,GAAG2B,MAAc,eAAe,WAAW,EAAE,2HAA2H,UAAA;AAAA,UAAA;AAAA,UACzK5B,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,iBAAgB,UAAC,KAAA;AAAA,UAAQA,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,2BAA0B,UAAC,KAAA;AAAA,UAAQA,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,2BAA0B,UAAC,KAAA;AAAA,QAAA,GACjJ;AAAA,MAAA,GACF;AAAA,IAAA,GACF;AAAA,EAAA,EACF,CAAA,EAEA,CAAA;AAEJ;","x_google_ignoreList":[0,1,2]} +{"version":3,"file":"index.es.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/components/DocsGPTWidget.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, attribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","\"use client\";\nimport {useEffect, useRef, useState} from 'react'\n//import './style.css'\n\ninterface HistoryItem {\n prompt: string;\n response: string;\n}\n\ninterface FetchAnswerStreamingProps {\n question?: string;\n apiKey?: string;\n selectedDocs?: string;\n history?: HistoryItem[];\n conversationId?: string | null;\n apiHost?: string;\n onEvent?: (event: MessageEvent) => void;\n}\n\n\nenum ChatStates {\n Init = 'init',\n Processing = 'processing',\n Typing = 'typing',\n Answer = 'answer',\n Minimized = 'minimized',\n}\n\nfunction fetchAnswerStreaming({\n question = '',\n apiKey = '',\n selectedDocs = '',\n history = [],\n conversationId = null,\n apiHost = '',\n onEvent = () => {console.log(\"Event triggered, but no handler provided.\");}\n}: FetchAnswerStreamingProps): Promise {\n let docPath = 'default';\n if (selectedDocs) {\n docPath = selectedDocs;\n }\n\n return new Promise((resolve, reject) => {\n const body = {\n question: question,\n api_key: apiKey,\n embeddings_key: apiKey,\n active_docs: docPath,\n history: JSON.stringify(history),\n conversation_id: conversationId,\n model: 'default'\n };\n\n fetch(apiHost + '/stream', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n })\n .then((response) => {\n if (!response.body) throw Error('No response body');\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder('utf-8');\n let counterrr = 0;\n const processStream = ({\n done,\n value,\n }: ReadableStreamReadResult) => {\n if (done) {\n console.log(counterrr);\n resolve();\n return;\n }\n\n counterrr += 1;\n\n const chunk = decoder.decode(value);\n\n const lines = chunk.split('\\n');\n\n for (let line of lines) {\n if (line.trim() == '') {\n continue;\n }\n if (line.startsWith('data:')) {\n line = line.substring(5);\n }\n\n const messageEvent = new MessageEvent('message', {\n data: line,\n });\n\n onEvent(messageEvent); // handle each message\n }\n\n reader.read().then(processStream).catch(reject);\n };\n\n reader.read().then(processStream).catch(reject);\n })\n .catch((error) => {\n console.error('Connection failed:', error);\n reject(error);\n });\n });\n}\n\nexport const DocsGPTWidget = ({ apiHost = 'https://gptcloud.arc53.com', selectDocs = 'default', apiKey = 'docsgpt-public'}) => {\n // processing states\n const [chatState, setChatState] = useState(() => {\n if (typeof window !== 'undefined') {\n return localStorage.getItem('docsGPTChatState') as ChatStates || ChatStates.Init;\n }\n return ChatStates.Init;\n });\n\n const [answer, setAnswer] = useState('');\n\n //const selectDocs = 'local/1706.03762.pdf/'\n const answerRef = useRef(null);\n\n useEffect(() => {\n if (answerRef.current) {\n const element = answerRef.current;\n element.scrollTop = element.scrollHeight;\n }\n }, [answer]);\n\n useEffect(() => {\n localStorage.setItem('docsGPTChatState', chatState);\n }, [chatState]);\n\n\n\n // submit handler\n const handleSubmit = (e: React.FormEvent) => {\n setAnswer('')\n e.preventDefault()\n // get question\n setChatState(ChatStates.Processing)\n setTimeout(() => {\n setChatState(ChatStates.Answer)\n }, 800)\n const inputElement = e.currentTarget[0] as HTMLInputElement;\n const questionValue = inputElement.value;\n\n fetchAnswerStreaming({\n question: questionValue,\n apiKey: apiKey,\n selectedDocs: selectDocs,\n history: [],\n conversationId: null,\n apiHost: apiHost,\n onEvent: (event) => {\n const data = JSON.parse(event.data);\n\n // check if the 'end' event has been received\n if (data.type === 'end') {\n setChatState(ChatStates.Answer)\n } else if (data.type === 'source') {\n // check if data.metadata exists\n let result;\n if (data.metadata && data.metadata.title) {\n const titleParts = data.metadata.title.split('/');\n result = {\n title: titleParts[titleParts.length - 1],\n text: data.doc,\n };\n } else {\n result = { title: data.doc, text: data.doc };\n }\n console.log(result)\n\n } else if (data.type === 'id') {\n console.log(data.id);\n } else {\n const result = data.answer;\n // set answer by appending answer\n setAnswer(prevAnswer => prevAnswer + result);\n }\n },\n });\n }\n\n return (\n <>\n
\n
setChatState(ChatStates.Init)}\n className={`${chatState !== 'minimized' ? 'hidden' : ''} cursor-pointer`}>\n
\n \n
\n
\n
\n
\n {\n event.stopPropagation();\n setChatState(ChatStates.Minimized);\n }}\n />\n
\n
\n

Need help with documentation?

\n

DocsGPT AI assistant will help you with docs

\n
\n
\n

{answer}

\n
\n
\n
\n
\n \n { (chatState === 'typing' || chatState === 'answer') && (\n \n \n \n \n )}\n

\n Processing...\n

\n
\n
\n
\n\n \n )\n}"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","React","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactSharedInternals","error","format","_len2","args","_key2","printWarning","level","ReactDebugCurrentFrame","stack","argsWithFormat","item","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","REACT_MODULE_REFERENCE","isValidElementType","type","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","context","provider","outerName","lazyComponent","payload","init","assign","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","props","reenableLogs","ReactCurrentDispatcher","prefix","describeBuiltInComponentFrame","name","source","ownerFn","x","match","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","Component","prototype","describeUnknownElementTypeFrameInDEV","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","checkPropTypes","typeSpecs","values","location","componentName","has","typeSpecName","error$1","err","ex","isArrayImpl","isArray","typeName","value","hasToStringTag","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","ReactCurrentOwner","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","didWarnAboutStringRefs","hasValidRef","config","getter","hasValidKey","warnIfStringRefCannotBeAutoConverted","self","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","ReactElement","key","ref","jsxDEV","maybeKey","propName","defaultProps","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","isValidElement","object","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","fileName","lineNumber","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","info","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","i","child","iteratorFn","iterator","step","validatePropTypes","propTypes","_name","validateFragmentProps","fragment","keys","jsxWithValidation","isStaticChildren","validType","sourceInfo","typeString","children","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","jsxRuntimeModule","require$$1","fetchAnswerStreaming","question","apiKey","selectedDocs","history","conversationId","apiHost","onEvent","docPath","resolve","reject","body","response","reader","decoder","counterrr","processStream","done","lines","line","messageEvent","DocsGPTWidget","selectDocs","chatState","setChatState","useState","answer","setAnswer","answerRef","useRef","useEffect","handleSubmit","questionValue","event","data","result","titleParts","prevAnswer","Fragment"],"mappings":";;;;;;;;;;;;;;;;AASa,MAAIA,IAAEC,IAAiBC,IAAE,OAAO,IAAI,eAAe,GAAEC,IAAE,OAAO,IAAI,gBAAgB,GAAEC,IAAE,OAAO,UAAU,gBAAeC,IAAEL,EAAE,mDAAmD,mBAAkBM,IAAE,EAAC,KAAI,IAAG,KAAI,IAAG,QAAO,IAAG,UAAS,GAAE;AAClP,WAASC,EAAEC,GAAEC,GAAEC,GAAE;AAAC,QAAIC,GAAEC,IAAE,IAAGC,IAAE,MAAKC,IAAE;AAAK,IAASJ,MAAT,WAAaG,IAAE,KAAGH,IAAYD,EAAE,QAAX,WAAiBI,IAAE,KAAGJ,EAAE,MAAcA,EAAE,QAAX,WAAiBK,IAAEL,EAAE;AAAK,SAAIE,KAAKF;AAAE,MAAAL,EAAE,KAAKK,GAAEE,CAAC,KAAG,CAACL,EAAE,eAAeK,CAAC,MAAIC,EAAED,CAAC,IAAEF,EAAEE,CAAC;AAAG,QAAGH,KAAGA,EAAE;AAAa,WAAIG,KAAKF,IAAED,EAAE,cAAaC;AAAE,QAASG,EAAED,CAAC,MAAZ,WAAgBC,EAAED,CAAC,I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AI,EAAA,WAAU,UACb,UAAA;AAAA,QAAAD,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YAAO,SAAS,MAAM6B;AAAA,cAAa;AAAA;AAAA,YAAiB;AAAA,YAC7C,WAAW,sKAAsKD,MAAc,SAAS,WAAW,EAAE;AAAA,YAAI,UAAA;AAAA,UAAA;AAAA,QAEjO;AAAA,SACEA,MAAc,YAAYA,MAAc,aACxC3B,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,UAAUmC;AAAA,YACV,WAAU;AAAA,YAAsB,OAAO,EAAE,SAAS,EAAE;AAAA,YACtD,UAAA;AAAA,cAAApC,gBAAAA,EAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBAAM,MAAK;AAAA,kBACL,WAAU;AAAA,kBAAgG,aAAY;AAAA,gBAAA;AAAA,cAA0B;AAAA,oCACtJ,UAAO,EAAA,WAAU,kFAAiF,MAAK,UAAU,UAAM,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAC1H;AAAA,QAEFC,gBAAAA,EAAAA,KAAC,OAAE,WAAW,GAAG2B,MAAc,eAAe,WAAW,EAAE,2HAA2H,UAAA;AAAA,UAAA;AAAA,UACzK5B,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,iBAAgB,UAAC,KAAA;AAAA,UAAQA,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,2BAA0B,UAAC,KAAA;AAAA,UAAQA,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,2BAA0B,UAAC,KAAA;AAAA,QAAA,GACjJ;AAAA,MAAA,GACF;AAAA,IAAA,GACF;AAAA,EAAA,EACF,CAAA,EAEA,CAAA;AAEJ;","x_google_ignoreList":[0,1,2]} diff --git a/extensions/react-widget/dist/index.umd.js b/extensions/react-widget/dist/index.umd.js index b01917a..33f32c6 100644 --- a/extensions/react-widget/dist/index.umd.js +++ b/extensions/react-widget/dist/index.umd.js @@ -18,7 +18,7 @@ `+Q+e}}var ee=!1,G;{var Ue=typeof WeakMap=="function"?WeakMap:Map;G=new Ue}function ye(e,r){if(!e||ee)return"";{var t=G.get(e);if(t!==void 0)return t}var n;ee=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=Z.current,Z.current=null,Me();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(C){n=C}Reflect.construct(e,[],i)}else{try{i.call()}catch(C){n=C}e.call(i.prototype)}}else{try{throw Error()}catch(C){n=C}e()}}catch(C){if(C&&n&&typeof C.stack=="string"){for(var a=C.stack.split(` `),y=n.stack.split(` `),c=a.length-1,f=y.length-1;c>=1&&f>=0&&a[c]!==y[f];)f--;for(;c>=1&&f>=0;c--,f--)if(a[c]!==y[f]){if(c!==1||f!==1)do if(c--,f--,f<0||a[c]!==y[f]){var _=` -`+a[c].replace(" at new "," at ");return e.displayName&&_.includes("")&&(_=_.replace("",e.displayName)),typeof e=="function"&&G.set(e,_),_}while(c>=1&&f>=0);break}}}finally{ee=!1,Z.current=s,$e(),Error.prepareStackTrace=o}var Y=e?e.displayName||e.name:"",Oe=Y?U(Y):"";return typeof e=="function"&&G.set(e,Oe),Oe}function Ge(e,r,t){return ye(e,!1)}function Be(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function B(e,r,t){if(e==null)return"";if(typeof e=="function")return ye(e,Be(e));if(typeof e=="string")return U(e);switch(e){case v:return U("Suspense");case m:return U("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Ge(e.render);case h:return B(e.type,r,t);case x:{var n=e,o=n._payload,s=n._init;try{return B(s(o),r,t)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,be={},Ee=D.ReactDebugCurrentFrame;function z(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}function Je(e,r,t,n,o){{var s=Function.call.bind(J);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var y=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){a=c}a&&!(a instanceof Error)&&(z(o),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),z(null)),a instanceof Error&&!(a.message in be)&&(be[a.message]=!0,z(o),g("Failed %s type: %s",t,a.message),z(null))}}}var ze=Array.isArray;function re(e){return ze(e)}function qe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return xe(e),!1}catch{return!0}}function xe(e){return""+e}function _e(e){if(He(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qe(e)),xe(e)}var $=D.ReactCurrentOwner,Ke={key:!0,ref:!0,__self:!0,__source:!0},Re,we,te;te={};function Xe(e){if(J.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(J.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){if(typeof e.ref=="string"&&$.current&&r&&$.current.stateNode!==r){var t=k($.current.type);te[t]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',k($.current.type),e.ref),te[t]=!0)}}function er(e,r){{var t=function(){Re||(Re=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){we||(we=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,o,s,i){var a={$$typeof:T,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,o){{var s,i={},a=null,y=null;t!==void 0&&(_e(t),a=""+t),Ze(r)&&(_e(r.key),a=""+r.key),Xe(r)&&(y=r.ref,Qe(r,o));for(s in r)J.call(r,s)&&!Ke.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var c=e.defaultProps;for(s in c)i[s]===void 0&&(i[s]=c[s])}if(a||y){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&er(i,f),y&&rr(i,f)}return tr(e,a,y,o,n,$.current,i)}}var ne=D.ReactCurrentOwner,Te=D.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}var ae;ae=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===T}function Se(){{if(ne.current){var e=k(ne.current.type);if(e)return` +`+a[c].replace(" at new "," at ");return e.displayName&&_.includes("")&&(_=_.replace("",e.displayName)),typeof e=="function"&&G.set(e,_),_}while(c>=1&&f>=0);break}}}finally{ee=!1,Z.current=s,$e(),Error.prepareStackTrace=o}var Y=e?e.displayName||e.name:"",Oe=Y?U(Y):"";return typeof e=="function"&&G.set(e,Oe),Oe}function Ge(e,r,t){return ye(e,!1)}function Be(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function B(e,r,t){if(e==null)return"";if(typeof e=="function")return ye(e,Be(e));if(typeof e=="string")return U(e);switch(e){case v:return U("Suspense");case m:return U("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Ge(e.render);case h:return B(e.type,r,t);case x:{var n=e,o=n._payload,s=n._init;try{return B(s(o),r,t)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,be={},Ee=D.ReactDebugCurrentFrame;function z(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}function Je(e,r,t,n,o){{var s=Function.call.bind(J);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var y=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){a=c}a&&!(a instanceof Error)&&(z(o),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),z(null)),a instanceof Error&&!(a.message in be)&&(be[a.message]=!0,z(o),g("Failed %s type: %s",t,a.message),z(null))}}}var ze=Array.isArray;function re(e){return ze(e)}function qe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return xe(e),!1}catch{return!0}}function xe(e){return""+e}function _e(e){if(He(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",qe(e)),xe(e)}var $=D.ReactCurrentOwner,Ke={key:!0,ref:!0,__self:!0,__source:!0},Re,we,te;te={};function Xe(e){if(J.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(J.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){if(typeof e.ref=="string"&&$.current&&r&&$.current.stateNode!==r){var t=k($.current.type);te[t]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',k($.current.type),e.ref),te[t]=!0)}}function er(e,r){{var t=function(){Re||(Re=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){we||(we=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,o,s,i){var a={$$typeof:T,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,o){{var s,i={},a=null,y=null;t!==void 0&&(_e(t),a=""+t),Ze(r)&&(_e(r.key),a=""+r.key),Xe(r)&&(y=r.ref,Qe(r,o));for(s in r)J.call(r,s)&&!Ke.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var c=e.defaultProps;for(s in c)i[s]===void 0&&(i[s]=c[s])}if(a||y){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&er(i,f),y&&rr(i,f)}return tr(e,a,y,o,n,$.current,i)}}var ne=D.ReactCurrentOwner,Te=D.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}var ae;ae=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===T}function Se(){{if(ne.current){var e=k(ne.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function ar(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return` diff --git a/extensions/react-widget/dist/index.umd.js.map b/extensions/react-widget/dist/index.umd.js.map index 4152dc2..f224b75 100644 --- a/extensions/react-widget/dist/index.umd.js.map +++ b/extensions/react-widget/dist/index.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"index.umd.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/components/DocsGPTWidget.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, attribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","\"use client\";\nimport {useEffect, useRef, useState} from 'react'\n//import './style.css'\n\ninterface HistoryItem {\n prompt: string;\n response: string;\n}\n\ninterface FetchAnswerStreamingProps {\n question?: string;\n apiKey?: string;\n selectedDocs?: string;\n history?: HistoryItem[];\n conversationId?: string | null;\n apiHost?: string;\n onEvent?: (event: MessageEvent) => void;\n}\n\n\nenum ChatStates {\n Init = 'init',\n Processing = 'processing',\n Typing = 'typing',\n Answer = 'answer',\n Minimized = 'minimized',\n}\n\nfunction fetchAnswerStreaming({\n question = '',\n apiKey = '',\n selectedDocs = '',\n history = [],\n conversationId = null,\n apiHost = '',\n onEvent = () => {console.log(\"Event triggered, but no handler provided.\");}\n}: FetchAnswerStreamingProps): Promise {\n let docPath = 'default';\n if (selectedDocs) {\n docPath = selectedDocs;\n }\n\n return new Promise((resolve, reject) => {\n const body = {\n question: question,\n api_key: apiKey,\n embeddings_key: apiKey,\n active_docs: docPath,\n history: JSON.stringify(history),\n conversation_id: conversationId,\n model: 'default'\n };\n\n fetch(apiHost + '/stream', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n })\n .then((response) => {\n if (!response.body) throw Error('No response body');\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder('utf-8');\n let counterrr = 0;\n const processStream = ({\n done,\n value,\n }: ReadableStreamReadResult) => {\n if (done) {\n console.log(counterrr);\n resolve();\n return;\n }\n\n counterrr += 1;\n\n const chunk = decoder.decode(value);\n\n const lines = chunk.split('\\n');\n\n for (let line of lines) {\n if (line.trim() == '') {\n continue;\n }\n if (line.startsWith('data:')) {\n line = line.substring(5);\n }\n\n const messageEvent = new MessageEvent('message', {\n data: line,\n });\n\n onEvent(messageEvent); // handle each message\n }\n\n reader.read().then(processStream).catch(reject);\n };\n\n reader.read().then(processStream).catch(reject);\n })\n .catch((error) => {\n console.error('Connection failed:', error);\n reject(error);\n });\n });\n}\n\nexport const DocsGPTWidget = ({ apiHost = 'https://gptcloud.arc53.com', selectDocs = 'default', apiKey = 'docsgpt-public'}) => {\n // processing states\n const [chatState, setChatState] = useState(() => {\n if (typeof window !== 'undefined') {\n return localStorage.getItem('docsGPTChatState') as ChatStates || ChatStates.Init;\n }\n return ChatStates.Init;\n });\n\n const [answer, setAnswer] = useState('');\n\n //const selectDocs = 'local/1706.03762.pdf/'\n const answerRef = useRef(null);\n\n useEffect(() => {\n if (answerRef.current) {\n const element = answerRef.current;\n element.scrollTop = element.scrollHeight;\n }\n }, [answer]);\n\n useEffect(() => {\n localStorage.setItem('docsGPTChatState', chatState);\n }, [chatState]);\n\n\n\n // submit handler\n const handleSubmit = (e: React.FormEvent) => {\n setAnswer('')\n e.preventDefault()\n // get question\n setChatState(ChatStates.Processing)\n setTimeout(() => {\n setChatState(ChatStates.Answer)\n }, 800)\n const inputElement = e.currentTarget[0] as HTMLInputElement;\n const questionValue = inputElement.value;\n\n fetchAnswerStreaming({\n question: questionValue,\n apiKey: apiKey,\n selectedDocs: selectDocs,\n history: [],\n conversationId: null,\n apiHost: apiHost,\n onEvent: (event) => {\n const data = JSON.parse(event.data);\n\n // check if the 'end' event has been received\n if (data.type === 'end') {\n setChatState(ChatStates.Answer)\n } else if (data.type === 'source') {\n // check if data.metadata exists\n let result;\n if (data.metadata && data.metadata.title) {\n const titleParts = data.metadata.title.split('/');\n result = {\n title: titleParts[titleParts.length - 1],\n text: data.doc,\n };\n } else {\n result = { title: data.doc, text: data.doc };\n }\n console.log(result)\n\n } else if (data.type === 'id') {\n console.log(data.id);\n } else {\n const result = data.answer;\n // set answer by appending answer\n setAnswer(prevAnswer => prevAnswer + result);\n }\n },\n });\n }\n\n return (\n <>\n
\n
setChatState(ChatStates.Init)}\n className={`${chatState !== 'minimized' ? 'hidden' : ''} cursor-pointer`}>\n
\n \n
\n
\n
\n
\n {\n event.stopPropagation();\n setChatState(ChatStates.Minimized);\n }}\n />\n
\n
\n

Need help with documentation?

\n

DocsGPT AI assistant will help you with docs

\n
\n
\n

{answer}

\n
\n
\n
\n
\n \n { (chatState === 'typing' || chatState === 'answer') && (\n \n \n \n \n )}\n

\n Processing...\n

\n
\n
\n
\n\n \n )\n}"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","React","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactSharedInternals","error","format","_len2","args","_key2","printWarning","level","ReactDebugCurrentFrame","stack","argsWithFormat","item","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","REACT_MODULE_REFERENCE","isValidElementType","type","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","context","provider","outerName","lazyComponent","payload","init","assign","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","props","reenableLogs","ReactCurrentDispatcher","prefix","describeBuiltInComponentFrame","name","source","ownerFn","x","match","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","Component","prototype","describeUnknownElementTypeFrameInDEV","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","checkPropTypes","typeSpecs","values","location","componentName","has","typeSpecName","error$1","err","ex","isArrayImpl","isArray","typeName","value","hasToStringTag","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","ReactCurrentOwner","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","didWarnAboutStringRefs","hasValidRef","config","getter","hasValidKey","warnIfStringRefCannotBeAutoConverted","self","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","ReactElement","key","ref","jsxDEV","maybeKey","propName","defaultProps","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","isValidElement","object","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","fileName","lineNumber","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","info","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","i","child","iteratorFn","iterator","step","validatePropTypes","propTypes","_name","validateFragmentProps","fragment","keys","jsxWithValidation","isStaticChildren","validType","sourceInfo","typeString","children","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","jsxRuntimeModule","require$$1","fetchAnswerStreaming","question","apiKey","selectedDocs","history","conversationId","apiHost","onEvent","docPath","resolve","reject","body","response","reader","decoder","counterrr","processStream","done","lines","line","messageEvent","DocsGPTWidget","selectDocs","chatState","setChatState","useState","answer","setAnswer","answerRef","useRef","useEffect","handleSubmit","questionValue","event","data","result","titleParts","prevAnswer","Fragment"],"mappings":";;;;;;;;4CASa,IAAIA,EAAEC,EAAiBC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,UAAU,eAAeC,EAAEL,EAAE,mDAAmD,kBAAkBM,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EAClP,SAASC,EAAEC,EAAEC,EAAEC,EAAE,CAAC,IAAIC,EAAEC,EAAE,GAAGC,EAAE,KAAKC,EAAE,KAAcJ,IAAT,SAAaG,EAAE,GAAGH,GAAYD,EAAE,MAAX,SAAiBI,EAAE,GAAGJ,EAAE,KAAcA,EAAE,MAAX,SAAiBK,EAAEL,EAAE,KAAK,IAAIE,KAAKF,EAAEL,EAAE,KAAKK,EAAEE,CAAC,GAAG,CAACL,EAAE,eAAeK,CAAC,IAAIC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,GAAGH,GAAGA,EAAE,aAAa,IAAIG,KAAKF,EAAED,EAAE,aAAaC,EAAWG,EAAED,CAAC,IAAZ,SAAgBC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,MAAM,CAAC,SAAST,EAAE,KAAKM,EAAE,IAAIK,EAAE,IAAIC,EAAE,MAAMF,EAAE,OAAOP,EAAE,OAAO,CAAC,C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,CAAA,UAAU,iFAAiF,KAAK,SAAU,SAAM,SAAA,CAAA,CAAA,CAC1H,EAEFC,EAAAA,KAAC,KAAE,UAAW,GAAG2B,IAAc,aAAe,SAAW,EAAE,0HAA2H,SAAA,CAAA,aACzK5B,EAAA,IAAA,OAAA,CAAK,UAAU,gBAAgB,SAAC,IAAA,EAAQA,EAAA,IAAA,OAAA,CAAK,UAAU,0BAA0B,SAAC,IAAA,EAAQA,EAAA,IAAA,OAAA,CAAK,UAAU,0BAA0B,SAAC,IAAA,CAAA,EACjJ,CAAA,EACF,CAAA,EACF,CAAA,CACF,CAAA,CAEA,CAAA,CAEJ","x_google_ignoreList":[0,1,2]} +{"version":3,"file":"index.umd.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/components/DocsGPTWidget.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, attribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","\"use client\";\nimport {useEffect, useRef, useState} from 'react'\n//import './style.css'\n\ninterface HistoryItem {\n prompt: string;\n response: string;\n}\n\ninterface FetchAnswerStreamingProps {\n question?: string;\n apiKey?: string;\n selectedDocs?: string;\n history?: HistoryItem[];\n conversationId?: string | null;\n apiHost?: string;\n onEvent?: (event: MessageEvent) => void;\n}\n\n\nenum ChatStates {\n Init = 'init',\n Processing = 'processing',\n Typing = 'typing',\n Answer = 'answer',\n Minimized = 'minimized',\n}\n\nfunction fetchAnswerStreaming({\n question = '',\n apiKey = '',\n selectedDocs = '',\n history = [],\n conversationId = null,\n apiHost = '',\n onEvent = () => {console.log(\"Event triggered, but no handler provided.\");}\n}: FetchAnswerStreamingProps): Promise {\n let docPath = 'default';\n if (selectedDocs) {\n docPath = selectedDocs;\n }\n\n return new Promise((resolve, reject) => {\n const body = {\n question: question,\n api_key: apiKey,\n embeddings_key: apiKey,\n active_docs: docPath,\n history: JSON.stringify(history),\n conversation_id: conversationId,\n model: 'default'\n };\n\n fetch(apiHost + '/stream', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body),\n })\n .then((response) => {\n if (!response.body) throw Error('No response body');\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder('utf-8');\n let counterrr = 0;\n const processStream = ({\n done,\n value,\n }: ReadableStreamReadResult) => {\n if (done) {\n console.log(counterrr);\n resolve();\n return;\n }\n\n counterrr += 1;\n\n const chunk = decoder.decode(value);\n\n const lines = chunk.split('\\n');\n\n for (let line of lines) {\n if (line.trim() == '') {\n continue;\n }\n if (line.startsWith('data:')) {\n line = line.substring(5);\n }\n\n const messageEvent = new MessageEvent('message', {\n data: line,\n });\n\n onEvent(messageEvent); // handle each message\n }\n\n reader.read().then(processStream).catch(reject);\n };\n\n reader.read().then(processStream).catch(reject);\n })\n .catch((error) => {\n console.error('Connection failed:', error);\n reject(error);\n });\n });\n}\n\nexport const DocsGPTWidget = ({ apiHost = 'https://gptcloud.arc53.com', selectDocs = 'default', apiKey = 'docsgpt-public'}) => {\n // processing states\n const [chatState, setChatState] = useState(() => {\n if (typeof window !== 'undefined') {\n return localStorage.getItem('docsGPTChatState') as ChatStates || ChatStates.Init;\n }\n return ChatStates.Init;\n });\n\n const [answer, setAnswer] = useState('');\n\n //const selectDocs = 'local/1706.03762.pdf/'\n const answerRef = useRef(null);\n\n useEffect(() => {\n if (answerRef.current) {\n const element = answerRef.current;\n element.scrollTop = element.scrollHeight;\n }\n }, [answer]);\n\n useEffect(() => {\n localStorage.setItem('docsGPTChatState', chatState);\n }, [chatState]);\n\n\n\n // submit handler\n const handleSubmit = (e: React.FormEvent) => {\n setAnswer('')\n e.preventDefault()\n // get question\n setChatState(ChatStates.Processing)\n setTimeout(() => {\n setChatState(ChatStates.Answer)\n }, 800)\n const inputElement = e.currentTarget[0] as HTMLInputElement;\n const questionValue = inputElement.value;\n\n fetchAnswerStreaming({\n question: questionValue,\n apiKey: apiKey,\n selectedDocs: selectDocs,\n history: [],\n conversationId: null,\n apiHost: apiHost,\n onEvent: (event) => {\n const data = JSON.parse(event.data);\n\n // check if the 'end' event has been received\n if (data.type === 'end') {\n setChatState(ChatStates.Answer)\n } else if (data.type === 'source') {\n // check if data.metadata exists\n let result;\n if (data.metadata && data.metadata.title) {\n const titleParts = data.metadata.title.split('/');\n result = {\n title: titleParts[titleParts.length - 1],\n text: data.doc,\n };\n } else {\n result = { title: data.doc, text: data.doc };\n }\n console.log(result)\n\n } else if (data.type === 'id') {\n console.log(data.id);\n } else {\n const result = data.answer;\n // set answer by appending answer\n setAnswer(prevAnswer => prevAnswer + result);\n }\n },\n });\n }\n\n return (\n <>\n
\n
setChatState(ChatStates.Init)}\n className={`${chatState !== 'minimized' ? 'hidden' : ''} cursor-pointer`}>\n
\n \n
\n
\n
\n
\n {\n event.stopPropagation();\n setChatState(ChatStates.Minimized);\n }}\n />\n
\n
\n

Need help with documentation?

\n

DocsGPT AI assistant will help you with docs

\n
\n
\n

{answer}

\n
\n
\n
\n
\n \n { (chatState === 'typing' || chatState === 'answer') && (\n \n \n \n \n )}\n

\n Processing...\n

\n
\n
\n
\n\n \n )\n}"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","React","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactSharedInternals","error","format","_len2","args","_key2","printWarning","level","ReactDebugCurrentFrame","stack","argsWithFormat","item","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","REACT_MODULE_REFERENCE","isValidElementType","type","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","context","provider","outerName","lazyComponent","payload","init","assign","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","props","reenableLogs","ReactCurrentDispatcher","prefix","describeBuiltInComponentFrame","name","source","ownerFn","x","match","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","Component","prototype","describeUnknownElementTypeFrameInDEV","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","checkPropTypes","typeSpecs","values","location","componentName","has","typeSpecName","error$1","err","ex","isArrayImpl","isArray","typeName","value","hasToStringTag","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","ReactCurrentOwner","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","didWarnAboutStringRefs","hasValidRef","config","getter","hasValidKey","warnIfStringRefCannotBeAutoConverted","self","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","ReactElement","key","ref","jsxDEV","maybeKey","propName","defaultProps","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","isValidElement","object","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","fileName","lineNumber","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","info","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","i","child","iteratorFn","iterator","step","validatePropTypes","propTypes","_name","validateFragmentProps","fragment","keys","jsxWithValidation","isStaticChildren","validType","sourceInfo","typeString","children","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","jsxRuntimeModule","require$$1","fetchAnswerStreaming","question","apiKey","selectedDocs","history","conversationId","apiHost","onEvent","docPath","resolve","reject","body","response","reader","decoder","counterrr","processStream","done","lines","line","messageEvent","DocsGPTWidget","selectDocs","chatState","setChatState","useState","answer","setAnswer","answerRef","useRef","useEffect","handleSubmit","questionValue","event","data","result","titleParts","prevAnswer","Fragment"],"mappings":";;;;;;;;4CASa,IAAIA,EAAEC,EAAiBC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,UAAU,eAAeC,EAAEL,EAAE,mDAAmD,kBAAkBM,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EAClP,SAASC,EAAEC,EAAEC,EAAEC,EAAE,CAAC,IAAIC,EAAEC,EAAE,GAAGC,EAAE,KAAKC,EAAE,KAAcJ,IAAT,SAAaG,EAAE,GAAGH,GAAYD,EAAE,MAAX,SAAiBI,EAAE,GAAGJ,EAAE,KAAcA,EAAE,MAAX,SAAiBK,EAAEL,EAAE,KAAK,IAAIE,KAAKF,EAAEL,EAAE,KAAKK,EAAEE,CAAC,GAAG,CAACL,EAAE,eAAeK,CAAC,IAAIC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,GAAGH,GAAGA,EAAE,aAAa,IAAIG,KAAKF,EAAED,EAAE,aAAaC,EAAWG,EAAED,CAAC,IAAZ,SAAgBC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,MAAM,CAAC,SAAST,EAAE,KAAKM,EAAE,IAAIK,EAAE,IAAIC,EAAE,MAAMF,EAAE,OAAOP,EAAE,OAAO,CAAC,CAAC,OAAAU,WAAiBZ,EAAEY,EAAW,IAACR,EAAEQ,EAAA,KAAaR;;;;;;;;yCCEtW,QAAQ,IAAI,WAAa,cAC1B,UAAW,CAGd,IAAIS,EAAQf,EAMRgB,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAoB,OAAO,IAAI,cAAc,EAC7CC,EAAsB,OAAO,IAAI,gBAAgB,EACjDC,EAAyB,OAAO,IAAI,mBAAmB,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QA,EAAA,IAAA,OAAA,CAAK,UAAU,0BAA0B,SAAC,IAAA,CAAA,EACjJ,CAAA,EACF,CAAA,EACF,CAAA,CACF,CAAA,CAEA,CAAA,CAEJ","x_google_ignoreList":[0,1,2]} diff --git a/scripts/parser/file/html_parser.py b/scripts/parser/file/html_parser.py index dfe2f8f..71c95fe 100644 --- a/scripts/parser/file/html_parser.py +++ b/scripts/parser/file/html_parser.py @@ -57,7 +57,7 @@ class HTMLParser(BaseParser): title_indexes = [i for i, isd_el in enumerate(isd) if isd_el['type'] == 'Title'] # Creating 'Chunks' - List of lists of strings - # each list starting with with isd_el['type'] = 'Title' and all the data till the next 'Title' + # each list starting with isd_el['type'] = 'Title' and all the data till the next 'Title' # Each Chunk can be thought of as an individual set of data, which can be sent to the model # Where Each Title is grouped together with the data under it From 316c276545acfb85978788c0a4b913c8b90cc4e4 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 6 Oct 2023 15:29:17 +0100 Subject: [PATCH 012/114] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98958c8..edeb7b6 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Say goodbye to time-consuming manual searches, and let DocsGPT
-### Production Support/ Help for companies: +### Production Support / Help for companies: We're eager to provide personalized assistance when deploying your DocsGPT to a live environment. - [Schedule Demo πŸ‘‹](https://cal.com/arc53/docsgpt-demo-b2b?date=2023-10-04&month=2023-10) From bbd0325c104204b5daa2dd5432835594a80704be Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sat, 7 Oct 2023 00:40:27 +1000 Subject: [PATCH 013/114] Add pull request labeler --- .github/labeler.yml | 23 +++++++++++++++++++++++ .github/workflows/labeler.yml | 15 +++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..0c9b183 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,23 @@ +repo: + - '*' + +github: + - .github/**/* + +application: + - application/**/* + +docs: + - docs/**/* + +extensions: + - extensions/**/* + +frontend: + - frontend/**/* + +scripts: + - scripts/**/* + +tests: + - tests/**/* diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..f85abb1 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,15 @@ +# https://github.com/actions/labeler +name: Pull Request Labeler +on: + - pull_request_target +jobs: + triage: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + sync-labels: true From 17edaa0e1fccf2c1cda0fe3da086fc1426e402b3 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 6 Oct 2023 16:05:10 +0100 Subject: [PATCH 014/114] Update faiss.py --- application/vectorstore/faiss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/vectorstore/faiss.py b/application/vectorstore/faiss.py index 5c5cee7..217b045 100644 --- a/application/vectorstore/faiss.py +++ b/application/vectorstore/faiss.py @@ -1,5 +1,5 @@ from application.vectorstore.base import BaseVectorStore -from langchain import FAISS +from langchain.vectorstores import FAISS from application.core.settings import settings class FaissStore(BaseVectorStore): From 425a8a641204fa636b7b3ee1236161a1316b8cf6 Mon Sep 17 00:00:00 2001 From: Shuvadipta Das Date: Fri, 6 Oct 2023 21:39:18 +0530 Subject: [PATCH 015/114] 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 c9549ae..0a39929 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 016/114] Update README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b734af6..5c115b4 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 943bf477a01d573e66c023c69b6644af0a3c92d8 Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Fri, 6 Oct 2023 23:37:23 +0530 Subject: [PATCH 017/114] Fix: Conversations tabs overlapping --- frontend/src/Navigation.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 4778976..9507cfe 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -201,7 +201,9 @@ export default function Navigation() {

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

From ab7f6e8300df498e09d464232135d563f4521551 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Fri, 6 Oct 2023 23:42:22 +0530 Subject: [PATCH 018/114] Change the hero section with figma style --- frontend/src/Hero.tsx | 52 ++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index 8ed80fc..df0ad28 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -5,28 +5,26 @@ 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 @@ -35,11 +33,13 @@ 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,15 +47,17 @@ 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 From bdfcf6591e58b8a5984108c4877e58a4dcf1f609 Mon Sep 17 00:00:00 2001 From: Nick Rogers Date: Fri, 6 Oct 2023 21:20:40 -0700 Subject: [PATCH 019/114] 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 aa5815f..f9a2fec 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 0585fb4c8098615213d2f55cde77063ca2fffffb Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Sat, 7 Oct 2023 11:21:55 +0530 Subject: [PATCH 020/114] 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 8ed80fc..0644da6 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 11:39:51 +0530 Subject: [PATCH 021/114] add the additional div in the chat sections --- frontend/src/conversation/Conversation.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index ab43576..8d85f3c 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -144,6 +144,7 @@ export default function Conversation() { ); })} + {hasScrolledToLast &&
}
)} {queries.length === 0 && ( From 0e496181a16bd011073fd1912200a2e226d0347d Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sat, 7 Oct 2023 12:03:43 +0530 Subject: [PATCH 022/114] Fix the question input hidden issue --- frontend/src/conversation/Conversation.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 8d85f3c..e6b5d9c 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -134,7 +134,7 @@ export default function Conversation() { return ( ); })} - {hasScrolledToLast &&
}
)} {queries.length === 0 && ( From 8323b8af4d9d7725a5c4ac7c1d3b9376e637866c Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sat, 7 Oct 2023 12:13:05 +0530 Subject: [PATCH 023/114] Reset the input hidden issues --- frontend/src/conversation/Conversation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index e6b5d9c..ab43576 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 12:20:47 +0530 Subject: [PATCH 024/114] 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 df0ad28..0644da6 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 ab43576..e6b5d9c 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 13:24:12 +0530 Subject: [PATCH 025/114] 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 2793a9b..09238e2 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 026/114] 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 1a39e56..6265ddd 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 74376586a809487ba6d3af59660fa6d93f4d12ad Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 7 Oct 2023 09:51:41 +0100 Subject: [PATCH 027/114] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index edeb7b6..d449942 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Say goodbye to time-consuming manual searches, and let DocsGPT ### Production Support / Help for companies: We're eager to provide personalized assistance when deploying your DocsGPT to a live environment. -- [Schedule Demo πŸ‘‹](https://cal.com/arc53/docsgpt-demo-b2b?date=2023-10-04&month=2023-10) +- [Get Support πŸ‘‹](https://airtable.com/appdeaL0F1qV8Bl2C/shrrJF1Ll7btCJRbP) - [Send Email βœ‰οΈ](mailto:contact@arc53.com?subject=DocsGPT%20support%2Fsolutions) ### [πŸŽ‰ Join the Hacktoberfest with DocsGPT and Earn a Free T-shirt! πŸŽ‰](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md) 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 028/114] 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 edeb7b6..16706df 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 029/114] 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 b759fd4..1e127f0 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 030/114] Update HACKTOBERFEST.md Improvements --- HACKTOBERFEST.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HACKTOBERFEST.md b/HACKTOBERFEST.md index 6265ddd..b164661 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 031/114] 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 f9a04ae..33db5b6 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 032/114] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 33db5b6..0942768 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 033/114] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0942768..ef892c5 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 034/114] 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 edeb7b6..c9296ba 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 035/114] 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 c9296ba..8fde021 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 036/114] 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 034fe80..2d33921 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 037/114] 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 2d33921..303708c 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 038/114] added venv official Python documentation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8fde021..387ad8a 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 039/114] added one line for the venv documentation --- README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/README.md b/README.md index 387ad8a..3481ab6 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 040/114] git commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3481ab6..e62f4bd 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 041/114] Update README.md --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e62f4bd..707ed10 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 042/114] 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 9507cfe..aa1367a 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 043/114] 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 2583874..eabd29c 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 432d31a..9892108 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 20f7bce..70b7415 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 2793a9b..3734966 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 0edc971..755a9ad 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 64fb76f..8e395a0 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 044/114] 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 0644da6..8ed80fc 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:37:58 +0530 Subject: [PATCH 045/114] 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 b759fd4..d8e3559 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 47f9be32ced3e9782a4719b18b928ae459a3533e Mon Sep 17 00:00:00 2001 From: KRISH SONI <67964054+krishvsoni@users.noreply.github.com> Date: Sat, 7 Oct 2023 21:40:29 +0530 Subject: [PATCH 046/114] git commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 707ed10..172c075 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 047/114] Make text bold --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b759fd4..b83ed69 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 048/114] 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 8cf969d..7c08dfb 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 66d14dd..9dcbf4a 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 0000000..d0da885 --- /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 b74c65f..3f38ee9 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 049/114] 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 303708c..2365536 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 050/114] 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 2bb6711..7a87f76 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 2e88131..471970a 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 051/114] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4b2247b..543bfb1 100644 --- a/README.md +++ b/README.md @@ -55,18 +55,18 @@ 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) - -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) + - πŸ—‚οΈπŸš€ [How to use any other documentation](https://docs.docsgpt.co.uk/Guides/How-to-train-on-other-documentation) -document--v1 [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) -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 052/114] 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 303708c..f510799 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 053/114] 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 16706df..898a57f 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 054/114] 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 eabd29c..99d9896 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 055/114] 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 0fa6a7a..902b32a 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 056/114] 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 e6b5d9c..d50ed85 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 057/114] 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 d8e3559..188a90d 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 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 058/114] 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 7505f60..13296b4 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 059/114] 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 2cc03c5..5ed37a5 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 060/114] 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 eabd29c..1b908a8 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 061/114] 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 4dd5782..e95891a 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 062/114] 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 be4d6bd..1cc1132 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 063/114] 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 1d3a7d4..19dcdef 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 064/114] 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 9f4e503..aef6f00 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 065/114] 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 aa5815f..c0245a1 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 066/114] 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 e6c5bb6..4c5aac3 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 067/114] 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 0000000..2565377 --- /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 068/114] 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 be1bffa..fb15835 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 069/114] 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 0000000..9ed02cb --- /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 070/114] 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 0000000..e97d998 --- /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 071/114] 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 e97d998..b7e0058 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 072/114] 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 4802ab8..ad9d72a 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 073/114] 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 260639b..6fdcb10 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 79e62da..f805a64 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 074/114] 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 e6c5bb6..e065d65 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 075/114] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 188a90d..3e96980 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 076/114] 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 0000000..682c29d --- /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 d0da885..846d285 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 471970a..1901961 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 077/114] 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 c7f4941..5b2e698 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 078/114] 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 99d9896..26ad640 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 079/114] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f326f42..3784278 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 080/114] 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 fb15835..a546116 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 081/114] 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 02a0876..aa0d15b 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 082/114] 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 413bef1..0eaf483 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 083/114] 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 b74c65f..e872d87 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 084/114] 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 4c5aac3..97034ea 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 085/114] 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 0000000..d0e4546 --- /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 086/114] 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 b7e0058..b578e38 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 087/114] 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 b578e38..29a0d51 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 088/114] 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 29a0d51..b5cb755 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 089/114] 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 aa0d15b..9853f9a 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 090/114] 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 682c29d..9ed02cb 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 091/114] 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 6ab9cce..e0d5ce1 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 092/114] 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 5c87c70..71fcd61 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 093/114] 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 e0d5ce1..4834844 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 094/114] 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 4834844..8c74fd0 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 095/114] 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 b5cb755..592c52b 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 096/114] 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 9853f9a..fdff2e9 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 097/114] 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 ca318a6..fe26835 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 ad9d72a..4454094 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 098/114] 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 bf43cbd..7a55cd0 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 ce7ac78b425c15ae3da31c844e20d291de2de8e6 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Mon, 9 Oct 2023 19:48:17 +0530 Subject: [PATCH 099/114] 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 8e395a0..b76b022 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 100/114] 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 1901961..aa9514c 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 101/114] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 05a5feb..55b5448 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 104/114] Update CONTRIBUTING.md --- CONTRIBUTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8be3612..16f42ce 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 105/114] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2ec378..db56186 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 107/114] 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 9e574e9..87a5ebb 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 108/114] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 16f42ce..d55880f 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 109/114] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d55880f..f4f0140 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 110/114] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f4f0140..f3e124e 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 111/114] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f3e124e..76e60f6 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 c969e9c014cebc7aef3068e15486c547fe663140 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 11 Oct 2023 23:11:08 +0100 Subject: [PATCH 112/114] 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 7a55cd0..e236b8a 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 308d8afe4eacac995e913e3ac1a17c8e35c6875c Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 12 Oct 2023 18:19:06 +0100 Subject: [PATCH 113/114] Update CONTRIBUTING.md --- CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 76e60f6..93397a3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,10 +19,13 @@ Thank you for choosing to contribute to DocsGPT! We are all very grateful! 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). +Before creating issues, please check out how the latest version of our app looks and works by launching it via [Quickstart](https://github.com/arc53/DocsGPT#quickstart) the version on our live demo is slightly modified with login. Your issues should relate to the version that you can launch via Quickstart. + If you're interested in contributing code, here are some important things to know: We have a frontend built with React (Vite) and a backend in Python. + ### If you are looking to contribute to frontend (βš›οΈReact, Vite): - 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. From e5e5a42736a41cd856041374ce8fbde60c559922 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 12 Oct 2023 18:19:40 +0100 Subject: [PATCH 114/114] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 93397a3..e69228c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ Thank you for choosing to contribute to DocsGPT! We are all very grateful! 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). -Before creating issues, please check out how the latest version of our app looks and works by launching it via [Quickstart](https://github.com/arc53/DocsGPT#quickstart) the version on our live demo is slightly modified with login. Your issues should relate to the version that you can launch via Quickstart. +Before creating issues, please check out how the latest version of our app looks and works by launching it via [Quickstart](https://github.com/arc53/DocsGPT#quickstart) the version on our live demo is slightly modified with login. Your issues should relate to the version that you can launch via [Quickstart](https://github.com/arc53/DocsGPT#quickstart). If you're interested in contributing code, here are some important things to know: