From c681ea8757499e92c3d81d140484073db0a400ec Mon Sep 17 00:00:00 2001 From: MrCsabaToth Date: Sat, 19 Oct 2024 21:28:58 -0700 Subject: [PATCH] The resolved response should be stripped off the tags as well #45 --- lib/ai/service/ai_service.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ai/service/ai_service.dart b/lib/ai/service/ai_service.dart index cffd55c..c002107 100644 --- a/lib/ai/service/ai_service.dart +++ b/lib/ai/service/ai_service.dart @@ -419,7 +419,9 @@ class AiService with FirebaseMixin, ToolsMixin { final content = Content.text(stuffedPrompt); final response = await model.generateContent([content]); - return response.text ?? ''; + return response.text != null && response.text!.isNotEmpty + ? response.strippedText() + : ''; } Future translate(