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

/** Metadata about a chunk's position in the original document. */
data class ChunkMetadata(
    /** Byte offset where this chunk starts in the original text (UTF-8 valid boundary). */
    val byteStart: Long,
    /** Byte offset where this chunk ends in the original text (UTF-8 valid boundary). */
    val byteEnd: Long,
    /**
     * Number of tokens in this chunk (if available).
     *
     * This is calculated by the embedding model's tokenizer if embeddings are enabled.
     */
    val tokenCount: Long? = null,
    /** Zero-based index of this chunk in the document. */
    val chunkIndex: Long,
    /** Total number of chunks in the document. */
    val totalChunks: Long,
    /**
     * First page number this chunk spans (1-indexed).
     *
     * Only populated when page tracking is enabled in extraction configuration.
     */
    val firstPage: Int? = null,
    /**
     * Last page number this chunk spans (1-indexed, equal to first_page for single-page chunks).
     *
     * Only populated when page tracking is enabled in extraction configuration.
     */
    val lastPage: Int? = null,
    /**
     * Heading context when using Markdown chunker.
     *
     * Contains the heading hierarchy this chunk falls under.
     * Only populated when `ChunkerType.Markdown` is used.
     */
    val headingContext: HeadingContext? = null,
    /**
     * Indices into `ExtractionResult.images` for images on pages covered by this chunk.
     *
     * Contains zero-based indices into the top-level `images` collection for every
     * image whose `page_number` falls within `[first_page, last_page]`.
     * Empty when image extraction is disabled or the chunk spans no pages with images.
     */
    val imageIndices: List<Int> = emptyList(),
)
