(feature)(chat-sdk) modify the method for obtaining similar questions and recommended drill-down dimensions; do not display assistant button when there is only one assistant (#514)

This commit is contained in:
williamhliu
2023-12-15 17:41:35 +08:00
committed by GitHub
parent 4dae84034e
commit 4b00c16eb7
9 changed files with 107 additions and 57 deletions

View File

@@ -97,7 +97,9 @@ const ChatItem: React.FC<Props> = ({
data = res.data;
tip = '';
}
setDataCache({ ...dataCache, [chatContext!.id!]: { tip, data } });
if (chatContext) {
setDataCache({ ...dataCache, [chatContext!.id!]: { tip, data } });
}
if (data) {
setData(data);
setExecuteTip('');
@@ -356,9 +358,9 @@ const ChatItem: React.FC<Props> = ({
)}
{(parseTip !== '' || (executeMode && !executeLoading)) && integrateSystem !== 'c2' && (
<SimilarQuestionItem
queryText={msg || msgData?.queryText || ''}
agentId={agentId}
queryId={parseInfo?.queryId}
defaultExpanded={parseTip !== '' || executeTip !== '' || integrateSystem === 'wiki'}
similarQueries={data?.similarQueries}
onSelectQuestion={onSelectQuestion}
/>
)}