* OpenAI-compatible provider adapter * OpenAI support * LM Studio support * Ollama OpenAI-compatible support * Encrypted API-key storage * Default provider and model selection * Provider connection testing * Reusable prompt library * Prompt variables and templates * Prompt version field * AI execution history * Token-usage storage * Duration and failure tracking * Manual knowledge sources * Knowledge-source chunking * Knowledge indexing status * Authenticated AI REST endpoint * AI administration dashboard * AI permissions * Module registration and boot test
23 lines
878 B
PHP
23 lines
878 B
PHP
<?php
|
|
namespace Modules\AI\Providers;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Modules\AI\Console\PruneAIExecutions;
|
|
use Modules\AI\Console\TestAIProvider;
|
|
use Modules\AI\Contracts\AIManager as AIManagerContract;
|
|
use Modules\AI\Services\AIManager;
|
|
final class AIServiceProvider extends ServiceProvider
|
|
{
|
|
public function register(): void
|
|
{
|
|
$this->app->register(RouteServiceProvider::class);
|
|
$this->mergeConfigFrom(module_path('AI', 'Config/config.php'), 'ai');
|
|
$this->app->singleton(AIManagerContract::class, AIManager::class);
|
|
}
|
|
public function boot(): void
|
|
{
|
|
$this->loadMigrationsFrom(module_path('AI', 'Database/Migrations'));
|
|
$this->loadViewsFrom(module_path('AI', 'Resources/views'), 'ai');
|
|
if ($this->app->runningInConsole()) $this->commands([TestAIProvider::class, PruneAIExecutions::class]);
|
|
}
|
|
}
|