mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
docs: more fixes for refs (#33554)
This commit is contained in:
@@ -1258,17 +1258,19 @@ class ChatOllama(BaseChatModel):
|
||||
Args:
|
||||
schema: The output schema. Can be passed in as:
|
||||
|
||||
- a Pydantic class,
|
||||
- a JSON schema
|
||||
- a `TypedDict` class
|
||||
- an OpenAI function/tool schema.
|
||||
- a JSON Schema,
|
||||
- a `TypedDict` class,
|
||||
- or a Pydantic class.
|
||||
|
||||
If `schema` is a Pydantic class then the model output will be a
|
||||
Pydantic instance of that class, and the model-generated fields will be
|
||||
validated by the Pydantic class. Otherwise the model output will be a
|
||||
dict and will not be validated. See `langchain_core.utils.function_calling.convert_to_openai_tool`
|
||||
for more on how to properly specify types and descriptions of
|
||||
schema fields when specifying a Pydantic or `TypedDict` class.
|
||||
dict and will not be validated.
|
||||
|
||||
See `langchain_core.utils.function_calling.convert_to_openai_tool` for
|
||||
more on how to properly specify types and descriptions of schema fields
|
||||
when specifying a Pydantic or `TypedDict` class.
|
||||
|
||||
method: The method for steering model generation, one of:
|
||||
|
||||
@@ -1286,21 +1288,26 @@ class ChatOllama(BaseChatModel):
|
||||
an error occurs during model output parsing it will be raised. If `True`
|
||||
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'`.
|
||||
will be caught and returned as well.
|
||||
|
||||
The final output is always a `dict` with keys `'raw'`, `'parsed'`, and
|
||||
`'parsing_error'`.
|
||||
|
||||
kwargs: Additional keyword args aren't supported.
|
||||
|
||||
Returns:
|
||||
A Runnable that takes same inputs as a `langchain_core.language_models.chat.BaseChatModel`.
|
||||
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). 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'`: 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`
|
||||
|
||||
!!! warning "Behavior changed in 0.2.2"
|
||||
Added support for structured output API via `format` parameter.
|
||||
|
||||
@@ -53,11 +53,11 @@ class OllamaLLM(BaseLLM):
|
||||
Random number seed for generation reproducibility.
|
||||
|
||||
Key init args — client params:
|
||||
base_url: str | None
|
||||
base_url:
|
||||
Base URL where Ollama server is hosted.
|
||||
keep_alive: int | str | None
|
||||
keep_alive:
|
||||
How long the model stays loaded into memory.
|
||||
format: Literal["", "json"]
|
||||
format:
|
||||
Specify the format of the output.
|
||||
|
||||
See full list of supported init args and their descriptions in the params section.
|
||||
|
||||
Reference in New Issue
Block a user