From 8c36e5728ad22c67c714b2a7937ec9a15f97659a Mon Sep 17 00:00:00 2001 From: AnotiaWang Date: Fri, 14 Feb 2025 17:16:16 +0800 Subject: [PATCH] fix: check if model returned at least 1 feedback --- components/ResearchFeedback.vue | 4 ++++ i18n/en.json | 3 ++- i18n/zh.json | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/components/ResearchFeedback.vue b/components/ResearchFeedback.vue index ee22dcd..5c6959d 100644 --- a/components/ResearchFeedback.vue +++ b/components/ResearchFeedback.vue @@ -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')) { diff --git a/i18n/en.json b/i18n/en.json index 6c18bf8..cf1ac0b 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -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", diff --git a/i18n/zh.json b/i18n/zh.json index 2e2e7d7..50add41 100644 --- a/i18n/zh.json +++ b/i18n/zh.json @@ -55,6 +55,7 @@ "description": "AI 将会跟你确认一些细节,帮助你明确研究方向。", "waiting": "等待模型反馈...", "submit": "提交回答", + "noQuestions": "模型没有返回任何问题,请重试", "error": "获取反馈失败:{0}" }, "webBrowsing": {