Bind tool-like objects to this chat model.
The tool_choice parameter controls how the model uses the tools you pass.
There are three available options:
"auto": Lets the model decide whether or not to invoke a tool. This is the
recommended way to do function calling with our models."none": Disables tool calling. In this case, even if you pass tools to
the model, the model will not invoke any tools."tool": Forces the model to invoke one or more of the tools it has
been passed.bind_tools(
self,
tools: Sequence[Union[Dict[str, Any], Type[BaseModel], Callable, BaseTool]],
*,
tool_choice: Optional[Union[str, Literal['any']]] = 'auto',
strict: Optional[bool] = None,
**kwargs: Any = {}
) -> Runnable[LanguageModelInput, AIMessage]| Name | Type | Description |
|---|---|---|
tools* | Sequence[Union[Dict[str, Any], Type[BaseModel], Callable, BaseTool]] | A list of tool definitions to bind to this chat model.
Supports any tool definition handled by
:meth: |
tool_choice | Optional[Union[str, Literal['any']]] | Default: 'auto'Controls how the model uses the tools you pass. Options are "auto", "none", or "tool". Defaults to "auto". |
strict | Optional[bool] | Default: None |
kwargs | Any | Default: {}Any additional parameters are passed directly to the model. |