Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
fix askOpenAI()
Browse files Browse the repository at this point in the history
  • Loading branch information
mkloubert committed Aug 15, 2023
1 parent 784931b commit 7b1c351
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openai/chatgpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ func askOpenAI(openaiApiKey string, systemPrompt string, temperature float64, co
return "", errors.New("conversation must have at least one element")
}

if len(conversation)%2 != 0 {
return "", errors.New("number of conversation elements must be even")
if len(conversation)%2 == 0 {
return "", errors.New("number of conversation elements must be odd")
}

messages := make([]ChatGPTOpenAIMessage, 0)
Expand Down

0 comments on commit 7b1c351

Please sign in to comment.