AI provider management

* 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
This commit is contained in:
Mark Gregory
2026-07-24 13:01:56 +01:00
parent bf37548faa
commit 5dbb04e3ad
26 changed files with 377 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
<?php
namespace Modules\AI\Console;
use Illuminate\Console\Command;
use Modules\AI\Models\AIExecution;
final class PruneAIExecutions extends Command
{
protected $signature='ai:prune {--days=}'; protected $description='Remove old AI execution records.';
public function handle(): int { $days=(int)($this->option('days')?:config('ai.retain_executions_days',90)); $count=AIExecution::where('created_at','<',now()->subDays($days))->delete(); $this->info("Deleted {$count} AI executions."); return self::SUCCESS; }
}
+9
View File
@@ -0,0 +1,9 @@
<?php
namespace Modules\AI\Console;
use Illuminate\Console\Command;
use Modules\AI\Contracts\AIManager;
final class TestAIProvider extends Command
{
protected $signature='ai:test {provider}'; protected $description='Test an AI provider connection.';
public function handle(AIManager $manager): int { $result=$manager->testProvider((int)$this->argument('provider')); $this->{$result['ok']?'info':'error'}($result['message']); return $result['ok']?self::SUCCESS:self::FAILURE; }
}