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
9
9
import FirebaseVertexAI
10
10
import Foundation
11
11
12
- typealias FunctionCallingTool = FunctionCalling . Tool
13
-
14
12
extension ToolContainer {
15
13
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
+ ]
22
20
}
23
21
}
24
22
}
You can’t perform that action at this time.
0 commit comments