mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-31 08:32:32 +00:00
openai[patch]: make parallel_tool_calls explicit kwarg of bind_tools (#29669)
Improves discoverability and documentation. cc @vbarda
This commit is contained in:
parent
2a243df7bb
commit
92e2239414
@ -1183,6 +1183,7 @@ class BaseChatOpenAI(BaseChatModel):
|
||||
Union[dict, str, Literal["auto", "none", "required", "any"], bool]
|
||||
] = None,
|
||||
strict: Optional[bool] = None,
|
||||
parallel_tool_calls: Optional[bool] = None,
|
||||
**kwargs: Any,
|
||||
) -> Runnable[LanguageModelInput, BaseMessage]:
|
||||
"""Bind tool-like objects to this chat model.
|
||||
@ -1208,6 +1209,8 @@ class BaseChatOpenAI(BaseChatModel):
|
||||
If False, input schema will not be validated and model output will not
|
||||
be validated.
|
||||
If None, ``strict`` argument will not be passed to the model.
|
||||
parallel_tool_calls: Set to ``False`` to disable parallel tool use.
|
||||
Defaults to ``None`` (no specification, which allows parallel tool use).
|
||||
kwargs: Any additional parameters are passed directly to
|
||||
:meth:`~langchain_openai.chat_models.base.ChatOpenAI.bind`.
|
||||
|
||||
@ -1217,6 +1220,8 @@ class BaseChatOpenAI(BaseChatModel):
|
||||
|
||||
""" # noqa: E501
|
||||
|
||||
if parallel_tool_calls is not None:
|
||||
kwargs["parallel_tool_calls"] = parallel_tool_calls
|
||||
formatted_tools = [
|
||||
convert_to_openai_tool(tool, strict=strict) for tool in tools
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user