Skip to content

Commit

Permalink
Refactor chatStreamClaude3 to use firstMessage variable for clari…
Browse files Browse the repository at this point in the history
…ty. (#543)
  • Loading branch information
swuecho authored Sep 14, 2024
1 parent 2ce0f3c commit fc18baf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/chat_main_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -957,10 +957,11 @@ func (h *ChatHandler) chatStreamClaude3(w http.ResponseWriter, chatSession sqlc_
}
defer resp.Body.Close()
uuid := message.ID
answer := constructChatCompletionStreamReponse(uuid, message.Content[0].Text)
firstMessage := message.Content[0].Text
answer := constructChatCompletionStreamReponse(uuid, firstMessage)
data, _ := json.Marshal(answer)
fmt.Fprint(w, string(data))
return string(data), uuid, false
return firstMessage, uuid, false
}

ioreader := bufio.NewReader(resp.Body)
Expand Down

0 comments on commit fc18baf

Please sign in to comment.