style: address Sphinx double-backtick snippet syntax (#33389)

This commit is contained in:
Mason Daugherty
2025-10-09 13:35:51 -04:00
committed by GitHub
parent f405a2c57d
commit d8a680ee57
145 changed files with 1306 additions and 1307 deletions

View File

@@ -889,9 +889,9 @@ class ChatHuggingFace(BaseChatModel):
method: The method for steering model generation, one of:
- ``'function_calling'``: uses tool-calling features.
- ``'json_schema'``: uses dedicated structured output features.
- ``'json_mode'``: uses JSON mode.
- `'function_calling'`: uses tool-calling features.
- `'json_schema'`: uses dedicated structured output features.
- `'json_mode'`: uses JSON mode.
include_raw:
If `False` then only the parsed structured output is returned. If
@@ -899,7 +899,7 @@ class ChatHuggingFace(BaseChatModel):
then both the raw model response (a BaseMessage) and the parsed model
response will be returned. If an error occurs during output parsing it
will be caught and returned as well. The final output is always a dict
with keys ``'raw'``, ``'parsed'``, and ``'parsing_error'``.
with keys `'raw'`, `'parsed'`, and `'parsing_error'`.
kwargs:
Additional parameters to pass to the underlying LLM's
@@ -909,16 +909,16 @@ class ChatHuggingFace(BaseChatModel):
Returns:
A Runnable that takes same inputs as a `langchain_core.language_models.chat.BaseChatModel`.
If ``include_raw`` is False and ``schema`` is a Pydantic class, Runnable outputs
an instance of ``schema`` (i.e., a Pydantic object).
If `include_raw` is False and `schema` is a Pydantic class, Runnable outputs
an instance of `schema` (i.e., a Pydantic object).
Otherwise, if ``include_raw`` is False then Runnable outputs a dict.
Otherwise, if `include_raw` is False then Runnable outputs a dict.
If ``include_raw`` is True, then Runnable outputs a dict with keys:
If `include_raw` is True, then Runnable outputs a dict with keys:
- ``'raw'``: BaseMessage
- ``'parsed'``: None if there was a parsing error, otherwise the type depends on the ``schema`` as described above.
- ``'parsing_error'``: BaseException | None
- `'raw'`: BaseMessage
- `'parsed'`: None if there was a parsing error, otherwise the type depends on the `schema` as described above.
- `'parsing_error'`: BaseException | None
""" # noqa: E501
_ = kwargs.pop("strict", None)

View File

@@ -20,7 +20,7 @@ _MIN_OPTIMUM_VERSION = "1.22"
class HuggingFaceEmbeddings(BaseModel, Embeddings):
"""HuggingFace sentence_transformers embedding models.
To use, you should have the ``sentence_transformers`` python package installed.
To use, you should have the `sentence_transformers` python package installed.
Example:
.. code-block:: python

View File

@@ -15,8 +15,8 @@ VALID_TASKS = ("feature-extraction",)
class HuggingFaceEndpointEmbeddings(BaseModel, Embeddings):
"""HuggingFaceHub embedding models.
To use, you should have the ``huggingface_hub`` python package installed, and the
environment variable ``HUGGINGFACEHUB_API_TOKEN`` set with your API token, or pass
To use, you should have the `huggingface_hub` python package installed, and the
environment variable `HUGGINGFACEHUB_API_TOKEN` set with your API token, or pass
it as a named parameter to the constructor.
Example:
@@ -39,7 +39,7 @@ class HuggingFaceEndpointEmbeddings(BaseModel, Embeddings):
"""Model name to use."""
provider: str | None = None
"""Name of the provider to use for inference with the model specified in
``repo_id``. e.g. "sambanova". if not specified, defaults to HF Inference API.
`repo_id`. e.g. "sambanova". if not specified, defaults to HF Inference API.
available providers can be found in the [huggingface_hub documentation](https://huggingface.co/docs/huggingface_hub/guides/inference#supported-providers-and-tasks)."""
repo_id: str | None = None
"""Huggingfacehub repository id, for backward compatibility."""

View File

@@ -29,8 +29,8 @@ VALID_TASKS = (
class HuggingFaceEndpoint(LLM):
"""Hugging Face Endpoint. This works with any model that supports text generation (i.e. text completion) task.
To use this class, you should have installed the ``huggingface_hub`` package, and
the environment variable ``HUGGINGFACEHUB_API_TOKEN`` set with your API token,
To use this class, you should have installed the `huggingface_hub` package, and
the environment variable `HUGGINGFACEHUB_API_TOKEN` set with your API token,
or given as a named parameter to the constructor.
Example:

View File

@@ -37,7 +37,7 @@ logger = logging.getLogger(__name__)
class HuggingFacePipeline(BaseLLM):
"""HuggingFace Pipeline API.
To use, you should have the ``transformers`` python package installed.
To use, you should have the `transformers` python package installed.
Only supports `text-generation`, `text2text-generation`, `image-text-to-text`,
`summarization` and `translation` for now.