mirror of
https://github.com/arc53/DocsGPT.git
synced 2026-04-28 13:00:30 +00:00
@@ -1,4 +1,8 @@
|
|||||||
You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible.
|
You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible.
|
||||||
Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses.
|
Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses.
|
||||||
|
When using code examples, use the following format:
|
||||||
|
```(language)
|
||||||
|
(code)
|
||||||
|
```
|
||||||
----------------
|
----------------
|
||||||
{summaries}
|
{summaries}
|
||||||
6011
frontend/package-lock.json
generated
6011
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -24,12 +24,15 @@
|
|||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-dropzone": "^14.2.3",
|
"react-dropzone": "^14.2.3",
|
||||||
|
"react-markdown": "^8.0.7",
|
||||||
"react-redux": "^8.0.5",
|
"react-redux": "^8.0.5",
|
||||||
"react-router-dom": "^6.8.1"
|
"react-router-dom": "^6.8.1",
|
||||||
|
"react-syntax-highlighter": "^15.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^18.0.27",
|
"@types/react": "^18.0.27",
|
||||||
"@types/react-dom": "^18.0.10",
|
"@types/react-dom": "^18.0.10",
|
||||||
|
"@types/react-syntax-highlighter": "^15.5.6",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
||||||
"@typescript-eslint/parser": "^5.51.0",
|
"@typescript-eslint/parser": "^5.51.0",
|
||||||
"@vitejs/plugin-react": "^3.1.0",
|
"@vitejs/plugin-react": "^3.1.0",
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import { FEEDBACK, MESSAGE_TYPE } from './conversationModels';
|
|||||||
import Alert from './../assets/alert.svg';
|
import Alert from './../assets/alert.svg';
|
||||||
import { ReactComponent as Like } from './../assets/like.svg';
|
import { ReactComponent as Like } from './../assets/like.svg';
|
||||||
import { ReactComponent as Dislike } from './../assets/dislike.svg';
|
import { ReactComponent as Dislike } from './../assets/dislike.svg';
|
||||||
|
import ReactMarkdown from 'react-markdown';
|
||||||
|
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
|
||||||
|
import { vscDarkPlus } from 'react-syntax-highlighter/dist/cjs/styles/prism';
|
||||||
|
|
||||||
const ConversationBubble = forwardRef<
|
const ConversationBubble = forwardRef<
|
||||||
HTMLDivElement,
|
HTMLDivElement,
|
||||||
@@ -26,7 +29,9 @@ const ConversationBubble = forwardRef<
|
|||||||
<div ref={ref} className={`flex flex-row-reverse self-end ${className}`}>
|
<div ref={ref} className={`flex flex-row-reverse self-end ${className}`}>
|
||||||
<Avatar className="mt-4 text-2xl" avatar="🧑💻"></Avatar>
|
<Avatar className="mt-4 text-2xl" avatar="🧑💻"></Avatar>
|
||||||
<div className="mr-2 ml-10 flex items-center rounded-3xl bg-blue-1000 p-3.5 text-white">
|
<div className="mr-2 ml-10 flex items-center rounded-3xl bg-blue-1000 p-3.5 text-white">
|
||||||
<p className="whitespace-pre-wrap break-words">{message}</p>
|
<ReactMarkdown className="whitespace-pre-wrap break-words">
|
||||||
|
{message}
|
||||||
|
</ReactMarkdown>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -49,7 +54,31 @@ const ConversationBubble = forwardRef<
|
|||||||
{type === 'ERROR' && (
|
{type === 'ERROR' && (
|
||||||
<img src={Alert} alt="alert" className="mr-2 inline" />
|
<img src={Alert} alt="alert" className="mr-2 inline" />
|
||||||
)}
|
)}
|
||||||
<p className="whitespace-pre-wrap break-words">{message}</p>
|
<ReactMarkdown
|
||||||
|
className="whitespace-pre-wrap break-words"
|
||||||
|
components={{
|
||||||
|
code({ node, inline, className, children, ...props }) {
|
||||||
|
const match = /language-(\w+)/.exec(className || '');
|
||||||
|
|
||||||
|
return !inline && match ? (
|
||||||
|
<SyntaxHighlighter
|
||||||
|
PreTag="div"
|
||||||
|
language={match[1]}
|
||||||
|
{...props}
|
||||||
|
style={vscDarkPlus}
|
||||||
|
>
|
||||||
|
{String(children).replace(/\n$/, '')}
|
||||||
|
</SyntaxHighlighter>
|
||||||
|
) : (
|
||||||
|
<code className={className ? className : ''} {...props}>
|
||||||
|
{children}
|
||||||
|
</code>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{message}
|
||||||
|
</ReactMarkdown>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={`mr-2 flex items-center justify-center ${
|
className={`mr-2 flex items-center justify-center ${
|
||||||
|
|||||||
Reference in New Issue
Block a user