Skip to content

Commit 4fce708

Browse files
committed
Remove function behavior stuff
1 parent 2cd1544 commit 4fce708

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

FirebaseAI/Sources/Tool.swift

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ public struct FunctionDeclaration: Sendable {
2929
/// Describes the parameters to this function; must be of type `DataType.object`.
3030
let parameters: Schema?
3131

32-
// TODO: remove (added for testing)
33-
let behavior: FunctionBehavior?
34-
3532
/// Constructs a new `FunctionDeclaration`.
3633
///
3734
/// - Parameters:
@@ -43,21 +40,8 @@ public struct FunctionDeclaration: Sendable {
4340
/// calls; by default, all parameters are considered required.
4441
public init(name: String, description: String, parameters: [String: Schema],
4542
optionalParameters: [String] = []) {
46-
self.init(
47-
name: name,
48-
description: description,
49-
parameters: parameters,
50-
optionalParameters: optionalParameters,
51-
functionBehavior: nil
52-
)
53-
}
54-
55-
// TODO: remove (added for testing)
56-
public init(name: String, description: String, parameters: [String: Schema],
57-
optionalParameters: [String] = [], functionBehavior: FunctionBehavior? = nil) {
5843
self.name = name
5944
self.description = description
60-
behavior = functionBehavior
6145
self.parameters = Schema.object(
6246
properties: parameters,
6347
optionalProperties: optionalParameters,
@@ -66,12 +50,6 @@ public struct FunctionDeclaration: Sendable {
6650
}
6751
}
6852

69-
// TODO: remove (added for testing)
70-
public enum FunctionBehavior: String, Sendable, Encodable {
71-
case blocking = "BLOCKING"
72-
case nonBlocking = "NON_BLOCKING"
73-
}
74-
7553
/// A tool that allows the generative model to connect to Google Search to access and incorporate
7654
/// up-to-date information from the web into its responses.
7755
///
@@ -237,15 +215,13 @@ extension FunctionDeclaration: Encodable {
237215
case name
238216
case description
239217
case parameters
240-
case behavior // TODO: remove (added for testing)
241218
}
242219

243220
public func encode(to encoder: Encoder) throws {
244221
var container = encoder.container(keyedBy: CodingKeys.self)
245222
try container.encode(name, forKey: .name)
246223
try container.encode(description, forKey: .description)
247224
try container.encode(parameters, forKey: .parameters)
248-
try container.encode(behavior, forKey: .behavior) // TODO: remove (added for testing)
249225
}
250226
}
251227

0 commit comments

Comments
 (0)