Home / Function/ test_structured_output_parsing_error_without_retry() — langchain Function Reference

test_structured_output_parsing_error_without_retry() — langchain Function Reference

Architecture documentation for the test_structured_output_parsing_error_without_retry() function in test_response_format.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  bf98f9a3_e2b0_d112_b894_ee3bbee292da["test_structured_output_parsing_error_without_retry()"]
  d1d579f8_d411_ce75_6fa3_d97e725405cb["TestResponseFormatAsToolStrategy"]
  bf98f9a3_e2b0_d112_b894_ee3bbee292da -->|defined in| d1d579f8_d411_ce75_6fa3_d97e725405cb
  style bf98f9a3_e2b0_d112_b894_ee3bbee292da fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/test_response_format.py lines 497–528

    def test_structured_output_parsing_error_without_retry(self) -> None:
        """Test structured output parsing error without retry.

        Test that StructuredOutputValidationError is raised when tool args fail to parse
        without retry.
        """
        tool_calls = [
            [
                {
                    "name": "WeatherBaseModel",
                    "id": "1",
                    "args": {"invalid": "data"},
                },
            ],
        ]

        model = FakeToolCallingModel(tool_calls=tool_calls)

        agent = create_agent(
            model,
            [],
            response_format=ToolStrategy(
                WeatherBaseModel,
                handle_errors=False,
            ),
        )

        with pytest.raises(
            StructuredOutputValidationError,
            match=r".*WeatherBaseModel.*",
        ):
            agent.invoke({"messages": [HumanMessage("What's the weather?")]})

Domain

Subdomains

Frequently Asked Questions

What does test_structured_output_parsing_error_without_retry() do?
test_structured_output_parsing_error_without_retry() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/test_response_format.py.
Where is test_structured_output_parsing_error_without_retry() defined?
test_structured_output_parsing_error_without_retry() is defined in libs/langchain_v1/tests/unit_tests/agents/test_response_format.py at line 497.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free