standard-tests: fix default fixtures (#20520)

This commit is contained in:
Erick Friis
2024-04-16 09:12:36 -07:00
committed by GitHub
parent 5acc7ba622
commit 77eba10f47
2 changed files with 9 additions and 2 deletions

View File

@@ -33,13 +33,16 @@ class ChatModelIntegrationTests(ABC):
def chat_model_has_tool_calling(
self, chat_model_class: Type[BaseChatModel]
) -> bool:
return hasattr(chat_model_class, "bind_tools")
return chat_model_class.bind_tools is not BaseChatModel.bind_tools
@pytest.fixture
def chat_model_has_structured_output(
self, chat_model_class: Type[BaseChatModel]
) -> bool:
return hasattr(chat_model_class, "with_structured_output")
return (
chat_model_class.with_structured_output
is not BaseChatModel.with_structured_output
)
def test_invoke(
self, chat_model_class: Type[BaseChatModel], chat_model_params: dict