(feature)(webapp) add multiple parse infos in history message (#256)

Co-authored-by: williamhliu <williamhliu@tencent.com>
This commit is contained in:
williamhliu
2023-10-18 17:26:43 +08:00
committed by GitHub
parent 7acdf9cb3d
commit 65614ed3ba
12 changed files with 58 additions and 129 deletions

View File

@@ -75,6 +75,7 @@ const MessageContainer: React.FC<Props> = ({
msgValue,
score,
identityMsg,
parseInfos,
msgData,
filters,
} = msgItem;
@@ -91,6 +92,7 @@ const MessageContainer: React.FC<Props> = ({
{identityMsg && <Text position="left" data={identityMsg} />}
<ChatItem
msg={msgValue || msg || ''}
parseInfos={parseInfos}
msgData={msgData}
conversationId={chatId}
modelId={modelId}

View File

@@ -41,101 +41,6 @@
.ss-chat-table-even-row {
background-color: #fbfbfb;
}
.ant-table-wrapper .ant-table-pagination {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin: 16px 0 1px;
row-gap: 8px;
}
.ant-pagination .ant-pagination-prev,
.ant-pagination .ant-pagination-next {
display: inline-block;
min-width: 32px;
height: 32px;
color: rgba(0, 0, 0, 0.88);
line-height: 32px;
text-align: center;
vertical-align: middle;
list-style: none;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
.ant-pagination-item-link {
display: block;
width: 100%;
height: 100%;
padding: 0;
font-size: 12px;
text-align: center;
background-color: transparent;
border: 1px solid transparent;
border-radius: 6px;
outline: none;
transition: border 0.2s;
}
}
.ant-pagination-jump-prev,
.ant-pagination-jump-next {
.ant-pagination-item-link {
display: inline-block;
min-width: 32px;
height: 32px;
color: rgba(0, 0, 0, 0.25);
line-height: 32px;
text-align: center;
vertical-align: middle;
list-style: none;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
}
}
.ant-pagination-options {
display: inline-block;
margin-left: 16px;
vertical-align: middle;
}
.ant-pagination .ant-pagination-item {
display: inline-block;
min-width: 32px;
height: 32px;
line-height: 30px;
text-align: center;
vertical-align: middle;
list-style: none;
background-color: transparent;
border: 1px solid transparent;
border-radius: 6px;
outline: 0;
cursor: pointer;
user-select: none;
margin-inline-end: 8px;
}
.ant-pagination .ant-pagination-item-active {
font-weight: 600;
background-color: #ffffff;
border-color: var(--primary-color);
}
.ant-pagination {
box-sizing: border-box;
margin: 0;
padding: 0;
color: #606266;
font-size: 14px;
font-variant: tabular-nums;
line-height: 1.5715;
list-style: none;
font-feature-settings: 'tnum', 'tnum';
}
}
}
}

View File

@@ -165,7 +165,7 @@ const Chat: ForwardRefRenderFunction<any, Props> = (
{
id: uuid(),
type: MessageTypeEnum.AGENT_LIST,
msg: agent?.name || currentAgent?.name || agentList?.[0].name,
msg: agent?.name || currentAgent?.name || agentList?.[0]?.name,
},
]);
};
@@ -175,6 +175,7 @@ const Chat: ForwardRefRenderFunction<any, Props> = (
id: item.questionId,
type: MessageTypeEnum.QUESTION,
msg: item.queryText,
parseInfos: item.parseInfos,
msgData: item.queryResult,
score: item.score,
agentId: currentAgent?.id,

View File

@@ -1,4 +1,4 @@
import { MsgDataType, SendMsgParamsType } from "../common/type";
import { ChatContextType, MsgDataType, SendMsgParamsType } from "../common/type";
export enum MessageTypeEnum {
TEXT = 'text', // 指标文本
@@ -22,6 +22,7 @@ export type MessageItem = {
modelId?: number;
agentId?: number;
entityId?: string;
parseInfos?: ChatContextType[];
msgData?: MsgDataType;
quote?: string;
score?: number;