File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
FirebaseVertexAI/Sample/FunctionCallingSample/ViewModels Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ class FunctionCallingViewModel: ObservableObject {
116116 for functionResponse in functionResponses {
117117 messages. insert ( functionResponse. chatMessage ( ) , at: messages. count - 1 )
118118 }
119- responseStream = try chat. sendMessageStream ( functionResponses. modelContent ( ) )
119+ responseStream = try chat. sendMessageStream ( [ functionResponses. modelContent ( ) ] )
120120 }
121121 for try await chunk in responseStream {
122122 processResponseContent ( content: chunk)
@@ -132,7 +132,7 @@ class FunctionCallingViewModel: ObservableObject {
132132 for functionResponse in functionResponses {
133133 messages. insert ( functionResponse. chatMessage ( ) , at: messages. count - 1 )
134134 }
135- response = try await chat. sendMessage ( functionResponses. modelContent ( ) )
135+ response = try await chat. sendMessage ( [ functionResponses. modelContent ( ) ] )
136136 }
137137 processResponseContent ( content: response)
138138 }
@@ -249,7 +249,7 @@ private extension FunctionResponsePart {
249249}
250250
251251private extension [ FunctionResponsePart ] {
252- func modelContent( ) -> [ ModelContent ] {
253- return self . map { ModelContent ( role: " function " , parts: [ $0 ] ) }
252+ func modelContent( ) -> ModelContent {
253+ return ModelContent ( role: " function " , parts: self )
254254 }
255255}
You can’t perform that action at this time.
0 commit comments