test_rejects_both_output_format_and_config() — anthropic-sdk-python Function Reference
Architecture documentation for the test_rejects_both_output_format_and_config() function in test_beta_messages.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD 810b0e29_133b_c1ab_b0b1_74c36381bbec["test_rejects_both_output_format_and_config()"] 95486e47_f54d_3984_3813_dc744981b8a3["TestAsyncMessages"] 810b0e29_133b_c1ab_b0b1_74c36381bbec -->|defined in| 95486e47_f54d_3984_3813_dc744981b8a3 style 810b0e29_133b_c1ab_b0b1_74c36381bbec fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/lib/_parse/test_beta_messages.py lines 109–131
async def test_rejects_both_output_format_and_config(self, async_client: AsyncAnthropic) -> None:
class User(BaseModel):
name: str
age: int
with pytest.raises(AnthropicError, match="Both output_format and output_config.format were provided"):
await async_client.beta.messages.parse(
model="claude-sonnet-4-5",
messages=[
{
"role": "user",
"content": "Extract the user's name and age.",
}
],
output_format=User,
output_config={
"format": {
"type": "json_schema",
"schema": {"type": "object"},
}
},
max_tokens=1024,
)
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_rejects_both_output_format_and_config() do?
test_rejects_both_output_format_and_config() is a function in the anthropic-sdk-python codebase, defined in tests/lib/_parse/test_beta_messages.py.
Where is test_rejects_both_output_format_and_config() defined?
test_rejects_both_output_format_and_config() is defined in tests/lib/_parse/test_beta_messages.py at line 109.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free