ollama[minor]: update default method for structured output (#30273)

From function calling to Ollama's [dedicated structured output
feature](https://ollama.com/blog/structured-outputs).

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
Lance Martin
2025-03-18 09:44:22 -07:00
committed by GitHub
parent ff8ce60dcc
commit 46d6bf0330
4 changed files with 26 additions and 41 deletions

View File

@@ -2,8 +2,6 @@
from typing import Type
import pytest
from langchain_core.language_models import BaseChatModel
from langchain_tests.integration_tests import ChatModelIntegrationTests
from langchain_ollama.chat_models import ChatOllama
@@ -25,19 +23,3 @@ class TestChatOllama(ChatModelIntegrationTests):
@property
def supports_json_mode(self) -> bool:
return True
@pytest.mark.xfail(
reason=(
"Fails with 'AssertionError'. Ollama does not support 'tool_choice' yet."
)
)
def test_structured_output(self, model: BaseChatModel, schema_type: str) -> None:
super().test_structured_output(model, schema_type)
@pytest.mark.xfail(
reason=(
"Fails with 'AssertionError'. Ollama does not support 'tool_choice' yet."
)
)
def test_structured_output_pydantic_2_v1(self, model: BaseChatModel) -> None:
super().test_structured_output_pydantic_2_v1(model)