diff --git a/libs/partners/openai/pyproject.toml b/libs/partners/openai/pyproject.toml index ac7a4b575c4..f3a038ee585 100644 --- a/libs/partners/openai/pyproject.toml +++ b/libs/partners/openai/pyproject.toml @@ -46,6 +46,9 @@ markers = [ "scheduled: mark tests to run in scheduled testing", ] asyncio_mode = "auto" +filterwarnings = [ + "ignore::langchain_core._api.beta_decorator.LangChainBetaWarning", +] [tool.poetry.group.test] optional = true diff --git a/libs/partners/openai/tests/unit_tests/chat_models/test_base.py b/libs/partners/openai/tests/unit_tests/chat_models/test_base.py index 493ca5abeff..0ee91ad8ef9 100644 --- a/libs/partners/openai/tests/unit_tests/chat_models/test_base.py +++ b/libs/partners/openai/tests/unit_tests/chat_models/test_base.py @@ -633,7 +633,9 @@ def test_bind_tools_tool_choice(tool_choice: Any, strict: Optional[bool]) -> Non ) -@pytest.mark.parametrize("schema", [GenerateUsername, GenerateUsername.schema()]) +@pytest.mark.parametrize( + "schema", [GenerateUsername, GenerateUsername.model_json_schema()] +) @pytest.mark.parametrize("method", ["json_schema", "function_calling", "json_mode"]) @pytest.mark.parametrize("include_raw", [True, False]) @pytest.mark.parametrize("strict", [True, False, None]) diff --git a/libs/standard-tests/langchain_standard_tests/unit_tests/chat_models.py b/libs/standard-tests/langchain_standard_tests/unit_tests/chat_models.py index 1bee7f88526..30effbebb35 100644 --- a/libs/standard-tests/langchain_standard_tests/unit_tests/chat_models.py +++ b/libs/standard-tests/langchain_standard_tests/unit_tests/chat_models.py @@ -79,7 +79,8 @@ def my_adder(a: int, b: int) -> int: class ChatModelTests(BaseStandardTests): @property @abstractmethod - def chat_model_class(self) -> Type[BaseChatModel]: ... + def chat_model_class(self) -> Type[BaseChatModel]: + ... @property def chat_model_params(self) -> dict: @@ -187,7 +188,12 @@ class ChatModelUnitTests(ChatModelTests): tools = [my_adder_tool, my_adder] for pydantic_model in TEST_PYDANTIC_MODELS: - tools.extend([pydantic_model, pydantic_model.schema()]) + model_schema = ( + pydantic_model.model_json_schema() + if hasattr(pydantic_model, "model_json_schema") + else pydantic_model.schema() + ) + tools.extend([pydantic_model, model_schema]) # Doing a mypy ignore here since some of the tools are from pydantic # BaseModel 2 which isn't typed properly yet. This will need to be fixed diff --git a/libs/standard-tests/pyproject.toml b/libs/standard-tests/pyproject.toml index edb51dae866..2c52a5b8ea6 100644 --- a/libs/standard-tests/pyproject.toml +++ b/libs/standard-tests/pyproject.toml @@ -82,3 +82,4 @@ markers = [ "compile: mark placeholder test used to compile integration tests without running them", ] asyncio_mode = "auto" +