File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
colorist/step_05/lib/services Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,25 @@ class GeminiChatService {
3535
3636 if (response.functionCalls.isNotEmpty) {
3737 final geminiTools = ref.read (geminiToolsProvider);
38+ final results = < (String , Map <String , Object ?>)> [];
3839 for (final functionCall in response.functionCalls) {
39- geminiTools.handleFunctionCall (functionCall.name, functionCall.args);
40+ results.add ((
41+ functionCall.name,
42+ geminiTools.handleFunctionCall (
43+ functionCall.name,
44+ functionCall.args,
45+ ),
46+ ));
47+ final response = await chatSession.sendMessage (
48+ Content .functionResponses (
49+ results.map ((result) => FunctionResponse (result.$1, result.$2)),
50+ ),
51+ );
52+ final responseText = response.text;
53+ if (responseText != null ) {
54+ logStateNotifier.logLlmText (responseText);
55+ chatStateNotifier.appendToMessage (llmMessage.id, responseText);
56+ }
4057 }
4158 }
4259 } catch (e, st) {
You can’t perform that action at this time.
0 commit comments