docs(ollama): add validate_model_on_init note, bump lock (#32172)

This commit is contained in:
Mason Daugherty 2025-07-22 10:58:45 -04:00 committed by GitHub
parent c14bd1fcfe
commit d65da13299
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 23 additions and 5 deletions

View File

@ -1,6 +1,15 @@
"""This is the langchain_ollama package. """This is the langchain_ollama package.
It provides infrastructure for interacting with the Ollama service. Provides infrastructure for interacting with the `Ollama <https://ollama.com/>`__
service.
.. note::
**Newly added in 0.3.4:** ``validate_model_on_init`` param on all models.
This parameter allows you to validate the model exists in Ollama locally on
initialization. If set to ``True``, it will raise an error if the model does not
exist locally. This is useful for ensuring that the model is available before
attempting to use it, especially in environments where models may not be
pre-downloaded.
""" """
from importlib import metadata from importlib import metadata

View File

@ -437,7 +437,10 @@ class ChatOllama(BaseChatModel):
unless you set ``reasoning`` to ``True``.""" unless you set ``reasoning`` to ``True``."""
validate_model_on_init: bool = False validate_model_on_init: bool = False
"""Whether to validate the model exists in Ollama locally on initialization.""" """Whether to validate the model exists in Ollama locally on initialization.
.. versionadded:: 0.3.4
"""
mirostat: Optional[int] = None mirostat: Optional[int] = None
"""Enable Mirostat sampling for controlling perplexity. """Enable Mirostat sampling for controlling perplexity.

View File

@ -128,7 +128,10 @@ class OllamaEmbeddings(BaseModel, Embeddings):
"""Model name to use.""" """Model name to use."""
validate_model_on_init: bool = False validate_model_on_init: bool = False
"""Whether to validate the model exists in ollama locally on initialization.""" """Whether to validate the model exists in ollama locally on initialization.
.. versionadded:: 0.3.4
"""
base_url: Optional[str] = None base_url: Optional[str] = None
"""Base url the model is hosted under.""" """Base url the model is hosted under."""

View File

@ -53,7 +53,10 @@ class OllamaLLM(BaseLLM):
be present directly within the main response content.""" be present directly within the main response content."""
validate_model_on_init: bool = False validate_model_on_init: bool = False
"""Whether to validate the model exists in ollama locally on initialization.""" """Whether to validate the model exists in ollama locally on initialization.
.. versionadded:: 0.3.4
"""
mirostat: Optional[int] = None mirostat: Optional[int] = None
"""Enable Mirostat sampling for controlling perplexity. """Enable Mirostat sampling for controlling perplexity.

View File

@ -2403,7 +2403,7 @@ wheels = [
[[package]] [[package]]
name = "langchain-core" name = "langchain-core"
version = "0.3.69" version = "0.3.70"
source = { editable = "libs/core" } source = { editable = "libs/core" }
dependencies = [ dependencies = [
{ name = "jsonpatch" }, { name = "jsonpatch" },