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

Function stream_response

tests/test_open_telemetry.py:605–607  ·  view source on GitHub ↗
(events: Sequence[dict[str, Any]] | None = None)

Source from the content-addressed store, hash-verified

603
604
605def stream_response(events: Sequence[dict[str, Any]] | None = None) -> httpx2.Response:
606 body = sse(stream_events() if events is None else events)
607 return httpx2.Response(200, content=body, headers={"content-type": "text/event-stream", **RESPONSE_HEADERS})
608
609
610STREAM_ENDS = [

Calls 2

stream_eventsFunction · 0.85
sseFunction · 0.70

Tested by

no test coverage detected