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

Function sse

tests/test_open_telemetry.py:271–272  ·  view source on GitHub ↗
(events: Sequence[dict[str, Any]])

Source from the content-addressed store, hash-verified

269
270
271def sse(events: Sequence[dict[str, Any]]) -> bytes:
272 return b"".join(f"event: {event['type']}\ndata: {json.dumps(event)}\n\n".encode() for event in events)
273
274
275def utf8_size(text: str) -> int:

Callers 11

stream_responseFunction · 0.70
iter_bytesMethod · 0.70
aiter_bytesMethod · 0.70
respondFunction · 0.70
__init__Method · 0.70
mock_session_routesFunction · 0.70
__iter__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected