File: /var/www/html/laravel/app/Models/FineTuningJob.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property int $prompt_id
* @property string $job_id
* @property string $file_name
* @property int $examples_number
* @property string $model_name
* @property string $parent_model
* @property string $created_at
*/
class FineTuningJob extends Model
{
protected $table = 'fine_tuning_jobs';
protected $fillable = [
'prompt_id',
'job_id',
'file_name',
'examples_number',
'model_name',
'parent_model',
'created_at',
'error',
'type',
];
public function callGptProxi($data)
{
$url = 'http://158.160.85.61/proxy.php?url=gpt-tuning.php';
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type:application/json']);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
$result = curl_exec($curl);
$error = curl_error($curl);
curl_close($curl);
if (!empty($error)) {
return $error;
}
return json_decode($result);
}
}