"""Tests for embedding generation."""

import pytest

from bifrost_rag.embeddings import Embedder, VoyageEmbedder


class TestEmbedder:
    def test_abstract_interface(self):
        with pytest.raises(TypeError):
            Embedder()

    def test_subclass_must_implement_embed(self):
        class BadEmbedder(Embedder):
            pass

        with pytest.raises(TypeError):
            BadEmbedder()


class TestVoyageEmbedder:
    def test_creation_with_defaults(self):
        embedder = VoyageEmbedder(api_key="test-key")
        assert embedder.model == "voyage-3"
        assert embedder.dimension > 0

    def test_creation_with_custom_model(self):
        embedder = VoyageEmbedder(api_key="test-key", model="voyage-3-lite")
        assert embedder.model == "voyage-3-lite"

    def test_batch_size_default(self):
        embedder = VoyageEmbedder(api_key="test-key")
        assert embedder.batch_size == 128
