<?php
namespace EasyChat\Library\Ai;








class EmbeddingConfigResolver {

    public static function resolve($provider) {
        $provider = (string)$provider;

        if ($provider === 'easytokens') {
            return [
                'model'           => 'easytokens-embedding',
                'dimension'       => 1024,
                'send_dimensions' => false,
            ];
        }

        if ($provider === 'gemini') {
            return [
                'model'           => 'gemini-embedding-001',
                'dimension'       => 768,
                'send_dimensions' => true,
            ];
        }

        return [
            'model'           => 'text-embedding-3-small',
            'dimension'       => 1536,
            'send_dimensions' => true,
        ];
    }

    public static function requestDimension(array $config) {
        return !empty($config['send_dimensions']) ? (int)$config['dimension'] : null;
    }
}
