Closed alanccw closed 1 month ago
Hi,
simply add the frequency_penalty
parameter in your call as shown below
$yourApiKey = getenv('YOUR_API_KEY');
$client = OpenAI::client($yourApiKey);
$result = $client->chat()->create([
'model' => 'gpt-3.5-turbo',
'messages' => [
['role' => 'user', 'content' => 'Hello!'],
],
'frequency_penalty' => 0,
]);
echo $result->choices[0]->message->content; // Hello! How can I assist you today?
Hi,
I want to set the frequency_penalty when calling gpt-3.5-turbo model via your code. How to do so? Is there a sample showing how to do this?
Thank you