<?php

namespace ZenoChatbot\Helper;

use ZenoChatbot\App;
use ZenoChatbot\Support\Hooks;

class LLMHelper
{
    public static function getAvailableProviders()
    {
        $providers = App::config('api.llm_providers', []);

        $providers = array_filter($providers, function ($provider) {
            return isset($provider['enabled']) && $provider['enabled'] === true;
        });

        $providers = Hooks::applyFilters(Hooks::LLM_PROVIDERS, $providers);
        return $providers;
    }

    public static function getDefaultLLMProvider()
    {
        $config = App::config('api.llm_defaults', []);
        $config = Hooks::applyFilters(Hooks::LLM_DEFAULT_PROVIDER, $config);
        return $config;
    }
}
