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

test_create_rejects_both_output_format_and_config() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

tests/api_resources/beta/test_output_format_conversion.py lines 315–324

    def test_create_rejects_both_output_format_and_config(self, client: Anthropic) -> None:
        """Verify .create() raises error when both output_format and output_config.format are provided."""
        with pytest.raises(AnthropicError, match="Both output_format and output_config.format were provided"):
            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={"format": {"type": "json_schema", "schema": {"type": "string"}}},
            )

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free