Home / Function/ test_allows_output_config_without_format() — anthropic-sdk-python Function Reference

test_allows_output_config_without_format() — anthropic-sdk-python Function Reference

Architecture documentation for the test_allows_output_config_without_format() function in test_output_format_conversion.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  c73f6096_a6bd_8969_6aaf_3264d141d520["test_allows_output_config_without_format()"]
  3fe92a68_5610_d400_14e9_4b7e189d5cae["TestOutputConfigConflict"]
  c73f6096_a6bd_8969_6aaf_3264d141d520 -->|defined in| 3fe92a68_5610_d400_14e9_4b7e189d5cae
  style c73f6096_a6bd_8969_6aaf_3264d141d520 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/api_resources/beta/test_output_format_conversion.py lines 351–377

    def test_allows_output_config_without_format(self, client: Anthropic, respx_mock: MockRouter) -> None:
        """Verify output_config without format field can be used with output_format."""
        respx_mock.post("/v1/messages?beta=true").mock(
            return_value=httpx.Response(
                200,
                json={
                    "id": "msg_123",
                    "type": "message",
                    "role": "assistant",
                    "model": "claude-sonnet-4-5",
                    "content": [{"text": "test", "type": "text"}],
                    "stop_reason": "end_turn",
                    "usage": {"input_tokens": 10, "output_tokens": 20},
                },
            )
        )

        with warnings.catch_warnings(record=True):
            warnings.simplefilter("always")
            # Should succeed - output_config.effort is fine with output_format
            client.beta.messages.create(
                max_tokens=1024,
                messages=[{"role": "user", "content": "Test"}],
                model="claude-sonnet-4-5",
                output_format={"type": "json_schema", "schema": {"type": "object"}},
                output_config={"effort": "high"},  # No format field, so no conflict
            )

Subdomains

Frequently Asked Questions

What does test_allows_output_config_without_format() do?
test_allows_output_config_without_format() is a function in the anthropic-sdk-python codebase, defined in tests/api_resources/beta/test_output_format_conversion.py.
Where is test_allows_output_config_without_format() defined?
test_allows_output_config_without_format() is defined in tests/api_resources/beta/test_output_format_conversion.py at line 351.

Analyze Your Own Codebase

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

Try Supermodel Free