FunctionCallingConfig
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
public struct FunctionCallingConfig : Sendableextension FunctionCallingConfig: EncodableConfiguration for specifying function calling behavior.
-
Creates a function calling config where the model calls functions at its discretion.
Note
This is the default behavior.
Declaration
Swift
public static func auto() -> FunctionCallingConfig -
Creates a function calling config where the model will always call a provided function.
Declaration
Swift
public static func any(allowedFunctionNames: [String]? = nil) -> FunctionCallingConfigParameters
allowedFunctionNamesA set of function names that, when provided, limits the functions that the model will call.
-
Creates a function calling config where the model will never call a function.
Note
This can also be achieved by not passing any
FunctionDeclarationtools when instantiating the model.Declaration
Swift
public static func none() -> FunctionCallingConfig