feat(AI): add ai manager admin and create powerpoint with ai
This commit is contained in:
31
app/Models/AiProvider.php
Normal file
31
app/Models/AiProvider.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\AiProviderDriver;
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Attributes\Hidden;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
#[Fillable(['name', 'driver', 'model', 'base_url', 'api_key', 'is_active', 'is_default'])]
|
||||
#[Hidden(['api_key'])]
|
||||
class AiProvider extends Model
|
||||
{
|
||||
public function resolvedBaseUrl(): string
|
||||
{
|
||||
return $this->base_url ?: $this->driver->defaultBaseUrl();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'driver' => AiProviderDriver::class,
|
||||
'api_key' => 'encrypted',
|
||||
'is_active' => 'boolean',
|
||||
'is_default' => 'boolean',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user