chore: throw error when no search results found
This commit is contained in:
@ -92,7 +92,8 @@
|
|||||||
"nodeFailed": "Search failed",
|
"nodeFailed": "Search failed",
|
||||||
"nodeFailedToast": "Search node \"{label}\" failed",
|
"nodeFailedToast": "Search node \"{label}\" failed",
|
||||||
"followUpQuestions": "Follow-up Questions",
|
"followUpQuestions": "Follow-up Questions",
|
||||||
"retry": "Retry"
|
"retry": "Retry",
|
||||||
|
"noSearchResult": "No search results found"
|
||||||
},
|
},
|
||||||
"researchReport": {
|
"researchReport": {
|
||||||
"title": "4. Research Report",
|
"title": "4. Research Report",
|
||||||
|
@ -92,7 +92,8 @@
|
|||||||
"nodeFailed": "Zoeken mislukt",
|
"nodeFailed": "Zoeken mislukt",
|
||||||
"nodeFailedToast": "Zoekknooppunt \"{label}\" is mislukt",
|
"nodeFailedToast": "Zoekknooppunt \"{label}\" is mislukt",
|
||||||
"followUpQuestions": "Vervolgvragen",
|
"followUpQuestions": "Vervolgvragen",
|
||||||
"retry": "Opnieuw proberen"
|
"retry": "Opnieuw proberen",
|
||||||
|
"noSearchResult": "Geen zoekresultaten gevonden"
|
||||||
},
|
},
|
||||||
"researchReport": {
|
"researchReport": {
|
||||||
"title": "4. Onderzoeksrapport",
|
"title": "4. Onderzoeksrapport",
|
||||||
|
@ -92,7 +92,8 @@
|
|||||||
"nodeFailed": "搜索失败",
|
"nodeFailed": "搜索失败",
|
||||||
"nodeFailedToast": "搜索步骤 “{label}” 失败",
|
"nodeFailedToast": "搜索步骤 “{label}” 失败",
|
||||||
"followUpQuestions": "后续问题",
|
"followUpQuestions": "后续问题",
|
||||||
"retry": "重试"
|
"retry": "重试",
|
||||||
|
"noSearchResult": "未找到搜索结果"
|
||||||
},
|
},
|
||||||
"researchReport": {
|
"researchReport": {
|
||||||
"title": "4. 研究报告",
|
"title": "4. 研究报告",
|
||||||
|
@ -384,6 +384,9 @@ export async function deepResearch({
|
|||||||
maxResults: 5,
|
maxResults: 5,
|
||||||
lang: languageCode,
|
lang: languageCode,
|
||||||
})
|
})
|
||||||
|
if (!results.length) {
|
||||||
|
throw new Error(t('webBrowsing.noSearchResult'))
|
||||||
|
}
|
||||||
console.log(
|
console.log(
|
||||||
`[DeepResearch] Searched "${searchQuery.query}", found ${results.length} contents`,
|
`[DeepResearch] Searched "${searchQuery.query}", found ${results.length} contents`,
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user