-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3239827
commit 7f3739b
Showing
10 changed files
with
262 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
packages/lb-components/src/views/MainView/LLMMultiMheelLayout/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { AppProps } from '@/App'; | ||
import { prefix } from '@/constant'; | ||
import { Layout } from 'antd/es'; | ||
import _ from 'lodash'; | ||
import React, { useState, useMemo } from 'react'; | ||
import Sidebar from '../sidebar'; | ||
import ToolFooter from '../toolFooter'; | ||
import { getClassName } from '@/utils/dom'; | ||
import { classnames } from '@/utils'; | ||
import { LLMMultiMheelContext } from '@/store/ctx'; | ||
import LLMToolView from '@/components/LLMToolView'; | ||
import { IModelAPIAnswer, IAnswerList } from '@/components/LLMToolView/types'; | ||
|
||
interface IProps { | ||
path: string; | ||
loading: boolean; | ||
} | ||
|
||
const { Sider, Content } = Layout; | ||
const layoutCls = `${prefix}-layout`; | ||
|
||
const LLMMultiMheelLayout: React.FC<AppProps & IProps> = (props) => { | ||
const [hoverKey, setHoverKey] = useState(-1); | ||
const [modelAPIResponse, setModelAPIResponse] = useState<IModelAPIAnswer[]>([]); | ||
const [newAnswerList, setNewAnswerList] = useState<IAnswerList[]>([]); | ||
|
||
return ( | ||
<Layout className={getClassName('layout', 'container')}> | ||
<LLMMultiMheelContext.Provider | ||
value={useMemo(() => { | ||
return { | ||
hoverKey, | ||
setHoverKey, | ||
selectKey, | ||
setSelectKey, | ||
}; | ||
}, [hoverKey, modelAPIResponse, newAnswerList])} | ||
> | ||
{props?.leftSider} | ||
<Content | ||
className={classnames({ | ||
[`${layoutCls}__content`]: true, | ||
[`${prefix}-LLMLayout`]: true, | ||
})} | ||
> | ||
{/* <LLMToolView | ||
checkMode={props.checkMode} | ||
showTips={props.showTips} | ||
tips={props.tips} | ||
drawLayerSlot={props.drawLayerSlot} | ||
/> */} | ||
<div>多轮的内容</div> | ||
<ToolFooter style={props.style?.footer} mode={props.mode} footer={props?.footer} /> | ||
</Content> | ||
<Sider className={`${layoutCls}__side`} width={600} style={{ position: 'relative' }}> | ||
<Sidebar sider={props?.sider} checkMode={props?.checkMode} /> | ||
{props.drawLayerSlot?.({})} | ||
</Sider> | ||
</LLMMultiMheelContext.Provider> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default LLMMultiMheelLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
export const LLMMultiWheelToolResult = { | ||
step_1: { | ||
dataSourceStep: 0, | ||
result: | ||
{ | ||
sort: [ | ||
[1], [2] | ||
], | ||
answerSort: { | ||
A1: [ | ||
[2], [1] | ||
], | ||
|
||
A2: [ | ||
[1], [2] | ||
] | ||
}, | ||
textAttribute: [{ | ||
isLaText: true, | ||
max: 22, | ||
min: 1, | ||
textId: "Ok", | ||
tip: "提示语", | ||
title: "标题", | ||
value: " $$\\frac{a}{b}$$ " | ||
}], | ||
modelData: [ | ||
{ | ||
id: 1, | ||
sort: [], | ||
answerList: [ | ||
{ | ||
id: 'A1', | ||
answer: '金百味1', | ||
}, | ||
{ | ||
id: 'A2', | ||
answer: '全刀手1', | ||
}, | ||
], | ||
}, | ||
{ | ||
id: 2, | ||
sort: [], | ||
answerList: [ | ||
{ | ||
id: 'A1', | ||
answer: '金百味', | ||
}, | ||
{ | ||
id: 'A2', | ||
answer: '全刀手', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
toolName: 'LLMMultiWheelTool', | ||
}, | ||
}; | ||
|
||
export const LLMMultiWheelToolQa = [ | ||
{ | ||
id: 1, | ||
question: '今天晚上吃什么?', | ||
name: 'Orl_answer', | ||
answerList: [ | ||
{ | ||
id: 'A1', | ||
answer: '金百味1', | ||
}, | ||
{ | ||
id: 'A2', | ||
answer: '全刀手1', | ||
}, | ||
], | ||
}, | ||
{ | ||
id: 2, | ||
question: '明天中午吃什么?', | ||
name: 'GPT_answer', | ||
answerList: [ | ||
{ | ||
id: 'A1', | ||
answer: '金百味', | ||
}, | ||
{ | ||
id: 'A2', | ||
answer: '全刀手', | ||
}, | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters