MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / stream_error_response

Function stream_error_response

tests/lib/threads/helpers.py:779–784  ·  view source on GitHub ↗

A stream whose first event is an error.

()

Source from the content-addressed store, hash-verified

777
778
779def stream_error_response() -> httpx2.Response:
780 """A stream whose first event is an error."""
781 error = {"type": "error", "error": {"type": "overloaded_error", "message": "Overloaded"}}
782 return httpx2.Response(
783 200, headers={"content-type": "text/event-stream"}, content=f"event: error\ndata: {json.dumps(error)}\n\n"
784 )
785
786
787TURN_METHODS = pytest.mark.parametrize("method", ["send", "parse", "stream"])

Calls

no outgoing calls