Skip to content

Commit

Permalink
fix: duplicate dependence & pick gpt-vis upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcc committed Sep 3, 2024
1 parent 0d0fbeb commit f070db8
Show file tree
Hide file tree
Showing 4 changed files with 608 additions and 485 deletions.
2 changes: 1 addition & 1 deletion web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ For full documentation, visit [document](https://docs.dbgpt.site/).


## Usage
[react-markdown](https://github.com/remarkjs/react-markdown#readme) for markdown support.
[gpt-vis](https://github.com/eosphoros-ai/DB-GPT/gpt-vis) for markdown support.
[ant-design](https://github.com/ant-design/ant-design) for ui components.
[next.js](https://github.com/vercel/next.js) for server side rendering.
[@antv/g2](https://github.com/antvis/g2#readme) for charts.
Expand Down
12 changes: 8 additions & 4 deletions web/components/chat/chat-content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { GPTVis } from '@antv/gpt-vis';
import { Tag } from 'antd';
import classNames from 'classnames';
import { PropsWithChildren, ReactNode, memo, useContext, useMemo } from 'react';
import ReactMarkdown from 'react-markdown';
import rehypeRaw from 'rehype-raw';
import remarkGfm from 'remark-gfm';
import { renderModelIcon } from '../header/model-selector';
import markdownComponents from './config';

Expand Down Expand Up @@ -131,9 +131,9 @@ function ChatContent({ children, content, isChartChat, onLinkClick }: PropsWithC
</div>
{result ? (
<div className='px-4 md:px-6 py-4 text-sm'>
<ReactMarkdown components={markdownComponents} rehypePlugins={[rehypeRaw]}>
<GPTVis components={markdownComponents} rehypePlugins={[rehypeRaw]} remarkPlugins={[remarkGfm]}>
{result ?? ''}
</ReactMarkdown>
</GPTVis>
</div>
) : (
<div className='px-4 md:px-6 py-4 text-sm'>{err_msg}</div>
Expand Down Expand Up @@ -172,7 +172,11 @@ function ChatContent({ children, content, isChartChat, onLinkClick }: PropsWithC
)}
{/* Markdown */}
{isRobot && typeof context === 'string' && (
<GPTVis components={{ ...markdownComponents, ...extraMarkdownComponents }} rehypePlugins={[rehypeRaw]}>
<GPTVis
components={{ ...markdownComponents, ...extraMarkdownComponents }}
rehypePlugins={[rehypeRaw]}
remarkPlugins={[remarkGfm]}
>
{formatMarkdownVal(value)}
</GPTVis>
)}
Expand Down
25 changes: 15 additions & 10 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,33 +53,23 @@
"cytoscape": "^3.29.2",
"cytoscape-euler": "^1.2.2",
"eslint-plugin-prettier": "^5.2.1",
"framer-motion": "^10.16.4",
"google-auth-library": "^9.2.0",
"google-one-tap": "^1.0.6",
"dayjs": "^1.11.12",
"i18next": "^23.4.5",
"iron-session": "^6.3.1",
"iron-session": "^6.3.1",
"lodash": "^4.17.21",
"markdown-it": "^14.1.0",
"markdown-it": "^14.1.0",
"moment": "^2.29.4",
"monaco-editor": ">=0.31.0",
"multer": "^1.4.5-lts.1",
"mysql2": "^3.6.2",
"multer": "^1.4.5-lts.1",
"mysql2": "^3.6.2",
"next": "13.4.7",
"next-auth": "^4.20.1",
"next-connect": "^1.0.0-next.4",
"next-transpile-modules": "^10.0.1",
"next-connect": "^1.0.0-next.4",
"next-transpile-modules": "^10.0.1",
"nprogress": "^0.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-i18next": "^13.2.0",
"react-markdown": "^8.0.7",
"react-markdown-editor-lite": "^1.3.4",
"react-syntax-highlighter": "^15.5.0",
"react-virtualized": "^9.22.5",
Expand Down Expand Up @@ -127,5 +117,20 @@
"*.{json,md}": [
"prettier --write"
]
},
"resolutions": {
"d3-color": "2",
"d3-array": "2",
"d3-shape": "2",
"d3-path": "2",
"d3-dsv": "2",
"d3-hierarchy": "2",
"d3-scale-chromatic": "2",
"d3-format": "2",
"d3-timer": "2",
"d3-dispatch": "2",
"d3-quadtree": "2",
"d3-force": "2",
"d3-geo": "2"
}
}
Loading

0 comments on commit f070db8

Please sign in to comment.