Skip to content

Commit

Permalink
(feature)(chat-sdk) Support plain text display for queryMode as WEB_S…
Browse files Browse the repository at this point in the history
…ERVICE (#1316)
  • Loading branch information
williamhliu committed Jul 1, 2024
1 parent 2488822 commit 0226ebf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const ExecuteItem: React.FC<Props> = ({
const [showMsgContentTable, setShowMsgContentTable] = useState<boolean>(false);
const [msgContentType, setMsgContentType] = useState<MsgContentTypeEnum>();

const titlePrefix = queryMode === 'PLAIN_TEXT' ? '问答' : '数据';
const titlePrefix = queryMode === 'PLAIN_TEXT' || queryMode === 'WEB_SERVICE' ? '问答' : '数据';

const getNodeTip = (title: ReactNode, tip?: string) => {
return (
Expand Down Expand Up @@ -115,7 +115,7 @@ const ExecuteItem: React.FC<Props> = ({
)}
{renderCustomExecuteNode && executeItemNode ? (
executeItemNode
) : data?.queryMode === 'PLAIN_TEXT' ? (
) : data?.queryMode === 'PLAIN_TEXT' || data?.queryMode === 'WEB_SERVICE' ? (
data?.textResult
) : data?.queryMode === 'WEB_PAGE' ? (
<WebPage id={queryId!} data={data} />
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/chat-sdk/src/components/ChatItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const ChatItem: React.FC<Props> = ({
} else if (
(queryColumns && queryColumns.length > 0 && queryResults) ||
queryMode === 'WEB_PAGE' ||
queryMode === 'WEB_SERVICE' ||
queryMode === 'PLAIN_TEXT'
) {
data = res.data;
Expand Down

0 comments on commit 0226ebf

Please sign in to comment.