// This file is auto-generated by alef — DO NOT EDIT.
// alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
// To regenerate: alef generate
// To verify freshness: alef verify --exit-code
// Issues & docs: https://github.com/kreuzberg-dev/alef
package dev.kreuzberg.e2e

import org.junit.jupiter.api.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
import kotlin.test.assertFalse
import kotlin.test.assertFailsWith
import kotlinx.coroutines.runBlocking
import dev.kreuzberg.Kreuzberg
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import dev.kreuzberg.EmbeddingConfig

/** E2e tests for category: embeddings. */
class EmbeddingsTest {

    companion object {
        private val MAPPER = ObjectMapper().registerModule(Jdk8Module()).registerKotlinModule().setPropertyNamingStrategy(com.fasterxml.jackson.databind.PropertyNamingStrategies.SNAKE_CASE)
    }
    @Test
    fun testEmbedTextsDifferentPreset() = runBlocking {
        // embed_texts: multilingual preset
        val config = MAPPER.readValue("{\"model\":{\"name\":\"multilingual\",\"type\":\"preset\"}}", EmbeddingConfig::class.java)
        val result = Kreuzberg.embedTexts(listOf("Hello world", "Test"), config)
        // skipped: field 'embeddings' not available on result type
    }

    @Test
    fun testGetEmbeddingPresetKnown() = runBlocking {
        // get_embedding_preset: known preset
        val result = Kreuzberg.getEmbeddingPreset("balanced")
    }

    @Test
    fun testGetEmbeddingPresetNominal() = runBlocking {
        // get_embedding_preset: nominal case
        val result = Kreuzberg.getEmbeddingPreset("balanced")
    }

    @Test
    fun testGetEmbeddingPresetUnknown() = runBlocking {
        // get_embedding_preset: unknown preset fails
        val result = Kreuzberg.getEmbeddingPreset("nonexistent-xyz")
        assertTrue(result == null, "expected empty value")
    }

    @Test
    fun testListEmbeddingPresetsSanity() = runBlocking {
        // list_embedding_presets: returns at least one
        val result = Kreuzberg.listEmbeddingPresets()
        assertFalse(result.isEmpty(), "expected non-empty value")
    }

}
