fix: check if model returned at least 1 feedback

This commit is contained in:
AnotiaWang
2025-02-14 17:16:16 +08:00
parent e15e35e5dd
commit 8c36e5728a
3 changed files with 7 additions and 1 deletions

View File

@ -63,6 +63,10 @@
error.value = t('invalidStructuredOutput')
}
}
// Check if model returned questions
if (!feedback.value.length) {
error.value = t('modelFeedback.noQuestions')
}
} catch (e: any) {
console.error('Error getting feedback:', e)
if (e.message.includes('Failed to fetch')) {

View File

@ -53,7 +53,8 @@
"description": "The AI will ask you some follow up questions to help you clarify the research direction.",
"waiting": "Waiting for model feedback...",
"submit": "Submit Answer",
"error": "Error getting feedback: {0}"
"error": "Error getting feedback: {0}",
"noQuestions": "The AI model did not return any follow-up questions."
},
"webBrowsing": {
"title": "3. Web Browsing",

View File

@ -55,6 +55,7 @@
"description": "AI 将会跟你确认一些细节,帮助你明确研究方向。",
"waiting": "等待模型反馈...",
"submit": "提交回答",
"noQuestions": "模型没有返回任何问题,请重试",
"error": "获取反馈失败:{0}"
},
"webBrowsing": {