From 07ee964cf0ffb635138d630d621c610326685f9f Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 11 Sep 2026 17:49:38 -0700 Subject: [PATCH] [AI] Replace function role is replace by user for gemini 3.5 --- .../FunctionCalling/ViewModels/FunctionCallingViewModel.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firebaseai/FirebaseAIExample/Features/FunctionCalling/ViewModels/FunctionCallingViewModel.swift b/firebaseai/FirebaseAIExample/Features/FunctionCalling/ViewModels/FunctionCallingViewModel.swift index 123387c31..a2ad513ca 100644 --- a/firebaseai/FirebaseAIExample/Features/FunctionCalling/ViewModels/FunctionCallingViewModel.swift +++ b/firebaseai/FirebaseAIExample/Features/FunctionCalling/ViewModels/FunctionCallingViewModel.swift @@ -213,7 +213,7 @@ class FunctionCallingViewModel: ObservableObject { if !functionResponses.isEmpty { let finalResponse = try chat - .sendMessageStream([ModelContent(role: "function", parts: functionResponses)]) + .sendMessageStream([ModelContent(role: "user", parts: functionResponses)]) for try await chunk in finalResponse { guard let candidate = chunk.candidates.first else { @@ -266,7 +266,7 @@ class FunctionCallingViewModel: ObservableObject { if !functionResponses.isEmpty { let finalResponse = try await chat - .sendMessage([ModelContent(role: "function", parts: functionResponses)]) + .sendMessage([ModelContent(role: "user", parts: functionResponses)]) guard let candidate = finalResponse.candidates.first else { throw NSError(