Skip to main content

Module sse

Module sse 

Source

Functions§

extract_json_from_sse
Check if the response body is SSE-formatted and extract the JSON data. Returns the extracted JSON bytes if exactly one data: event is found.
split_upstream
Split a full upstream URL into (base, path). e.g. “http://localhost:9000/mcp” → (“http://localhost:9000”, “/mcp”) e.g. “http://localhost:9000” → (“http://localhost:9000”, “”)
wrap_as_sse
Re-wrap JSON bytes into SSE format.