refactor: remove unnecessary call to helper.Done and adjust data rendering in ClaudeChunkData

This commit is contained in:
CaIon
2025-05-04 17:35:45 +08:00
parent 48af027903
commit 419a056fbf
3 changed files with 3 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ func ClaudeData(c *gin.Context, resp dto.ClaudeResponse) error {
func ClaudeChunkData(c *gin.Context, resp dto.ClaudeResponse, data string) {
c.Render(-1, common.CustomEvent{Data: fmt.Sprintf("event: %s\n", resp.Type)})
c.Render(-1, common.CustomEvent{Data: fmt.Sprintf("data: %s\n", data)})
c.Render(-1, common.CustomEvent{Data: fmt.Sprintf("data: %s", data)})
if flusher, ok := c.Writer.(http.Flusher); ok {
flusher.Flush()
}