mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-01-05 16:59:26 +08:00
(feature)(webapp) add filter modify and similar questions (#213)
This commit is contained in:
@@ -75,7 +75,6 @@ const MessageContainer: React.FC<Props> = ({
|
||||
identityMsg,
|
||||
msgData,
|
||||
score,
|
||||
parseOptions,
|
||||
filters,
|
||||
} = msgItem;
|
||||
|
||||
@@ -108,24 +107,6 @@ const MessageContainer: React.FC<Props> = ({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{type === MessageTypeEnum.PARSE_OPTIONS && (
|
||||
<ChatItem
|
||||
msg={msgValue || msg || ''}
|
||||
conversationId={chatId}
|
||||
modelId={modelId}
|
||||
agentId={agentId}
|
||||
filter={filters}
|
||||
isLastMessage={index === messageList.length - 1}
|
||||
triggerResize={triggerResize}
|
||||
parseOptions={parseOptions}
|
||||
integrateSystem={integrateSystem}
|
||||
onMsgDataLoaded={(data: MsgDataType, valid: boolean) => {
|
||||
onMsgDataLoaded(data, msgId, msgValue || msg || '', valid);
|
||||
}}
|
||||
onUpdateMessageScroll={updateMessageContainerScroll}
|
||||
onSendMsg={onSendMsg}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -21,7 +21,7 @@ export enum SemanticTypeEnum {
|
||||
}
|
||||
|
||||
export const SEMANTIC_TYPE_MAP = {
|
||||
[SemanticTypeEnum.MODEL]: '数据来源',
|
||||
[SemanticTypeEnum.MODEL]: '数据模型',
|
||||
[SemanticTypeEnum.DIMENSION]: '维度',
|
||||
[SemanticTypeEnum.METRIC]: '指标',
|
||||
[SemanticTypeEnum.VALUE]: '维度值',
|
||||
|
||||
@@ -309,21 +309,11 @@ const Chat: ForwardRefRenderFunction<any, Props> = (
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
let parseOptionsItem: any;
|
||||
if (data.parseOptions && data.parseOptions.length > 0) {
|
||||
parseOptionsItem = {
|
||||
id: uuid(),
|
||||
msg: messageList[messageList.length - 1]?.msg,
|
||||
type: MessageTypeEnum.PARSE_OPTIONS,
|
||||
parseOptions: data.parseOptions,
|
||||
};
|
||||
}
|
||||
const msgs = cloneDeep(messageList);
|
||||
const msg = msgs.find(item => item.id === questionId);
|
||||
if (msg) {
|
||||
msg.msgData = data;
|
||||
const msgList = [...msgs, ...(parseOptionsItem ? [parseOptionsItem] : [])];
|
||||
setMessageList(msgList);
|
||||
setMessageList(msgs);
|
||||
}
|
||||
updateMessageContainerScroll(`${questionId}`);
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChatContextType, MsgDataType, SendMsgParamsType } from "../common/type";
|
||||
import { MsgDataType, SendMsgParamsType } from "../common/type";
|
||||
|
||||
export enum MessageTypeEnum {
|
||||
TEXT = 'text', // 指标文本
|
||||
@@ -10,7 +10,6 @@ export enum MessageTypeEnum {
|
||||
PLUGIN = 'PLUGIN', // 插件
|
||||
WEB_PAGE = 'WEB_PAGE', // 插件
|
||||
RECOMMEND_QUESTIONS = 'recommend_questions', // 推荐问题
|
||||
PARSE_OPTIONS = 'parse_options', // 解析选项
|
||||
AGENT_LIST = 'agent_list', // 专家列表
|
||||
}
|
||||
|
||||
@@ -27,7 +26,6 @@ export type MessageItem = {
|
||||
quote?: string;
|
||||
score?: number;
|
||||
feedback?: string;
|
||||
parseOptions?: ChatContextType[];
|
||||
filters?: any;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user