Commit 25207c50 by Archer Committed by GitHub

perf: search result (#5608)

parent 3fc163c5
...@@ -268,7 +268,9 @@ export async function dispatchDatasetSearch( ...@@ -268,7 +268,9 @@ export async function dispatchDatasetSearch(
}, },
[DispatchNodeResponseKeyEnum.nodeResponse]: responseData, [DispatchNodeResponseKeyEnum.nodeResponse]: responseData,
nodeDispatchUsages, nodeDispatchUsages,
[DispatchNodeResponseKeyEnum.toolResponses]: { [DispatchNodeResponseKeyEnum.toolResponses]:
searchRes.length > 0
? {
prompt: getDatasetSearchToolResponsePrompt(), prompt: getDatasetSearchToolResponsePrompt(),
cites: searchRes.map((item) => ({ cites: searchRes.map((item) => ({
id: item.id, id: item.id,
...@@ -277,6 +279,7 @@ export async function dispatchDatasetSearch( ...@@ -277,6 +279,7 @@ export async function dispatchDatasetSearch(
content: `${item.q}\n${item.a}`.trim() content: `${item.q}\n${item.a}`.trim()
})) }))
} }
: 'No results'
}; };
} catch (error) { } catch (error) {
return getNodeErrResponse({ error }); return getNodeErrResponse({ error });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment