Skip to content

Commit 3c4c4a8

Browse files
committed
Send function results to Gemini
1 parent 4ef6dd7 commit 3c4c4a8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

colorist/step_05/lib/services/gemini_chat_service.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ class GeminiChatService {
2929
final llmMessage = chatStateNotifier.createLlmMessage();
3030
try {
3131
final response = await chatSession.sendMessage(Content.text(message));
32-
final responseText = response.text?.trim() ?? 'No text response received';
33-
logStateNotifier.logLlmText(responseText);
34-
chatStateNotifier.appendToMessage(llmMessage.id, responseText);
32+
33+
final responseText = response.text;
34+
if (responseText != null) {
35+
logStateNotifier.logLlmText(responseText);
36+
chatStateNotifier.appendToMessage(llmMessage.id, responseText);
37+
}
3538

3639
if (response.functionCalls.isNotEmpty) {
3740
final geminiTools = ref.read(geminiToolsProvider);

0 commit comments

Comments
 (0)