MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / buildResponsesSSE

Function buildResponsesSSE

internal/toolinjection/inject_stream.go:309–312  ·  view source on GitHub ↗

buildResponsesSSE constructs an SSE event for the Responses API. Format: "event: type\ndata: {...}" (handler adds surrounding newlines).

(eventType string, data map[string]any)

Source from the content-addressed store, hash-verified

307// buildResponsesSSE constructs an SSE event for the Responses API.
308// Format: "event: type\ndata: {...}" (handler adds surrounding newlines).
309func buildResponsesSSE(eventType string, data map[string]any) []byte {
310 dataJSON, _ := json.Marshal(data)
311 return []byte(fmt.Sprintf("event: %s\ndata: %s", eventType, dataJSON))
312}
313
314// isResponsesCompleted returns true if the chunk contains a response.completed event.
315func isResponsesCompleted(chunk []byte) bool {

Callers 1

InjectResponsesStreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected