# 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
defmodule Kreuzberg.OcrConfig do
  @moduledoc "OCR configuration."

  @typedoc "OCR configuration."
  @type t :: %__MODULE__{
          enabled: boolean(),
          backend: String.t() | nil,
          language: String.t() | nil,
          tesseract_config: map() | nil,
          output_format: String.t() | nil | nil,
          paddle_ocr_config: String.t() | nil,
          backend_options: String.t() | nil,
          element_config: map() | nil,
          quality_thresholds: map() | nil,
          pipeline: map() | nil,
          auto_rotate: boolean(),
          vlm_config: map() | nil,
          vlm_prompt: String.t() | nil,
          acceleration: map() | nil,
          tessdata_bytes: map() | nil
        }

  defstruct enabled: true,
            backend: nil,
            language: nil,
            tesseract_config: nil,
            output_format: nil,
            paddle_ocr_config: nil,
            backend_options: nil,
            element_config: nil,
            quality_thresholds: nil,
            pipeline: nil,
            auto_rotate: false,
            vlm_config: nil,
            vlm_prompt: nil,
            acceleration: nil,
            tessdata_bytes: nil

  defimpl Jason.Encoder do
    @doc false
    def encode(value, opts) do
      value
      |> Map.from_struct()
      |> Enum.reject(fn {_k, v} -> v == nil end)
      |> Enum.into(%{})
      |> Jason.Encoder.encode(opts)
    end
  end
end
