<?php

return [
    'name'           => 'AiCore',
    'module_version' => '1.4.2',

    /*
    |--------------------------------------------------------------------------
    | Default provider / model
    |--------------------------------------------------------------------------
    | Used when a business has not configured its own provider yet. Gemini has
    | a usable free tier which makes it the friendliest default for evaluation.
    */
    'default_provider' => env('AICORE_PROVIDER', 'gemini'),

    // HTTP timeout (seconds) for every LLM call.
    'timeout' => (int) env('AICORE_TIMEOUT', 90),

    /*
    |--------------------------------------------------------------------------
    | Tool / function-calling protocol
    |--------------------------------------------------------------------------
    | Provider-agnostic text protocol: the model emits exactly one line
    |   [[ACTION:<name>]]{json-args}
    | when it wants to call a whitelisted tool. The tag below is the keyword
    | between the double brackets.
    */
    'tool_protocol_tag' => env('AICORE_TOOL_TAG', 'ACTION'),

    /*
    |--------------------------------------------------------------------------
    | Budget enforcement
    |--------------------------------------------------------------------------
    | When true, AiClient refuses calls once a business passes its
    | monthly_token_budget and returns ['ok'=>false,'error'=>'budget_exceeded'].
    */
    'budget_enforce' => (bool) env('AICORE_BUDGET_ENFORCE', true),

    /*
    |--------------------------------------------------------------------------
    | Response cache
    |--------------------------------------------------------------------------
    | Optional short-TTL cache for identical (provider+model+system+user)
    | prompts. Only calls that explicitly opt in with ['cacheable'=>true] are
    | cached (the read-only lab-interpretation + prescription-safety endpoints);
    | interactive assistant/transcription calls never are. Safe on by default.
    */
    'cache' => [
        'enabled' => (bool) env('AICORE_CACHE', true),
        'ttl'     => (int) env('AICORE_CACHE_TTL', 300),
    ],

    /*
    |--------------------------------------------------------------------------
    | Anthropic prompt caching
    |--------------------------------------------------------------------------
    | Adds cache_control to the (largely static) system block so repeated
    | system prompts — e.g. the WhatsApp RAG preamble — are billed/served from
    | Anthropic's prompt cache. Ignored by other providers.
    */
    'anthropic_prompt_cache' => (bool) env('AICORE_ANTHROPIC_CACHE', true),

    /*
    |--------------------------------------------------------------------------
    | Provider failover (resilience)
    |--------------------------------------------------------------------------
    | When a business's primary provider call fails (network error, 5xx, rate
    | limit, timeout — anything other than an intentional budget stop), AiClient
    | transparently retries the business's configured fallback provider rows, in
    | this order. Each entry is an ai_providers `name`: a separate, enabled and
    | configured profile for the SAME business (e.g. 'default' = Bynara,
    | 'fallback' = Groq). Empty list disables failover.
    */
    'fallback_names' => ['fallback', 'fallback2', 'fallback3'],

    // Verticals whose consultation screens use dictation — the Voice
    // transcription settings block is only shown for these business types.
    'voice_verticals' => ['vet_clinic', 'medical_clinic'],

    /*
    |--------------------------------------------------------------------------
    | Service presets
    |--------------------------------------------------------------------------
    | One-click starting points for the failover-chain UI. Picking a preset
    | autofills the provider, endpoint base_url and a sensible default model; the
    | admin still supplies the API key (and, for the user-supplied endpoints,
    | the base_url). Presets whose base_url is '' expect the admin to paste the
    | endpoint themselves (Bynara / naraya.ai / a bespoke OpenAI-compatible box).
    */
    'presets' => [
        'groq' => [
            'label'    => 'Groq (free tier)',
            'provider' => 'openai_compatible',
            'base_url' => 'https://api.groq.com/openai/v1',
            'model'    => 'llama-3.3-70b-versatile',
        ],
        'claude' => [
            'label'    => 'Claude (Anthropic)',
            'provider' => 'anthropic',
            'base_url' => '',
            'model'    => 'claude-haiku-4-5-20251001',
        ],
        'openai' => [
            'label'    => 'OpenAI (GPT)',
            'provider' => 'openai',
            'base_url' => null,
            'model'    => 'gpt-4o-mini',
        ],
        'gemini' => [
            'label'    => 'Google Gemini',
            'provider' => 'gemini',
            'base_url' => null,
            'model'    => 'gemini-2.5-flash',
        ],
        'deepseek' => [
            'label'    => 'DeepSeek',
            'provider' => 'openai_compatible',
            'base_url' => 'https://api.deepseek.com/v1',
            'model'    => 'deepseek-chat',
        ],
        'zai' => [
            'label'    => 'z.ai',
            'provider' => 'openai_compatible',
            'base_url' => 'https://api.z.ai/api/paas/v4',
            'model'    => '',
        ],
        'bynara' => [
            'label'    => 'Bynara',
            'provider' => 'openai_compatible',
            'base_url' => '',
            'model'    => '',
        ],
        'naraya' => [
            'label'    => 'naraya.ai',
            'provider' => 'openai_compatible',
            'base_url' => '',
            'model'    => '',
        ],
        'custom' => [
            'label'    => 'Custom (OpenAI-compatible)',
            'provider' => 'openai_compatible',
            'base_url' => '',
            'model'    => '',
        ],
    ],
];
