Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
fix repeated reesponse
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio committed Jun 13, 2023
1 parent 7a90fe9 commit b393f9d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/chatgpt/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ func Handler(c *gin.Context, response *http.Response, token string, translated_r
if original_response.Message.Author.Role != "assistant" || original_response.Message.Content.Parts == nil {
continue
}
if original_response.Message.Metadata.MessageType != "next" {
continue
}
response_string := chatgpt_response_converter.ConvertToString(&original_response, &previous_text)
if stream {
_, err = c.Writer.WriteString(response_string)
Expand Down

0 comments on commit b393f9d

Please sign in to comment.