# 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
# frozen_string_literal: true

require 'kreuzberg'
require 'json'
require 'spec_helper'

RSpec.describe 'embeddings' do
  it 'embed_texts_different_preset: embed_texts: multilingual preset' do
    result = Kreuzberg.embed_texts(['Hello world', 'Test'], {model: { 'name' => 'multilingual', 'type' => 'preset' }})
    expect(result.length).to be >= 2

    expect(result).not_to be_nil
  end

  it 'get_embedding_preset_known: get_embedding_preset: known preset' do
    result = Kreuzberg.get_embedding_preset('balanced')

    expect(result).not_to be_nil
  end

  it 'get_embedding_preset_nominal: get_embedding_preset: nominal case' do
    result = Kreuzberg.get_embedding_preset('balanced')

    expect(result).not_to be_nil
  end

  it 'get_embedding_preset_unknown: get_embedding_preset: unknown preset fails' do
    result = Kreuzberg.get_embedding_preset('nonexistent-xyz')
    expect(result.nil? || result.empty?).to be(true)

  end

  it 'list_embedding_presets_sanity: list_embedding_presets: returns at least one' do
    result = Kreuzberg.list_embedding_presets()
    expect(result.to_s).not_to be_empty

  end
end
