From e465daf848b4cbaf84cd561c43e8c7f4907fe0f6 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 24 Feb 2023 14:34:02 +0000 Subject: [PATCH 1/2] small fixes --- frontend/src/About.tsx | 41 ++++++++++++++++++---- frontend/src/Hero.tsx | 6 ++-- frontend/src/conversation/Conversation.tsx | 9 +++++ 3 files changed, 47 insertions(+), 9 deletions(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index ca8ddd87..43002a09 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -4,12 +4,21 @@ export default function About() { return ( //Parent div for all content shown through App.tsx routing needs to have this styling. Might change when state management is updated. -
+

About DocsGPT 🦖

-

+

Find the information in your documentation through AI-powered - open-source chatbot. Powered by GPT-3, Faiss and LangChain. + + {' '} + open-source{' '} + + chatbot. Powered by GPT-3, Faiss and LangChain.

@@ -42,11 +51,31 @@ export default function About() {

Currently It uses python pandas documentation, so it will respond to information relevant to pandas. If you want to train it on different - documentation - please follow this guide. + documentation - please follow + + {' '} + this guide + + .

-

- If you want to launch it on your own server - follow this guide. +

+ If you want to launch it on your own server - follow + + {' '} + this guide + + .

diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index 817ba8bb..ed2db207 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -4,15 +4,15 @@ 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.

-

+

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

diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index cc38c2a8..ab9d9ebf 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -49,6 +49,15 @@ export default function Conversation() { ref={inputRef} contentEditable className={`border-000000 overflow-x-hidden; max-h-24 min-h-[2.6rem] w-full overflow-y-auto rounded-xl border bg-white p-2 pr-9 opacity-100 focus:border-2 focus:outline-none`} + onKeyDown={(e) => { + if (e.key === 'Enter' && !e.shiftKey) { + e.preventDefault(); + if (inputRef.current?.textContent && status !== 'loading') { + handleQuestion(inputRef.current.textContent); + inputRef.current.textContent = ''; + } + } + }} >
{status === 'loading' ? ( Date: Fri, 24 Feb 2023 14:48:02 +0000 Subject: [PATCH 2/2] spacing --- frontend/src/About.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index 43002a09..0f2b5db6 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -5,9 +5,9 @@ export default function About() { return ( //Parent div for all content shown through App.tsx routing needs to have this styling. Might change when state management is updated.
-
-

About DocsGPT 🦖

-

+

+

About DocsGPT 🦖

+

Find the information in your documentation through AI-powered

-

+

If you want to add your own documentation, please follow the instruction below:

-

+

1. Navigate to{' '} /application folder

-

+

2. Install dependencies from{' '} pip install -r requirements.txt

-

+

3. Prepare a .env file. Copy .env_sample and create .env with your OpenAI API token

-

+

4. Run the app with{' '} python app.py

-

+

Currently It uses python pandas documentation, so it will respond to information relevant to pandas. If you want to train it on different documentation - please follow @@ -64,7 +64,7 @@ export default function About() { .

-

+

If you want to launch it on your own server - follow