// Generated by alef. Do not edit by hand.
@file:Suppress(
    "ktlint:standard:trailing-comma-on-call-site",
    "ktlint:standard:trailing-comma-on-declaration-site",
    "ktlint:standard:spacing-between-declarations-with-comments",
    "ktlint:standard:spacing-between-declarations-with-annotations",
    "ktlint:standard:when-entry-bracing",
    "ktlint:standard:blank-line-between-when-conditions",
    "ktlint:standard:blank-line-before-declaration",
    "ktlint:standard:chain-method-continuation",
    "ktlint:standard:annotation",
    "ktlint:standard:max-line-length",
    "ktlint:standard:no-semi",
    "ktlint:standard:statement-wrapping",
    "MaxLineLength",
    "TooManyFunctions",
    "FunctionParameterNaming",
    "LongParameterList",
    "CyclomaticComplexMethod",
    "LongMethod",
)

package dev.kreuzberg

import java.nio.file.Path

/**
 * Embedding configuration for text chunks.
 *
 * Configures embedding generation using ONNX models via the vendored embedding engine.
 * Requires the `embeddings` feature to be enabled.
 */
data class EmbeddingConfig(
    /** The embedding model to use (defaults to "balanced" preset if not specified) */
    @field:com.fasterxml.jackson.databind.annotation.JsonSerialize(`as` = EmbeddingModelType::class)
    val model: EmbeddingModelType,
    /** Whether to normalize embedding vectors (recommended for cosine similarity) */
    val normalize: Boolean = true,
    /** Batch size for embedding generation */
    val batchSize: Long = 32L,
    /** Show model download progress */
    val showDownloadProgress: Boolean = false,
    /**
     * Custom cache directory for model files
     *
     * Defaults to `~/.cache/kreuzberg/embeddings/` if not specified.
     * Allows full customization of model download location.
     */
    val cacheDir: java.nio.file.Path? = null,
    /**
     * Hardware acceleration for the embedding ONNX model.
     *
     * When set, controls which execution provider (CPU, CUDA, CoreML, TensorRT)
     * is used for inference. Defaults to `null` (auto-select per platform).
     */
    val acceleration: AccelerationConfig? = null,
    /**
     * Maximum wall-clock duration (in seconds) for a single `embed()` call when
     * using `EmbeddingModelType.Plugin`.
     *
     * Applies only to the in-process plugin path — protects against hung
     * host-language backends (e.g. a Python callback deadlocked on the GIL,
     * a model stuck on CUDA OOM retries, etc.). On timeout, the dispatcher
     * returns `Plugin` instead of blocking forever.
     *
     * `null` disables the timeout. The default (60 seconds) is conservative
     * for common in-process inference; increase for large batches on slow
     * hardware.
     */
    val maxEmbedDurationSecs: Long? = null,
)
