Files
Jeremy 8c67d51ced feat: multi-provider AI settings and provider foundation
Introduce the AI provider layer: laravel/ai SDK integration, AiService
and AiExtractionService, the AiProvider enum (OpenAI, Gemini, Ollama)
and supporting DTOs/agents.

- Encrypt stored API keys; per-provider test-connection action
- Ollama model dropdown with reachability-based connection test
- Multi-provider settings UI with per-row test and auto-migration of
  the legacy single-provider shape into the multi-provider structure
- Resolve active config through AiProviderConfigDto
2026-06-09 15:07:40 +10:00

35 lines
707 B
PHP

<?php
namespace App\Enums;
use Laravel\Ai\Enums\Lab;
enum AiProvider: string
{
case OpenAI = 'openai';
case Anthropic = 'anthropic';
case Ollama = 'ollama';
case Gemini = 'gemini';
/**
* Map this provider to the Laravel AI SDK provider enum.
*/
public function toLab(): Lab
{
return match ($this) {
self::OpenAI => Lab::OpenAI,
self::Anthropic => Lab::Anthropic,
self::Ollama => Lab::Ollama,
self::Gemini => Lab::Gemini,
};
}
/**
* The config key for this provider under `config('ai.providers.*')`.
*/
public function driver(): string
{
return $this->value;
}
}