<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class AiModel extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'model_id',
        'model_type',
        'parameters',
        'api_provider_id',
    ];

    protected $casts = [
        'parameters' => 'array',
        'enabled' => 'boolean',
    ];

    public function primaryApiProvider()
    {
        return $this->belongsTo(ApiProvider::class, 'api_provider_id');
    }
}