Skip to content

Commit 6f2d16e

Browse files
authored
refactor(ollama): simplify options handling (#33199)
Fixes #32744 Don't restrict options; the client accepts any dict
1 parent a9eda18 commit 6f2d16e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libs/partners/ollama/langchain_ollama/chat_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
convert_to_openai_tool,
4343
)
4444
from langchain_core.utils.pydantic import TypeBaseModel, is_basemodel_subclass
45-
from ollama import AsyncClient, Client, Message, Options
45+
from ollama import AsyncClient, Client, Message
4646
from pydantic import BaseModel, PrivateAttr, model_validator
4747
from pydantic.json_schema import JsonSchemaValue
4848
from pydantic.v1 import BaseModel as BaseModelV1
@@ -675,7 +675,7 @@ def _chat_params(
675675
"model": kwargs.pop("model", self.model),
676676
"think": kwargs.pop("reasoning", self.reasoning),
677677
"format": kwargs.pop("format", self.format),
678-
"options": Options(**options_dict),
678+
"options": options_dict,
679679
"keep_alive": kwargs.pop("keep_alive", self.keep_alive),
680680
**kwargs,
681681
}

0 commit comments

Comments
 (0)