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

test_streaming_response_create() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  b99936ef_2baa_e42a_ece2_2f01622a7ed3["test_streaming_response_create()"]
  3599ed31_8a6e_9753_ec3c_978d9ca4f1b5["TestAsyncBatches"]
  b99936ef_2baa_e42a_ece2_2f01622a7ed3 -->|defined in| 3599ed31_8a6e_9753_ec3c_978d9ca4f1b5
  0688c668_d463_758c_fc93_a6f813306e50["test_streaming_response_create()"]
  0688c668_d463_758c_fc93_a6f813306e50 -->|calls| b99936ef_2baa_e42a_ece2_2f01622a7ed3
  0688c668_d463_758c_fc93_a6f813306e50["test_streaming_response_create()"]
  b99936ef_2baa_e42a_ece2_2f01622a7ed3 -->|calls| 0688c668_d463_758c_fc93_a6f813306e50
  08e9c9e7_d7f9_615f_5837_b3de69122e37["assert_matches_type()"]
  b99936ef_2baa_e42a_ece2_2f01622a7ed3 -->|calls| 08e9c9e7_d7f9_615f_5837_b3de69122e37
  style b99936ef_2baa_e42a_ece2_2f01622a7ed3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/api_resources/messages/test_batches.py lines 330–354

    async def test_streaming_response_create(self, async_client: AsyncAnthropic) -> None:
        async with async_client.messages.batches.with_streaming_response.create(
            requests=[
                {
                    "custom_id": "my-custom-id-1",
                    "params": {
                        "max_tokens": 1024,
                        "messages": [
                            {
                                "content": "Hello, world",
                                "role": "user",
                            }
                        ],
                        "model": "claude-opus-4-6",
                    },
                }
            ],
        ) as response:
            assert not response.is_closed
            assert response.http_request.headers.get("X-Stainless-Lang") == "python"

            batch = await response.parse()
            assert_matches_type(MessageBatch, batch, path=["response"])

        assert cast(Any, response.is_closed) is True

Subdomains

Frequently Asked Questions

What does test_streaming_response_create() do?
test_streaming_response_create() is a function in the anthropic-sdk-python codebase, defined in tests/api_resources/messages/test_batches.py.
Where is test_streaming_response_create() defined?
test_streaming_response_create() is defined in tests/api_resources/messages/test_batches.py at line 330.
What does test_streaming_response_create() call?
test_streaming_response_create() calls 2 function(s): assert_matches_type, test_streaming_response_create.
What calls test_streaming_response_create()?
test_streaming_response_create() is called by 1 function(s): test_streaming_response_create.

Analyze Your Own Codebase

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

Try Supermodel Free