fix(ollama): pop unsupported 'strict' argument in ChatOllama (#34114)

This commit is contained in:
dumko2001
2025-12-12 19:43:11 +05:30
committed by GitHub
parent 3fb90666be
commit 05ba853548
2 changed files with 31 additions and 0 deletions

View File

@@ -774,6 +774,11 @@ class ChatOllama(BaseChatModel):
**kwargs,
}
# Filter out 'strict' argument if present, as it is not supported by Ollama
# but may be passed by upstream libraries (e.g. LangChain ProviderStrategy)
if "strict" in params:
params.pop("strict")
if tools := kwargs.get("tools"):
params["tools"] = tools