standard-tests: add override check (#24407)

This commit is contained in:
Erick Friis
2024-07-22 16:38:01 -07:00
committed by GitHub
parent 1639ccfd15
commit 2c6b9e8771
7 changed files with 92 additions and 29 deletions

View File

@@ -2,12 +2,10 @@
from typing import Type
import pytest
from langchain_core.language_models import BaseChatModel
from langchain_core.runnables import RunnableBinding
from langchain_standard_tests.unit_tests.chat_models import ( # type: ignore[import-not-found]
from langchain_standard_tests.unit_tests.chat_models import (
ChatModelUnitTests,
Person,
my_adder_tool,
)
from langchain_groq import ChatGroq
@@ -18,10 +16,6 @@ class TestGroqStandard(ChatModelUnitTests):
def chat_model_class(self) -> Type[BaseChatModel]:
return ChatGroq
@pytest.mark.xfail(reason="Groq does not support tool_choice='any'")
def test_bind_tool_pydantic(self, model: BaseChatModel) -> None:
"""Does not currently support tool_choice='any'."""
if not self.has_tool_calling:
return
tool_model = model.bind_tools([Person, Person.schema(), my_adder_tool])
assert isinstance(tool_model, RunnableBinding)
super().test_bind_tool_pydantic(model)