$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => ‘././text-davinci-003/completions’,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => ‘’,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => ‘POST’,
CURLOPT_POSTFIELDS => ‘{
“prompt”: "’ . $prompt . ‘",
“temperature”: 0.4,
“max_tokens”: 3000,
“top_p”: 1,
“frequency_penalty”: 0,
“presence_penalty”: 0
}’,
CURLOPT_HTTPHEADER => array(
‘Content-Type: application/json’,
'Authorization: Bearer ’ . $api_key . ‘’
),
));
$response = curl_exec($curl);
curl_close($curl);
Here is my code. I need support. My problem is listed below:
When I use this URL: […/text-davinci-003/completions], it will respond up to 1000 words or around 2500 tokens. If we need more than 10000 tokens, which URL do we need to use? We have an API key.
Can you please modify my code as soon as possible? Your early response in this matter is appreciated.