File tree Expand file tree Collapse file tree 4 files changed +23
-11
lines changed
Sources/FunctionCalling-FirebaseVertexAI Expand file tree Collapse file tree 4 files changed +23
-11
lines changed Original file line number Diff line number Diff line change 1+ //
2+ // FirebaseAI+Extension.swift
3+ // FunctionCalling-FirebaseVertexAI
4+ //
5+ // Created by 伊藤史 on 2025/08/06.
6+ //
7+
8+ import FirebaseAI
9+
10+ // FIXME: "Since specifying FirebaseAI.Tool results in the error 'Tool' is not a
11+ // member type of class 'FirebaseAI.FirebaseAI', I have no choice but to
12+ // specify a typealias
13+ public typealias FirebaseAITool = Tool
Original file line number Diff line number Diff line change 66//
77
88import FunctionCalling
9- import FirebaseVertexAI
9+ import FirebaseAI
1010
1111extension FunctionCalling . InputSchema {
12- var toSchema : FirebaseVertexAI . Schema {
12+ var toSchema : Schema {
1313 switch type {
1414 case . string:
1515 return . string(
@@ -59,15 +59,15 @@ extension FunctionCalling.InputSchema {
5959}
6060
6161extension Optional < String > {
62- var toStringFormat : FirebaseVertexAI . Schema . StringFormat ? {
62+ var toStringFormat : Schema . StringFormat ? {
6363 guard let format = self else {
6464 return nil
6565 }
6666
6767 return . custom( format)
6868 }
6969
70- var toIntegerFormat : FirebaseVertexAI . Schema . IntegerFormat ? {
70+ var toIntegerFormat : Schema . IntegerFormat ? {
7171 guard let format = self else {
7272 return nil
7373 }
Original file line number Diff line number Diff line change 66//
77
88import FunctionCalling
9- import FirebaseVertexAI
9+ import FirebaseAI
1010
1111extension FunctionCalling . Tool {
12- var toFunctionDeclaration : FirebaseVertexAI . FunctionDeclaration {
13- let parameters : [ String : FirebaseVertexAI . Schema ] = {
12+ var toFunctionDeclaration : FunctionDeclaration {
13+ let parameters : [ String : Schema ] = {
1414 guard let properties = inputSchema. properties else {
1515 return [ : ]
1616 }
Original file line number Diff line number Diff line change 66//
77
88import FunctionCalling
9- import FirebaseVertexAI
10- import Foundation
9+ import FirebaseAI
1110
1211extension ToolContainer {
13- public var firebaseVertexAITools : [ FirebaseVertexAI . Tool ] {
12+ public var firebaseVertexAITools : [ FirebaseAITool ] {
1413 guard let declarations = allTools? . compactMap ( { $0. toFunctionDeclaration } ) else {
1514 return [ . functionDeclarations( [ ] ) ]
1615 }
1716
18- return [ FirebaseVertexAI . Tool . functionDeclarations ( declarations) ]
17+ return [ FirebaseAITool . functionDeclarations ( declarations) ]
1918 }
2019}
You can’t perform that action at this time.
0 commit comments