diff --git a/libs/ai-endpoints/langchain_nvidia_ai_endpoints/chat_models.py b/libs/ai-endpoints/langchain_nvidia_ai_endpoints/chat_models.py index 63ee21c5..3a0cd996 100644 --- a/libs/ai-endpoints/langchain_nvidia_ai_endpoints/chat_models.py +++ b/libs/ai-endpoints/langchain_nvidia_ai_endpoints/chat_models.py @@ -773,13 +773,6 @@ class Choices(enum.Enum): For more, see https://python.langchain.com/docs/how_to/structured_output/ """ # noqa: E501 - if "method" in kwargs: - warnings.warn( - "The 'method' parameter is unnecessary and is ignored. " - "The appropriate method will be chosen automatically depending " - "on the type of schema provided." - ) - if kwargs.get("strict", True) is not True: warnings.warn( "Structured output always follows strict validation. " diff --git a/libs/ai-endpoints/tests/unit_tests/test_structured_output.py b/libs/ai-endpoints/tests/unit_tests/test_structured_output.py index c8dfd00b..8a3af977 100644 --- a/libs/ai-endpoints/tests/unit_tests/test_structured_output.py +++ b/libs/ai-endpoints/tests/unit_tests/test_structured_output.py @@ -19,17 +19,17 @@ class Joke(pydanticV2BaseModel): rating: Optional[int] = Field(description="How funny the joke is, from 1 to 10") -def test_method() -> None: - with pytest.warns(UserWarning) as record: - with warnings.catch_warnings(): - warnings.filterwarnings( - "ignore", - category=UserWarning, - message=".*not known to support structured output.*", - ) - ChatNVIDIA(api_key="BOGUS").with_structured_output(Joke, method="json_mode") - assert len(record) == 1 - assert "unnecessary" in str(record[0].message) +# def test_method() -> None: +# with pytest.warns(UserWarning) as record: +# with warnings.catch_warnings(): +# warnings.filterwarnings( +# "ignore", +# category=UserWarning, +# message=".*not known to support structured output.*", +# ) +# ChatNVIDIA(api_key="BOGUS").with_structured_output(Joke, method="json_mode") +# assert len(record) == 1 +# assert "unnecessary" in str(record[0].message) def test_include_raw() -> None: