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

test_async_response_parse_custom_model() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  3349db50_e0f5_65ae_63ee_cf85b9dfd428["test_async_response_parse_custom_model()"]
  d84478fe_6b5f_cefd_a948_48255cf7924b["test_response.py"]
  3349db50_e0f5_65ae_63ee_cf85b9dfd428 -->|defined in| d84478fe_6b5f_cefd_a948_48255cf7924b
  style 3349db50_e0f5_65ae_63ee_cf85b9dfd428 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_response.py lines 144–156

async def test_async_response_parse_custom_model(async_client: AsyncAnthropic) -> None:
    response = AsyncAPIResponse(
        raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})),
        client=async_client,
        stream=False,
        stream_cls=None,
        cast_to=str,
        options=FinalRequestOptions.construct(method="get", url="/foo"),
    )

    obj = await response.parse(to=CustomModel)
    assert obj.foo == "hello!"
    assert obj.bar == 2

Subdomains

Frequently Asked Questions

What does test_async_response_parse_custom_model() do?
test_async_response_parse_custom_model() is a function in the anthropic-sdk-python codebase, defined in tests/test_response.py.
Where is test_async_response_parse_custom_model() defined?
test_async_response_parse_custom_model() is defined in tests/test_response.py at line 144.

Analyze Your Own Codebase

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

Try Supermodel Free