// 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
package dev.kreuzberg;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;

/**
 * Preset configurations for common RAG use cases.
 *
 * Each preset combines chunk size, overlap, and embedding model
 * to provide an optimized configuration for specific scenarios.
 *
 * All string fields are owned {@code String} for FFI compatibility — instances
 * are safe to clone and pass across language boundaries.
 */
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = EmbeddingPreset.Builder.class)
public record EmbeddingPreset(
    @JsonProperty("name") String name,
    @JsonProperty("chunk_size") long chunkSize,
    @JsonProperty("overlap") long overlap,
    /**
     * HuggingFace repository name for the model.
     */
    @JsonProperty("model_repo") String modelRepo,
    /**
     * Pooling strategy: "cls" or "mean".
     */
    @JsonProperty("pooling") String pooling,
    /**
     * Path to the ONNX model file within the repo.
     */
    @JsonProperty("model_file") String modelFile,
    @JsonProperty("dimensions") long dimensions,
    @JsonProperty("description") String description
) {
    public static Builder builder() {
        return new Builder();
    }

    // CPD-OFF
    @JsonPOJOBuilder(withPrefix = "with", buildMethodName = "build")
    public static final class Builder {

private String name = "";
        @JsonProperty("chunk_size")
private long chunkSize = 0;
private long overlap = 0;
        @JsonProperty("model_repo")
private String modelRepo = "";
private String pooling = "";
        @JsonProperty("model_file")
private String modelFile = "";
private long dimensions = 0;
private String description = "";

        /** Sets the name field. */
        @JsonProperty("name")
        public Builder withName(final String value) {
            this.name = value;
            return this;
        }

        /** Sets the chunkSize field. */
        @JsonProperty("chunk_size")
        public Builder withChunkSize(final long value) {
            this.chunkSize = value;
            return this;
        }

        /** Sets the overlap field. */
        @JsonProperty("overlap")
        public Builder withOverlap(final long value) {
            this.overlap = value;
            return this;
        }

        /** Sets the modelRepo field. */
        @JsonProperty("model_repo")
        public Builder withModelRepo(final String value) {
            this.modelRepo = value;
            return this;
        }

        /** Sets the pooling field. */
        @JsonProperty("pooling")
        public Builder withPooling(final String value) {
            this.pooling = value;
            return this;
        }

        /** Sets the modelFile field. */
        @JsonProperty("model_file")
        public Builder withModelFile(final String value) {
            this.modelFile = value;
            return this;
        }

        /** Sets the dimensions field. */
        @JsonProperty("dimensions")
        public Builder withDimensions(final long value) {
            this.dimensions = value;
            return this;
        }

        /** Sets the description field. */
        @JsonProperty("description")
        public Builder withDescription(final String value) {
            this.description = value;
            return this;
        }

        /** Builds the EmbeddingPreset instance. */
        public EmbeddingPreset build() {
            return new EmbeddingPreset(
                name,
                chunkSize,
                overlap,
                modelRepo,
                pooling,
                modelFile,
                dimensions,
                description
            );
        }
    }
    // CPD-ON
}
