from .genai import GenAIEmbedder
from .mock import MockEmbedder

def get_embedder_from_config(provider, dimension, model_name, api_key):

    # Use lowercase strings to match the settings values
    if provider in ["google_gemini", "gemini"]:
        return GenAIEmbedder(model_name, api_key, dimension)
    elif provider == "mock":
        return MockEmbedder(dimension)
    else:
        raise ValueError(f"Unsupported embedding provider: {provider}")
