Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
swuecho committed Mar 20, 2023
1 parent 3a3d6e0 commit 7767026
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/chat_main_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,14 @@ func (h *ChatHandler) OpenAIChatCompletionAPIWithStreamHandler(w http.ResponseWr
http.Error(w, "Error: '"+err.Error()+"'", http.StatusBadRequest)
return
}
lastN := chat_session.MaxLength
if chat_session.MaxLength == 0 {
lastN = 10
}
msgs, err := h.chatService.q.GetLastNChatMessages(ctx,
sqlc_queries.GetLastNChatMessagesParams{
Uuid: chatUuid,
Limit: chat_session.MaxLength,
Limit: lastN,
})
if err != nil {
http.Error(w, "Error: '"+err.Error()+"'", http.StatusBadRequest)
Expand Down

0 comments on commit 7767026

Please sign in to comment.