Skip to content

Commit

Permalink
Add prompt for chatgpt
Browse files Browse the repository at this point in the history
  • Loading branch information
Robi9 committed Mar 19, 2024
1 parent c3b9661 commit d4cc8d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion services/external/weni/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,15 @@ func GetProductListFromChatGPT(ctx context.Context, rtConfig *runtime.Config, co
Role: chatgpt.ChatMessageRoleSystem,
Content: "Preserve the order of products as they appear in the user prompt.",
}
prompt6 := chatgpt.ChatCompletionMessage{
Role: chatgpt.ChatMessageRoleSystem,
Content: "If the user does not provide a list of products, return an empty list of products.",
}
question := chatgpt.ChatCompletionMessage{
Role: chatgpt.ChatMessageRoleUser,
Content: content,
}
completionRequest := chatgpt.NewChatCompletionRequest([]chatgpt.ChatCompletionMessage{prompt1, prompt2, prompt3, prompt4, prompt5, question})
completionRequest := chatgpt.NewChatCompletionRequest([]chatgpt.ChatCompletionMessage{prompt1, prompt2, prompt3, prompt4, prompt5, prompt6, question})
response, trace, err := chatGPTClient.CreateChatCompletion(completionRequest)
if err != nil {
return nil, trace, errors.Wrapf(err, "error on chatgpt call for list products")
Expand Down

0 comments on commit d4cc8d2

Please sign in to comment.