fix
This commit is contained in:
@@ -65,8 +65,8 @@ func recordAssistantResponse(contentType string, db *gorm.DB, trackID uuid.UUID,
|
|||||||
// stream mode
|
// stream mode
|
||||||
if strings.HasPrefix(contentType, "text/event-stream") {
|
if strings.HasPrefix(contentType, "text/event-stream") {
|
||||||
resp := string(body)
|
resp := string(body)
|
||||||
var chunk StreamModeChunk
|
|
||||||
for _, line := range strings.Split(resp, "\n") {
|
for _, line := range strings.Split(resp, "\n") {
|
||||||
|
chunk := StreamModeChunk{}
|
||||||
line = strings.TrimPrefix(line, "data:")
|
line = strings.TrimPrefix(line, "data:")
|
||||||
line = strings.TrimSpace(line)
|
line = strings.TrimSpace(line)
|
||||||
if line == "" {
|
if line == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user