Hi
In spanish text UI disturb space between word lost as you see in image and also 10th point comes under 9thpoint
and also response time taken too much time
here it is my code
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.openai.com/v1/completions');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n \"model\": \"text-davinci-003\",\n \"prompt\": \"$request->aitopic\",\n \"temperature\": 0.6,\n \"max_tokens\": 2048,\n \"top_p\": 1,\n \"frequency_penalty\": 1,\n \"presence_penalty\": 1\n}");
$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'Authorization: Bearer ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■nE72B8VT';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
/*if (curl_errno($ch)) {
return response()->json();
}*/
$data = json_decode($result,true);
$ai = nl2br($data['choices'][0]['text']) ?? NULL;
curl_close($ch);
if(is_null()){
return response()->json($ai);
}
return response()->json([$ai,$request->aitopic]);