@@ -164,6 +164,9 @@ public struct Tool {
164
164
/// Enables the model to execute code as part of generation.
165
165
let codeExecution : CodeExecution ?
166
166
167
+ /// Enables the Google Search
168
+ let googleSearch : GoogleSearch ?
169
+
167
170
/// Constructs a new `Tool`.
168
171
///
169
172
/// - Parameters:
@@ -177,9 +180,11 @@ public struct Tool {
177
180
/// ``ModelContent/role`` "function", providing generation context for the next model turn.
178
181
/// - codeExecution: Enables the model to execute code as part of generation, if provided.
179
182
public init ( functionDeclarations: [ FunctionDeclaration ] ? = nil ,
180
- codeExecution: CodeExecution ? = nil ) {
183
+ codeExecution: CodeExecution ? = nil ,
184
+ googleSearch: GoogleSearch ? = nil ) {
181
185
self . functionDeclarations = functionDeclarations
182
186
self . codeExecution = codeExecution
187
+ self . googleSearch = googleSearch
183
188
}
184
189
}
185
190
@@ -259,6 +264,12 @@ public struct CodeExecution {
259
264
public init ( ) { }
260
265
}
261
266
267
+ /// Tool for grounding with Google Search
268
+ public struct GoogleSearch {
269
+ /// Constructs a new `GoogleSearch` tool.
270
+ public init ( ) { }
271
+ }
272
+
262
273
/// Code generated by the model that is meant to be executed, and the result returned to the model.
263
274
///
264
275
/// Only generated when using the ``CodeExecution`` tool, in which case the code will automatically
@@ -351,6 +362,8 @@ extension FunctionResponse: Encodable {}
351
362
352
363
extension CodeExecution : Encodable { }
353
364
365
+ extension GoogleSearch : Encodable { }
366
+
354
367
extension ExecutableCode : Codable { }
355
368
356
369
@available ( iOS 15 . 0 , macOS 11 . 0 , macCatalyst 15 . 0 , * )
0 commit comments