mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-17 16:39:52 +00:00
docs(ollama): add validate_model_on_init
note, bump lock (#32172)
This commit is contained in:
parent
c14bd1fcfe
commit
d65da13299
@ -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
|
||||||
|
@ -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.
|
||||||
|
@ -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."""
|
||||||
|
@ -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.
|
||||||
|
2
uv.lock
2
uv.lock
@ -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" },
|
||||||
|
Loading…
Reference in New Issue
Block a user