From 4abc2319c061dd77125bca9e92ddcf5c09c30e94 Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" Date: Wed, 6 Aug 2025 16:55:58 +0000 Subject: [PATCH] Apply patch [skip ci] --- libs/partners/ollama/langchain_ollama/chat_models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libs/partners/ollama/langchain_ollama/chat_models.py b/libs/partners/ollama/langchain_ollama/chat_models.py index c24b9d9b9a4..6e9257fd401 100644 --- a/libs/partners/ollama/langchain_ollama/chat_models.py +++ b/libs/partners/ollama/langchain_ollama/chat_models.py @@ -400,6 +400,16 @@ class ChatOllama(BaseChatModel): See full list of supported init args and their descriptions in the params section. + .. note:: + **GPT-OSS Model Support**: This integration includes special support for gpt-oss + models (e.g., ``gpt-oss:20b``, ``gpt-oss:7b``) which use the Harmony response format. + When using gpt-oss models with tools, the integration automatically converts tool + definitions to the Harmony format, ensuring compatibility. Tool parameter types are + properly formatted as strings rather than arrays to avoid template parsing errors. + + If you encounter issues with tool calling on gpt-oss models, ensure you're using + the latest version of this integration which includes Harmony format support. + Instantiate: .. code-block:: python @@ -1576,3 +1586,4 @@ class ChatOllama(BaseChatModel): +