AI Integration

AI integration configuration options

Novus CMS uses the Laravel Prism package to integrate with AI providers. This document highlights the key configuration options in config/novus.php.

Key Configuration Options

'ai' => [
    // Master switch for AI features
    'enabled' => env('NOVUS_AI_ENABLED', false),

    // AI provider selection
    'provider' => env('NOVUS_AI_PROVIDER', 'openai'),

    // Provider credentials and settings
    'provider_details' => [
        'url' => env('OPENAI_URL', 'https://api.openai.com/v1'),
        'api_key' => env('OPENAI_API_KEY', env('NOVUS_AI_API_KEY', '')),
        'organization' => env('OPENAI_ORGANIZATION', null),
        'project' => env('OPENAI_PROJECT', null),
    ],

    // Which AI features to enable
    'content_features' => [
        'title_generation' => true,
        'content_expansion' => true,
        'content_summarization' => true,
        'grammar_checking' => true,
        'seo_optimization' => true,
    ],

    // Token limits for cost control
    'max_tokens' => [
        'title_generation' => 100,
        'content_generation' => 1000,
        'summarization' => 300,
        'seo_generation' => 800,
    ],

    // Request timeout in seconds
    'timeout' => env('NOVUS_AI_TIMEOUT', 30),

    // Use mock responses in development
    'mock_responses' => env('NOVUS_AI_MOCK_RESPONSES', app()->environment('local', 'testing')),
],

Laravel Prism Integration

Novus automatically configures the Laravel Prism package in the NovusServiceProvider:

// From NovusServiceProvider.php
private function registerPrismConfiguration(): void
{
    $aiConfig = config('novus.ai', []);

    if (! ($aiConfig['enabled'] ?? false)) {
        return;
    }

    if (! config()->has('prism.providers')) {
        $provider = $aiConfig['provider'] ?? 'openai';
        $providerDetails = $aiConfig['provider_details'] ?? [];

        // Configuration for the selected provider
        $providerConfig = [...];

        config([
            'prism.providers.'.$provider => $providerConfig,
            'prism.prism_server.enabled' => true,
        ]);
    }
}

Supported AI Providers

Novus supports these AI providers through Laravel Prism:

  • openai (default)
  • anthropic
  • mistral
  • gemini
  • groq
  • ollama
  • xai
  • deepseek
  • voyageai
Previous
Integration setup