Skip to content

Commit

Permalink
Addition of guide on content filter endpoint query.
Browse files Browse the repository at this point in the history
  • Loading branch information
godfreybafana committed May 16, 2021
1 parent b745424 commit 6cee58c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions gpt3.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,28 @@
// Stop: []string{"You:"},
// }
//
//The content filter endpoint is used to validate a prompt in order to safeguard responses ushered back to the enduser.
//The request object should always have the following parameters:
//
// reformattedPrompt := fmt.Sprintf("<|endoftext|>[%s]\n--\nLabel:", string(query))
//
// req := gpt3.ContentFilterRequest{
// Prompt: reformattedPrompt,
// MaxTokens: 1,
// TopP: 0,
// Temperature: 0,
// Logprobs: 10,
// }
//
// The Response is the same format as that of the Completions request with the following entries:
//
// 0 => text is safe
// 1 => This text is sensitive. This means that the text could be talking about a sensitive topic, something political,
// religious, or talking about a protected class such as race or nationality.
// 2 => This text is unsafe. This means that the text contains profane language, prejudiced or hateful language,
// something that could be NSFW, or text that portrays certain groups/people in a harmful manner.
//

package gpt3

import (
Expand Down

0 comments on commit 6cee58c

Please sign in to comment.