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

use kreuzberg::{embed_texts, get_embedding_preset, list_embedding_presets};

#[test]
fn test_embed_texts_different_preset() {
    // embed_texts: multilingual preset
    let texts_json: serde_json::Value = serde_json::from_str(r#"["Hello world","Test"]"#).unwrap();
    let texts = serde_json::from_value::<Vec<String>>(texts_json).unwrap();
    let config_json: serde_json::Value =
        serde_json::from_str(r#"{"model":{"name":"multilingual","type":"preset"}}"#).unwrap();
    let config = serde_json::from_value(config_json).unwrap();
    let result = embed_texts(texts, &config).expect("should succeed");
    assert!(result.len() >= 2, "expected at least 2 elements, got {}", result.len());
}

#[test]
fn test_get_embedding_preset_known() {
    // get_embedding_preset: known preset
    let name = r#"balanced"#;
    let _ = get_embedding_preset(name);
}

#[test]
fn test_get_embedding_preset_nominal() {
    // get_embedding_preset: nominal case
    let name = r#"balanced"#;
    let _ = get_embedding_preset(name);
}

#[test]
fn test_get_embedding_preset_unknown() {
    // get_embedding_preset: unknown preset fails
    let name = r#"nonexistent-xyz"#;
    let result = get_embedding_preset(name);
    assert!(result.is_none(), "expected Option to be is_none");
}

#[test]
fn test_list_embedding_presets_sanity() {
    // list_embedding_presets: returns at least one
    let result = list_embedding_presets();
    assert!(!result.is_empty(), "expected non-empty value");
}
