docs: standardize .. code-block directive usage (#33122)

and fix typos
This commit is contained in:
Mason Daugherty
2025-09-25 16:49:56 -04:00
committed by GitHub
parent c3fed20940
commit 5bea28393d
24 changed files with 102 additions and 118 deletions

View File

@@ -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:

View File

@@ -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.

View File

@@ -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."