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

Function ev

tests/lib/test_refusal_fallback_streaming.py:105–107  ·  view source on GitHub ↗

Serialize one event payload as an SSE frame (its `type` is the event name).

(data: dict[str, Any])

Source from the content-addressed store, hash-verified

103
104
105def ev(data: dict[str, Any]) -> str:
106 """Serialize one event payload as an SSE frame (its `type` is the event name)."""
107 return f"event: {data['type']}\ndata: {json.dumps(data)}\n\n"
108
109
110def message_start() -> str:

Calls

no outgoing calls

Tested by

no test coverage detected