Bind tool-like objects to this chat model.
Assumes model is compatible with OpenAI tool-calling API.
bind_tools(
self,
tools: Sequence[dict[str, Any] | type | Callable | BaseTool],
*,
tool_choice: dict | str | bool | None = None,
strict: bool | None = None,
parallel_tool_calls: bool | None = None,
response_format: _DictOrPydanticClass | None = None,
**kwargs: Any = {}
) -> Runnable[LanguageModelInput, AIMessage]| Name | Type | Description |
|---|---|---|
tools* | Sequence[dict[str, Any] | type | Callable | BaseTool] | A list of tool definitions to bind to this chat model. Supports any tool definition handled by |
tool_choice | dict | str | bool | None | Default: NoneWhich tool to require the model to call. Options are:
|
strict | bool | None | Default: NoneIf |
parallel_tool_calls | bool | None | Default: NoneSet to |
response_format | _DictOrPydanticClass | None | Default: NoneOptional schema to format model response. If provided and the model does not call a tool, the model will generate a structured response. |
kwargs | Any | Default: {}Any additional parameters are passed directly to |