openai: add `parallel_tool_calls` to api ref (#22746)

![Screenshot 2024-06-10 at 1 41 24
PM](https://github.com/langchain-ai/langchain/assets/26529506/2626bf9c-41c6-4431-b2e1-f59de1e4e468)
pull/22754/head
ccurme 4 months ago committed by GitHub
parent 058a64c563
commit f9fdca6cc2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1281,6 +1281,28 @@ class ChatOpenAI(BaseChatOpenAI):
'args': {'location': 'New York, NY'},
'id': 'call_6ghfKxV264jEfe1mRIkS3PE7'}]
Note that ``openai >= 1.32`` supports a ``parallel_tool_calls`` parameter
that defaults to ``True``. This parameter can be set to ``False`` to
disable parallel tool calls:
.. code-block:: python
ai_msg = llm_with_tools.invoke(
"What is the weather in LA and NY?",
parallel_tool_calls=False,
)
ai_msg.tool_calls
.. code-block:: python
[{'name': 'GetWeather',
'args': {'location': 'Los Angeles, CA'},
'id': 'call_4OoY0ZR99iEvC7fevsH8Uhtz'}]
Like other runtime parameters, ``parallel_tool_calls`` can be bound to a model
using ``llm.bind(parallel_tool_calls=False)`` or during instantiation by
setting ``model_kwargs``.
See ``ChatOpenAI.bind_tools()`` method for more.
Structured output:

Loading…
Cancel
Save