disallowed
TypeScriptstatic get disallowed(): GenerationOptions_ToolCallingModeSwift declarationstatic let disallowed: GenerationOptions.ToolCallingModeThe model may not call any tool.
struct · iOS 27.0+ · SDK 27.1
struct ToolCallingModeA value you use to describe the model behavior when it comes to tool usage. Use this to control how the model interacts with tools for a given request. Tool calling mode supports three modes: - term ``GenerationOptions/ToolCallingMode/allowed``: The model may call tools. This is the default behavior. - term ``GenerationOptions/ToolCallingMode/required``: The model must call one or more tools before it can respond. - term ``GenerationOptions/ToolCallingMode/disallowed``: The model can't call any tools and responds using only its own knowledge. The following changes the mode from ``GenerationOptions/ToolCallingMode/required`` to ``GenerationOptions/ToolCallingMode/allowed`` after the first tool call, which lets the model produce a final response: ```swift extension SessionPropertyValues { @SessionPropertyEntry var toolCallCount: Int = 0 } struct RecipeDynamicProfile: LanguageModelSession.DynamicProfile { @SessionProperty(\.toolCallCount) var toolCallCount var body: some LanguageModelSession.DynamicProfile { Profile { BreadDatabaseTool() } .toolCallingMode(toolCallCount < 1 ? .required : .allowed) .onToolCall { toolCallCount += 1 } } } ``` > Important: When you set the mode to ``GenerationOptions/ToolCallingMode/required``, you must define an exit condition by either throwing an error from a tool's ``Tool/call(arguments:)`` method or by changing the mode dynamically using a ``LanguageModelSession/DynamicProfile``; otherwise, the model continues to call the tool.
static get disallowed(): GenerationOptions_ToolCallingModeSwift declarationstatic let disallowed: GenerationOptions.ToolCallingModeThe model may not call any tool.
get kind(): GenerationOptions_ToolCallingMode_KindSwift declarationvar kind: GenerationOptions.ToolCallingMode.Kindset kind(value: GenerationOptions_ToolCallingMode_Kind)Swift declarationvar kind: GenerationOptions.ToolCallingMode.Kindstatic get allowed(): GenerationOptions_ToolCallingModeSwift declarationstatic let allowed: GenerationOptions.ToolCallingModeThe model may or may not call tools. This is the default.
static get required(): GenerationOptions_ToolCallingModeSwift declarationstatic let required: GenerationOptions.ToolCallingModeThe model must call one or multiple tools. Please note that ``LanguageModelSession`` will loop until a `Tool` throws an error or this value is changed dynamically via `LanguageModelSession.Manifest`.
No declarations were skipped in this snapshot.