Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ollama[patch]: support ollama 0.4 (#28364)
v0.4 of the Python SDK is already installed via the lock file in CI, but our current implementation is not compatible with it. This also addresses an issue introduced in #28299. @RyanMagnuson would you mind explaining the motivation for that change? From what I can tell the Ollama SDK [does not support kwargs](https://github.com/ollama/ollama-python/blob/6c44bb272976b9dc8d24d3a3fd913fd39b83394b/ollama/_client.py#L286). Previously, unsupported kwargs were ignored, but they currently raise `TypeError`. Some of LangChain's standard test suite expects `tool_choice` to be supported, so here we catch it in `bind_tools` so it is ignored and not passed through to the client.
- Loading branch information