MCPcopy Index your code
hub / github.com/codehamr/codehamr / sseOK

Function sseOK

internal/llm/llm_test.go:31–38  ·  view source on GitHub ↗

sseOK writes an OpenAI-style streamed response plus a [DONE] terminator. The budget header travels on the 200 like in production.

(w http.ResponseWriter, chunks []string)

Source from the content-addressed store, hash-verified

29// sseOK writes an OpenAI-style streamed response plus a [DONE] terminator. The
30// budget header travels on the 200 like in production.
31func sseOK(w http.ResponseWriter, chunks []string) {
32 w.Header().Set("Content-Type", "text/event-stream")
33 w.Header().Set("X-Budget-Remaining", "0.73")
34 for _, c := range chunks {
35 fmt.Fprintf(w, "data: %s\n\n", c)
36 }
37 fmt.Fprint(w, "data: [DONE]\n\n")
38}
39
40// TestChatStreamsContent: content deltas merge into one final string.
41func TestChatStreamsContent(t *testing.T) {

Calls

no outgoing calls

Tested by

no test coverage detected