MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / ResponseChunkData

Function ResponseChunkData

relay/helper/common.go:56–62  ·  view source on GitHub ↗
(c *gin.Context, resp dto.ResponsesStreamResponse, data string)

Source from the content-addressed store, hash-verified

54}
55
56func ResponseChunkData(c *gin.Context, resp dto.ResponsesStreamResponse, data string) {
57 c.Render(-1, common.CustomEvent{Data: fmt.Sprintf("event: %s\n", resp.Type)})
58 c.Render(-1, common.CustomEvent{Data: fmt.Sprintf("data: %s", data)})
59 if flusher, ok := c.Writer.(http.Flusher); ok {
60 flusher.Flush()
61 }
62}
63
64func StringData(c *gin.Context, str string) error {
65 //str = strings.TrimPrefix(str, "data: ")

Callers 1

sendResponsesStreamDataFunction · 0.92

Calls 1

RenderMethod · 0.80

Tested by

no test coverage detected