File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Sources/FunctionCalling-FirebaseVertexAI Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,14 @@ import FunctionCalling
99import FirebaseVertexAI
1010import Foundation
1111
12- typealias FunctionCallingTool = FunctionCalling . Tool
13-
1412extension ToolContainer {
1513 public var firebaseVertexAITools : [ FirebaseVertexAI . Tool ] {
16- get throws {
17- let data = allTools . data ( using : . utf8 ) !
18- let functionCallingTools = try JSONDecoder ( ) . decode ( [ FunctionCallingTool ] . self , from : data )
19- let firebaseVertexAITools = functionCallingTools . map { $0. toFunctionDeclaration }
20-
21- return [ FirebaseVertexAI . Tool ( functionDeclarations : firebaseVertexAITools ) ]
14+ get {
15+ [
16+ FirebaseVertexAI . Tool (
17+ functionDeclarations : allTools ? . compactMap { $0. toFunctionDeclaration }
18+ )
19+ ]
2220 }
2321 }
2422}
You can’t perform that action at this time.
0 commit comments