Skip to content

Commit

Permalink
Add one more prompt for chatGPT
Browse files Browse the repository at this point in the history
  • Loading branch information
Robi9 committed Nov 30, 2023
1 parent 81ade86 commit 1af532b
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 @@ -203,11 +203,15 @@ func GetProductListFromChatGPT(ctx context.Context, rtConfig *runtime.Config, co
Role: chatgpt.ChatMessageRoleSystem,
Content: "Always use this pattern: {\"products\": []}",
}
prompt4 := chatgpt.ChatCompletionMessage{
Role: chatgpt.ChatMessageRoleSystem,
Content: "Ensure that no product names are repeated, and each product should be in singular form without any numbers or quantities.",
}
question := chatgpt.ChatCompletionMessage{
Role: chatgpt.ChatMessageRoleUser,
Content: content,
}
completionRequest := chatgpt.NewChatCompletionRequest([]chatgpt.ChatCompletionMessage{prompt1, prompt2, prompt3, question})
completionRequest := chatgpt.NewChatCompletionRequest([]chatgpt.ChatCompletionMessage{prompt1, prompt2, prompt3, prompt4, 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 1af532b

Please sign in to comment.