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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using Xunit;
using Kreuzberg;
using static Kreuzberg.KreuzbergLib;

namespace Kreuzberg
{
    /// <summary>E2e tests for category: embeddings.</summary>
    public class EmbeddingsTests
    {
            private static readonly JsonSerializerOptions ConfigOptions = new() { Converters = { new JsonStringEnumConverter(JsonNamingPolicy.SnakeCaseLower) }, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault };

        [Fact]
        public void Test_EmbedTextsDifferentPreset()
        {
            // embed_texts: multilingual preset
            var result = KreuzbergLib.EmbedTexts(new List<String>() { JsonSerializer.Deserialize<String>("\"Hello world\"", ConfigOptions)!, JsonSerializer.Deserialize<String>("\"Test\"", ConfigOptions)! }, new EmbeddingConfig { Model = JsonSerializer.Deserialize<EmbeddingModelType>("{\"name\":\"multilingual\",\"type\":\"preset\"}", ConfigOptions)! });
    Assert.True(result.Count >= 2);

        }

        [Fact]
        public void Test_GetEmbeddingPresetKnown()
        {
            // get_embedding_preset: known preset
            var result = KreuzbergLib.GetEmbeddingPreset("balanced");

        }

        [Fact]
        public void Test_GetEmbeddingPresetNominal()
        {
            // get_embedding_preset: nominal case
            var result = KreuzbergLib.GetEmbeddingPreset("balanced");

        }

        [Fact]
        public void Test_GetEmbeddingPresetUnknown()
        {
            // get_embedding_preset: unknown preset fails
            var result = KreuzbergLib.GetEmbeddingPreset("nonexistent-xyz");
    Assert.True(string.IsNullOrEmpty(result?.ToString()));

        }

        [Fact]
        public void Test_ListEmbeddingPresetsSanity()
        {
            // list_embedding_presets: returns at least one
            var result = KreuzbergLib.ListEmbeddingPresets();
    Assert.NotEmpty(result);

        }


    }
}
