From 1af532b40443f3291e0a41caf9ee10a7a021c473 Mon Sep 17 00:00:00 2001 From: Robi9 Date: Tue, 28 Nov 2023 11:26:04 -0300 Subject: [PATCH] Add one more prompt for chatGPT --- services/external/weni/service.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/external/weni/service.go b/services/external/weni/service.go index 60ca2b7ac..3f8857e36 100644 --- a/services/external/weni/service.go +++ b/services/external/weni/service.go @@ -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")