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

test_response_basemodel_request_id() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  6e3af51c_a305_01da_e8f7_2a0b72b141fa["test_response_basemodel_request_id()"]
  220a5d1f_6983_9c80_71b8_c5877a0fc71e["test_legacy_response.py"]
  6e3af51c_a305_01da_e8f7_2a0b72b141fa -->|defined in| 220a5d1f_6983_9c80_71b8_c5877a0fc71e
  style 6e3af51c_a305_01da_e8f7_2a0b72b141fa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_legacy_response.py lines 94–111

def test_response_basemodel_request_id(client: Anthropic) -> None:
    response = LegacyAPIResponse(
        raw=httpx.Response(
            200,
            headers={"request-id": "my-req-id"},
            content=json.dumps({"foo": "hello!", "bar": 2}),
        ),
        client=client,
        stream=False,
        stream_cls=None,
        cast_to=str,
        options=FinalRequestOptions.construct(method="get", url="/foo"),
    )
    obj = response.parse(to=CustomModel)
    assert obj._request_id == "my-req-id"
    assert obj.foo == "hello!"
    assert obj.bar == 2
    assert obj.to_dict() == {"foo": "hello!", "bar": 2}

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free