Skip to content

Commit

Permalink
Update custom_bible_passage.php
Browse files Browse the repository at this point in the history
Added the "presence_penalty" parameter to the request rather than frequency parameter, as it's an absolute measurement rather than a relative measurement.  https://platform.openai.com/docs/api-reference/parameter-details suggests that 0.1 to 1 is reasonable to suppress repetition - with a value of 2 the quality of the sample would decrease
  • Loading branch information
lightbulbheaduk authored Jul 19, 2023
1 parent 5db3955 commit dffac31
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions custom_bible_passage.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function callchatgpt($prompt,$temp) {
'prompt' => $prompt,
'max_tokens' => 500, // each token is about 3/4 of a word and costs around $0.02 per thousand tokens
'temperature' => $temp, // 0 = most deterministic, 1 is most creative
'presence_penalty' => 1 // -2 = encourage repetition, 2 is avoid repetition
);

// Set the API key in the header of the request
Expand Down

0 comments on commit dffac31

Please sign in to comment.