Integrate Chat and Copilot into chat-sdk, and add SQL parse display (#166)

This commit is contained in:
williamhliu
2023-10-02 18:05:12 +08:00
committed by GitHub
parent 741ed4191b
commit 71cb20eb4f
68 changed files with 1353 additions and 882 deletions

View File

@@ -0,0 +1,14 @@
import Chat from '../Chat';
import styles from './style.module.less';
type Props = {};
const ChatDemo: React.FC<Props> = ({}) => {
return (
<div className={styles.chatDemo}>
<Chat isDeveloper />
</div>
);
};
export default ChatDemo;

View File

@@ -0,0 +1,50 @@
import { Button, Space } from 'antd';
import styles from './style.module.less';
import Copilot from '../Copilot';
import { useRef } from 'react';
const buttonParams = [
{
msg: '周杰伦 艺人趋势解读',
agentId: 8,
modelId: 23,
filters: [{ bizName: 'singer_id', elementID: 283, value: 4558 }],
},
{
msg: '林俊杰 艺人趋势解读',
agentId: 8,
modelId: 23,
filters: [{ bizName: 'singer_id', elementID: 283, value: 4286 }],
},
];
const CopilotDemo = () => {
const copilotRef = useRef<any>();
return (
<div className={styles.copilotDemo}>
<Space>
{buttonParams.map(params => (
<Button
key={params.msg}
onClick={() => {
copilotRef?.current?.sendCopilotMsg(params);
}}
>
{params.msg}
</Button>
))}
</Space>
<Copilot
// token={localStorage.getItem('SUPERSONIC_TOKEN') || ''}
// agentIds={[8]}
isDeveloper
// integrateSystem="c2"
ref={copilotRef}
// noInput
/>
</div>
);
};
export default CopilotDemo;

View File

@@ -8,4 +8,8 @@
height: 100vh;
overflow: auto;
box-sizing: border-box;
}
}
.chatDemo {
height: 100%;
}