52 lines
1.1 KiB
PHP
Executable File
52 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class AiModel extends Model
|
|
{
|
|
use \Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var list<string>
|
|
*/
|
|
protected $fillable = [
|
|
'provider_id',
|
|
'name',
|
|
'slug',
|
|
'max_tokens',
|
|
'temperature_support',
|
|
'is_active',
|
|
];
|
|
|
|
/**
|
|
* Get the attributes that should be cast.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'temperature_support' => 'boolean',
|
|
'is_active' => 'boolean',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get the AI provider that owns the model.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\AiProvider, \App\Models\AiModel>
|
|
*/
|
|
public function provider(): BelongsTo
|
|
{
|
|
return $this->belongsTo(AiProvider::class);
|
|
}
|
|
}
|