diff --git a/lib/ai/service/ai_service.dart b/lib/ai/service/ai_service.dart index 654f19f..06bfbb8 100644 --- a/lib/ai/service/ai_service.dart +++ b/lib/ai/service/ai_service.dart @@ -260,7 +260,6 @@ class AiService with FirebaseMixin, ToolsMixin { } List functionCalls; - var content = Content.text(''); while ((functionCalls = response.functionCalls.toList()).isNotEmpty) { final responses = []; for (final functionCall in functionCalls) { @@ -281,11 +280,10 @@ class AiService with FirebaseMixin, ToolsMixin { } } - content = response.candidates.first.content; - content.parts.addAll(responses); + message.parts.addAll(responses); // TODO(MrCsabaToth): Store in history? try { - response = await chat.sendMessage(content); + response = await chat.sendMessage(message); } catch (e) { log('Exception during function iteration chat.sendMessage: $e'); return null;