(feature)(chat-sdk) Support plain text display for queryMode as WEB_SERVICE (#1316)

This commit is contained in:
williamhliu
2024-07-01 18:21:18 +08:00
committed by GitHub
parent 24888228e5
commit 0226ebf341
2 changed files with 3 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ const ExecuteItem: React.FC<Props> = ({
const [showMsgContentTable, setShowMsgContentTable] = useState<boolean>(false); const [showMsgContentTable, setShowMsgContentTable] = useState<boolean>(false);
const [msgContentType, setMsgContentType] = useState<MsgContentTypeEnum>(); const [msgContentType, setMsgContentType] = useState<MsgContentTypeEnum>();
const titlePrefix = queryMode === 'PLAIN_TEXT' ? '问答' : '数据'; const titlePrefix = queryMode === 'PLAIN_TEXT' || queryMode === 'WEB_SERVICE' ? '问答' : '数据';
const getNodeTip = (title: ReactNode, tip?: string) => { const getNodeTip = (title: ReactNode, tip?: string) => {
return ( return (
@@ -115,7 +115,7 @@ const ExecuteItem: React.FC<Props> = ({
)} )}
{renderCustomExecuteNode && executeItemNode ? ( {renderCustomExecuteNode && executeItemNode ? (
executeItemNode executeItemNode
) : data?.queryMode === 'PLAIN_TEXT' ? ( ) : data?.queryMode === 'PLAIN_TEXT' || data?.queryMode === 'WEB_SERVICE' ? (
data?.textResult data?.textResult
) : data?.queryMode === 'WEB_PAGE' ? ( ) : data?.queryMode === 'WEB_PAGE' ? (
<WebPage id={queryId!} data={data} /> <WebPage id={queryId!} data={data} />

View File

@@ -97,6 +97,7 @@ const ChatItem: React.FC<Props> = ({
} else if ( } else if (
(queryColumns && queryColumns.length > 0 && queryResults) || (queryColumns && queryColumns.length > 0 && queryResults) ||
queryMode === 'WEB_PAGE' || queryMode === 'WEB_PAGE' ||
queryMode === 'WEB_SERVICE' ||
queryMode === 'PLAIN_TEXT' queryMode === 'PLAIN_TEXT'
) { ) {
data = res.data; data = res.data;