Skip to content

Commit

Permalink
Remove initial response and delay in chatStream handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
swuecho committed Sep 11, 2024
1 parent c3ce7d4 commit 6319ffa
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions api/chat_main_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,7 @@ func (h *ChatHandler) chatStream(w http.ResponseWriter, chatSession sqlc_queries
if regenerate {
answer_id = chatUuid
}

initial_resp := constructChatCompletionStreamReponse(answer_id, "!!!!")
data, _ := json.Marshal(initial_resp)
fmt.Fprintf(w, "data: %v\n\n", string(data))
flusher.Flush()
log.Println("initial_resp")
time.Sleep(time.Second * 5)

for {
response, err := stream.Recv()
if errors.Is(err, io.EOF) {
Expand Down

0 comments on commit 6319ffa

Please sign in to comment.