Bind tool-like objects to this chat model.
Assumes model has a tool calling API.
bind_tools(
self,
tools: Sequence[Union[Dict[str, Any], TypeBaseModel, Callable, BaseTool]],
*,
tool_choice: Optional[Union[dict, str, Literal['auto', 'none'], bool]] = None,
**kwargs: Any = {}
) -> Runnable[LanguageModelInput, AIMessage]| Name | Type | Description |
|---|---|---|
tools* | Sequence[Union[Dict[str, Any], TypeBaseModel, Callable, BaseTool]] | A list of tool definitions to bind to this chat model. Can be a dictionary, pydantic model, callable, or BaseTool. Pydantic models, callables, and BaseTools will be automatically converted to their schema dictionary representation. |
tool_choice | Optional[Union[dict, str, Literal['auto', 'none'], bool]] | Default: NoneWhich tool to require the model to call. Must be the name of the single provided function or "auto" to automatically determine which function to call (if any), or a dict of the form: {"type": "function", "function": {"name": <<tool_name>>}}. |
**kwargs | Any | Default: {}Any additional parameters to pass to the Runnable constructor. |