Home / Function/ test_multiple_structured_outputs_error_without_retry() — langchain Function Reference

test_multiple_structured_outputs_error_without_retry() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/test_response_format.py lines 418–454

    def test_multiple_structured_outputs_error_without_retry(self) -> None:
        """Test multiple structured outputs error without retry.

        Test that MultipleStructuredOutputsError is raised when model returns multiple
        structured tool calls without retry.
        """
        tool_calls = [
            [
                {
                    "name": "WeatherBaseModel",
                    "id": "1",
                    "args": WEATHER_DATA,
                },
                {
                    "name": "LocationResponse",
                    "id": "2",
                    "args": LOCATION_DATA,
                },
            ],
        ]

        model = FakeToolCallingModel(tool_calls=tool_calls)

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

        with pytest.raises(
            MultipleStructuredOutputsError,
            match=r".*WeatherBaseModel.*LocationResponse.*",
        ):
            agent.invoke({"messages": [HumanMessage("Give me weather and location")]})

Domain

Subdomains

Frequently Asked Questions

What does test_multiple_structured_outputs_error_without_retry() do?
test_multiple_structured_outputs_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_multiple_structured_outputs_error_without_retry() defined?
test_multiple_structured_outputs_error_without_retry() is defined in libs/langchain_v1/tests/unit_tests/agents/test_response_format.py at line 418.

Analyze Your Own Codebase

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

Try Supermodel Free