// 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

// E2e tests for category: embeddings
package e2e_test

import (
	"encoding/json"
	"testing"

	"github.com/stretchr/testify/assert"

	kreuzberg "github.com/kreuzberg-dev/kreuzberg/v5"
)

func Test_EmbedTextsDifferentPreset(t *testing.T) {
	// embed_texts: multilingual preset
	var texts []string
	if err := json.Unmarshal([]byte(`["Hello world","test"]`), &texts); err != nil {
		t.Fatalf("config parse failed: %v", err)
	}
	var config kreuzberg.EmbeddingConfig
	if err := json.Unmarshal([]byte(`{"model":{"name":"multilingual","type":"preset"}}`), &config); err != nil {
		t.Fatalf("config parse failed: %v", err)
	}
	result, err := kreuzberg.EmbedTexts(texts, config)
	if err != nil {
		t.Fatalf("call failed: %v", err)
	}
	value := result
	assert.GreaterOrEqual(t, len(value), 2, "expected at least 2 elements")
}

func Test_GetEmbeddingPresetKnown(t *testing.T) {
	// get_embedding_preset: known preset
	_ = kreuzberg.GetEmbeddingPreset(`balanced`)
}

func Test_GetEmbeddingPresetNominal(t *testing.T) {
	// get_embedding_preset: nominal case
	_ = kreuzberg.GetEmbeddingPreset(`balanced`)
}

func Test_GetEmbeddingPresetUnknown(t *testing.T) {
	// get_embedding_preset: unknown preset fails
	result := kreuzberg.GetEmbeddingPreset(`nonexistent-xyz`)
	if result != nil {
		t.Errorf("expected empty value, got %v", result)
	}
}

func Test_ListEmbeddingPresetsSanity(t *testing.T) {
	// list_embedding_presets: returns at least one
	result := kreuzberg.ListEmbeddingPresets()
	value := result
	if len(value) == 0 {
		t.Errorf("expected non-empty value")
	}
}
