mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
fix(docs): capitalization, codeblock formatting, and hyperlinks, note blocks (#32235)
widespread cleanup attempt
This commit is contained in:
@@ -1044,8 +1044,7 @@ class ChatOllama(BaseChatModel):
|
||||
"""Model wrapper that returns outputs formatted to match the given schema.
|
||||
|
||||
Args:
|
||||
schema:
|
||||
The output schema. Can be passed in as:
|
||||
schema: The output schema. Can be passed in as:
|
||||
|
||||
- a Pydantic class,
|
||||
- a JSON schema
|
||||
@@ -1061,11 +1060,11 @@ class ChatOllama(BaseChatModel):
|
||||
|
||||
method: The method for steering model generation, one of:
|
||||
|
||||
- "json_schema":
|
||||
- ``'json_schema'``:
|
||||
Uses Ollama's `structured output API <https://ollama.com/blog/structured-outputs>`__
|
||||
- "function_calling":
|
||||
- ``'function_calling'``:
|
||||
Uses Ollama's tool-calling API
|
||||
- "json_mode":
|
||||
- ``'json_mode'``:
|
||||
Specifies ``format="json"``. Note that if using JSON mode then you
|
||||
must include instructions for formatting the output into the
|
||||
desired schema into the model call.
|
||||
@@ -1076,20 +1075,20 @@ class ChatOllama(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 keyword args aren't supported.
|
||||
|
||||
Returns:
|
||||
A Runnable that takes same inputs as a :class:`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). Otherwise, if ``include_raw`` is False then Runnable outputs a dict.
|
||||
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.
|
||||
|
||||
| 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": Optional[BaseException]
|
||||
- ``'raw'``: BaseMessage
|
||||
- ``'parsed'``: None if there was a parsing error, otherwise the type depends on the ``schema`` as described above.
|
||||
- ``'parsing_error'``: Optional[BaseException]
|
||||
|
||||
.. versionchanged:: 0.2.2
|
||||
|
||||
@@ -1097,7 +1096,7 @@ class ChatOllama(BaseChatModel):
|
||||
|
||||
.. versionchanged:: 0.3.0
|
||||
|
||||
Updated default ``method`` to ``"json_schema"``.
|
||||
Updated default ``method`` to ``'json_schema'``.
|
||||
|
||||
.. dropdown:: Example: schema=Pydantic class, method="json_schema", include_raw=False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user