Skip to content

Commit efd280e

Browse files
committed
adopt updated interface
1 parent 124ae00 commit efd280e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Sources/FunctionCalling-FirebaseVertexAI/FunctionCalling_FirebaseVertexAI.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ import FunctionCalling
99
import FirebaseVertexAI
1010
import Foundation
1111

12-
typealias FunctionCallingTool = FunctionCalling.Tool
13-
1412
extension 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
}

0 commit comments

Comments
 (0)