(c *gin.Context, resp dto.ClaudeResponse, data string)
| 46 | } |
| 47 | |
| 48 | func ClaudeChunkData(c *gin.Context, resp dto.ClaudeResponse, data string) { |
| 49 | c.Render(-1, common.CustomEvent{Data: fmt.Sprintf("event: %s\n", resp.Type)}) |
| 50 | c.Render(-1, common.CustomEvent{Data: fmt.Sprintf("data: %s\n", data)}) |
| 51 | if flusher, ok := c.Writer.(http.Flusher); ok { |
| 52 | flusher.Flush() |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | func ResponseChunkData(c *gin.Context, resp dto.ResponsesStreamResponse, data string) { |
| 57 | c.Render(-1, common.CustomEvent{Data: fmt.Sprintf("event: %s\n", resp.Type)}) |
no test coverage detected