feat: chatgpt prompts

This commit is contained in:
lencx
2022-12-16 19:58:40 +08:00
parent 305e784145
commit 20105d54be
18 changed files with 446 additions and 73 deletions

39
src/view/LanguageModel/config.tsx vendored Normal file
View File

@@ -0,0 +1,39 @@
import { Tag, Switch, Tooltip, Space } from 'antd';
export const modelColumns = () => [
{
title: 'Act',
dataIndex: 'act',
key: 'act',
},
{
title: 'Tags',
dataIndex: 'tags',
key: 'tags',
render: (v: string[]) => v?.map(i => <Tag key={i}>{i}</Tag>),
},
{
title: 'Enable',
dataIndex: 'enable',
key: 'enable',
render: (v: boolean = false) => <Switch checked={v} disabled />,
},
{
title: 'Prompt',
dataIndex: 'prompt',
key: 'prompt',
render: (v: string) => (
<Tooltip overlayInnerStyle={{ width: 350 }} title={v}><span className="chat-prompts-val">{v}</span></Tooltip>
),
},
{
title: 'Action',
key: 'action',
render: (_: any, row: any, actions: any) => (
<Space size="middle">
<a onClick={() => actions.setRecord(row, 'edit')}>Edit</a>
<a onClick={() => actions.setRecord(row, 'delete')}>Delete</a>
</Space>
),
}
];