<?php

return [
    /*
    |--------------------------------------------------------------------------
    | OpenAI Configuration
    |--------------------------------------------------------------------------
    |
    | Configuration for OpenAI API integration
    |
    */

    'openai' => [
        'api_key' => env('OPENAI_API_KEY', ''),
        'organization' => env('OPENAI_ORGANIZATION', ''),
        'default_model' => env('OPENAI_DEFAULT_MODEL', 'gpt-4'),
        'temperature' => env('OPENAI_TEMPERATURE', 0.7),
        'max_tokens' => env('OPENAI_MAX_TOKENS', 2000),
        'timeout' => env('OPENAI_TIMEOUT', 30),
    ],

    /*
    |--------------------------------------------------------------------------
    | AI Features Settings
    |--------------------------------------------------------------------------
    |
    | Configure AI-powered features behavior
    |
    */

    'features' => [
        'product_descriptions' => [
            'enabled' => env('AI_PRODUCT_DESCRIPTIONS_ENABLED', true),
            'auto_generate' => env('AI_AUTO_GENERATE_DESCRIPTIONS', false),
            'min_length' => 50,
            'max_length' => 500,
            'tone' => 'professional', // professional, casual, formal
        ],

        'moderation' => [
            'enabled' => env('AI_MODERATION_ENABLED', true),
            'moderate_text' => true,
            'moderate_images' => true,
            'sensitivity_level' => 'medium', // low, medium, high
            'auto_reject_inappropriate' => false,
        ],

        'recommendations' => [
            'enabled' => env('AI_RECOMMENDATIONS_ENABLED', true),
            'max_recommendations' => 5,
            'algorithm' => 'collaborative_filtering',
            'min_confidence' => 0.7,
        ],

        'reports' => [
            'enabled' => env('AI_REPORTS_ENABLED', true),
            'auto_generate_daily' => false,
            'include_predictions' => true,
            'prediction_confidence' => 0.8,
        ],

        'stagnant_detection' => [
            'enabled' => env('AI_STAGNANT_DETECTION_ENABLED', true),
            'inactivity_threshold_days' => 30,
            'check_frequency_hours' => 24,
            'send_alerts' => true,
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Rate Limits
    |--------------------------------------------------------------------------
    |
    | API request rate limits to prevent abuse
    |
    */

    'rate_limits' => [
        'requests_per_minute' => env('AI_REQUESTS_PER_MINUTE', 20),
        'requests_per_hour' => env('AI_REQUESTS_PER_HOUR', 500),
        'requests_per_day' => env('AI_REQUESTS_PER_DAY', 10000),
    ],

    /*
    |--------------------------------------------------------------------------
    | Caching
    |--------------------------------------------------------------------------
    |
    | Cache AI responses to reduce API calls and costs
    |
    */

    'cache' => [
        'enabled' => env('AI_CACHE_ENABLED', true),
        'ttl' => env('AI_CACHE_TTL', 3600), // 1 hour in seconds
        'driver' => env('CACHE_DRIVER', 'file'),
    ],

    /*
    |--------------------------------------------------------------------------
    | Logging
    |--------------------------------------------------------------------------
    |
    | Log AI requests and responses for debugging and analytics
    |
    */

    'logging' => [
        'enabled' => env('AI_LOGGING_ENABLED', true),
        'log_requests' => true,
        'log_responses' => false, // May contain sensitive data
        'log_errors' => true,
    ],
];
