mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
@@ -868,9 +868,9 @@ class AzureChatOpenAI(BaseChatOpenAI):
|
||||
If schema is specified via TypedDict or JSON schema, ``strict`` is not
|
||||
enabled by default. Pass ``strict=True`` to enable it.
|
||||
|
||||
.. note:
|
||||
``strict`` can only be non-null if ``method`` is
|
||||
``'json_schema'`` or ``'function_calling'``.
|
||||
.. note::
|
||||
``strict`` can only be non-null if ``method`` is ``'json_schema'``
|
||||
or ``'function_calling'``.
|
||||
tools:
|
||||
A list of tool-like objects to bind to the chat model. Requires that:
|
||||
|
||||
|
||||
@@ -2491,7 +2491,7 @@ class ChatOpenAI(BaseChatOpenAI): # type: ignore[override]
|
||||
for summary in block["summary"]:
|
||||
print(summary["text"])
|
||||
|
||||
.. code-block:: none
|
||||
.. code-block::
|
||||
|
||||
Output: 3³ = 27
|
||||
Reasoning: The user wants to know...
|
||||
@@ -2787,7 +2787,6 @@ class ChatOpenAI(BaseChatOpenAI): # type: ignore[override]
|
||||
- ``extra_body``: Parameters are **nested under ``extra_body``** key in request
|
||||
|
||||
.. important::
|
||||
|
||||
Always use ``extra_body`` for custom parameters, **not** ``model_kwargs``.
|
||||
Using ``model_kwargs`` for non-OpenAI parameters will cause API errors.
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ class BaseOpenAI(BaseLLM):
|
||||
response = llm.invoke(input_text)
|
||||
print(response)
|
||||
|
||||
.. code-block:: none
|
||||
.. code-block::
|
||||
|
||||
"a philosophical question that has been debated by thinkers and
|
||||
scholars for centuries."
|
||||
@@ -140,7 +140,7 @@ class BaseOpenAI(BaseLLM):
|
||||
for chunk in llm.stream(input_text):
|
||||
print(chunk, end="")
|
||||
|
||||
.. code-block:: none
|
||||
.. code-block::
|
||||
|
||||
a philosophical question that has been debated by thinkers and
|
||||
scholars for centuries.
|
||||
@@ -157,7 +157,7 @@ class BaseOpenAI(BaseLLM):
|
||||
# batch:
|
||||
# await llm.abatch([input_text])
|
||||
|
||||
.. code-block:: none
|
||||
.. code-block::
|
||||
|
||||
"a philosophical question that has been debated by thinkers and
|
||||
scholars for centuries."
|
||||
@@ -754,7 +754,7 @@ class OpenAI(BaseOpenAI):
|
||||
input_text = "The meaning of life is "
|
||||
llm.invoke(input_text)
|
||||
|
||||
.. code-block:: none
|
||||
.. code-block::
|
||||
|
||||
"a philosophical question that has been debated by thinkers and scholars for centuries."
|
||||
|
||||
@@ -764,7 +764,7 @@ class OpenAI(BaseOpenAI):
|
||||
for chunk in llm.stream(input_text):
|
||||
print(chunk, end="|")
|
||||
|
||||
.. code-block:: none
|
||||
.. code-block::
|
||||
|
||||
a| philosophical| question| that| has| been| debated| by| thinkers| and| scholars| for| centuries|.
|
||||
|
||||
@@ -772,7 +772,7 @@ class OpenAI(BaseOpenAI):
|
||||
|
||||
"".join(llm.stream(input_text))
|
||||
|
||||
.. code-block:: none
|
||||
.. code-block::
|
||||
|
||||
"a philosophical question that has been debated by thinkers and scholars for centuries."
|
||||
|
||||
@@ -788,7 +788,7 @@ class OpenAI(BaseOpenAI):
|
||||
# batch:
|
||||
# await llm.abatch([input_text])
|
||||
|
||||
.. code-block:: none
|
||||
.. code-block::
|
||||
|
||||
"a philosophical question that has been debated by thinkers and scholars for centuries."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user