# 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.Native do
  @moduledoc false

  use RustlerPrecompiled,
    otp_app: :kreuzberg,
    crate: "kreuzberg_nif",
    base_url:
      "https://github.com/kreuzberg-dev/kreuzberg/releases/download/v#{Mix.Project.config()[:version]}",
    version: Mix.Project.config()[:version],
    targets: ~w(aarch64-apple-darwin aarch64-unknown-linux-gnu x86_64-unknown-linux-gnu x86_64-pc-windows-gnu),
    nif_versions: ["2.16", "2.17"],
    force_build: System.get_env("KREUZBERG_BUILD") in ["1", "true"] or Mix.env() in [:dev]

  @doc """
  Extract content from a byte array.

  This is the main entry point for in-memory extraction. It performs the following steps:
  1. Validate MIME type
  2. Handle legacy format conversion if needed
  3. Select appropriate extractor from registry
  4. Extract content
  5. Run post-processing pipeline

  # Arguments

  * `content` - The byte array to extract
  * `mime_type` - MIME type of the content
  * `config` - Extraction configuration

  # Returns

  An `ExtractionResult` containing the extracted content and metadata.

  # Errors

  Returns `KreuzbergError::Validation` if MIME type is invalid.
  Returns `KreuzbergError::UnsupportedFormat` if MIME type is not supported.

  # Example

  ```rust,no_run
  use kreuzberg::core::extractor::extract_bytes;
  use kreuzberg::core::config::ExtractionConfig;

  let config = ExtractionConfig::default();
  let bytes = b"Hello, world!";
  let result = extract_bytes(bytes, "text/plain", &config).await?;
  println!("Content: {}", result.content);
  ```
  """
  def extract_bytes_async(_content, _mime_type, _config), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Extract content from a file.

  This is the main entry point for file-based extraction. It performs the following steps:
  1. Check cache for existing result (if caching enabled)
  2. Detect or validate MIME type
  3. Select appropriate extractor from registry
  4. Extract content
  5. Run post-processing pipeline
  6. Store result in cache (if caching enabled)

  # Arguments

  * `path` - Path to the file to extract
  * `mime_type` - Optional MIME type override. If None, will be auto-detected
  * `config` - Extraction configuration

  # Returns

  An `ExtractionResult` containing the extracted content and metadata.

  # Errors

  Returns `KreuzbergError::Io` if the file doesn't exist (NotFound) or for other file I/O errors.
  Returns `KreuzbergError::UnsupportedFormat` if MIME type is not supported.

  # Example

  ```rust,no_run
  use kreuzberg::core::extractor::extract_file;
  use kreuzberg::core::config::ExtractionConfig;

  let config = ExtractionConfig::default();
  let result = extract_file("document.pdf", None, &config).await?;
  println!("Content: {}", result.content);
  ```
  """
  def extract_file_async(_path, _mime_type, _config), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Synchronous wrapper for `extract_file`.

  This is a convenience function that blocks the current thread until extraction completes.
  For async code, use `extract_file` directly.

  Uses the global Tokio runtime for 100x+ performance improvement over creating
  a new runtime per call. Always uses the global runtime to avoid nested runtime issues.

  This function is only available with the `tokio-runtime` feature. For WASM targets,
  use a truly synchronous extraction approach instead.

  # Example

  ```rust,no_run
  use kreuzberg::core::extractor::extract_file_sync;
  use kreuzberg::core::config::ExtractionConfig;

  let config = ExtractionConfig::default();
  let result = extract_file_sync("document.pdf", None, &config)?;
  println!("Content: {}", result.content);
  ```
  """
  def extract_file_sync(_path, _mime_type, _config), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Synchronous wrapper for `extract_bytes`.

  Uses the global Tokio runtime for 100x+ performance improvement over creating
  a new runtime per call.

  With the `tokio-runtime` feature, this blocks the current thread using the global
  Tokio runtime. Without it (WASM), this calls a truly synchronous implementation.

  # Example

  ```rust,no_run
  use kreuzberg::core::extractor::extract_bytes_sync;
  use kreuzberg::core::config::ExtractionConfig;

  let config = ExtractionConfig::default();
  let bytes = b"Hello, world!";
  let result = extract_bytes_sync(bytes, "text/plain", &config)?;
  println!("Content: {}", result.content);
  ```
  """
  def extract_bytes_sync(_content, _mime_type, _config), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Detect MIME type from raw file bytes.

  Uses magic byte signatures to detect file type from content.
  Falls back to `infer` crate for comprehensive detection.

  For ZIP-based files, inspects contents to distinguish Office Open XML
  formats (DOCX, XLSX, PPTX) from plain ZIP archives.

  # Arguments

  * `content` - Raw file bytes

  # Returns

  The detected MIME type string.

  # Errors

  Returns `KreuzbergError::UnsupportedFormat` if MIME type cannot be determined.
  """
  def detect_mime_type_from_bytes(_content), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Get file extensions for a given MIME type.

  Returns all known file extensions that map to the specified MIME type.

  # Arguments

  * `mime_type` - The MIME type to look up

  # Returns

  A vector of file extensions (without leading dot) for the MIME type.

  # Example

  ```
  use kreuzberg::core::mime::get_extensions_for_mime;

  let extensions = get_extensions_for_mime("application/pdf").unwrap();
  assert_eq!(extensions, vec!["pdf"]);

  let doc_extensions = get_extensions_for_mime("application/vnd.openxmlformats-officedocument.wordprocessingml.document").unwrap();
  assert!(doc_extensions.contains(&"docx".to_string()));
  ```
  """
  def get_extensions_for_mime(_mime_type), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Clear all embedding backends from the global registry.

  Calls `shutdown()` on every registered backend, then empties the registry.

  # Errors

  - Any error returned by a backend's `shutdown()` method. The first error
    encountered stops processing of remaining backends.
  """
  def clear_embedding_backends, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  List the names of all registered embedding backends.

  Used by `kreuzberg-cli`, the api/mcp endpoints, and generated language
  bindings.
  """
  def list_embedding_backends, do: :erlang.nif_error(:nif_not_loaded)

  @doc "List names of all registered document extractors."
  def list_document_extractors, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Clear all document extractors from the global registry.

  Calls `shutdown()` on every registered extractor, then empties the registry.

  # Errors

  - Any error returned by an extractor's `shutdown()` method. The first error
    encountered stops processing of remaining extractors.
  """
  def clear_document_extractors, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  List all registered OCR backends.

  Returns the names of all OCR backends currently registered in the global registry.

  # Returns

  A vector of OCR backend names.

  # Example

  ```rust
  use kreuzberg::plugins::list_ocr_backends;

  let backends = list_ocr_backends()?;
  for name in backends {
      println!("Registered OCR backend: {}", name);
  }
  ```
  """
  def list_ocr_backends, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Clear all OCR backends from the global registry.

  Removes all OCR backends and calls their `shutdown()` methods.

  # Returns

  - `Ok(())` if all backends were cleared successfully
  - `Err(...)` if any shutdown method failed

  # Example

  ```rust
  use kreuzberg::plugins::clear_ocr_backends;

  clear_ocr_backends()?;
  ```
  """
  def clear_ocr_backends, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  List all registered post-processor names.

  Returns a vector of all post-processor names currently registered in the
  global registry.

  # Returns

  - `Ok(Vec<String>)` - Vector of post-processor names
  - `Err(...)` if the registry lock is poisoned

  # Example

  ```rust
  use kreuzberg::plugins::list_post_processors;

  let processors = list_post_processors()?;
  for name in processors {
      println!("Registered post-processor: {}", name);
  }
  ```
  """
  def list_post_processors, do: :erlang.nif_error(:nif_not_loaded)

  @doc "Remove all registered post-processors."
  def clear_post_processors, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  List names of all registered renderers.

  # Errors

  Returns an error if the registry lock is poisoned.
  """
  def list_renderers, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Clear all renderers from the global registry.

  Removes every renderer, including the built-in defaults (markdown, html,
  djot, plain). After calling this no renderers are registered; re-register
  as needed.

  # Errors

  Returns an error if the registry lock is poisoned.
  """
  def clear_renderers, do: :erlang.nif_error(:nif_not_loaded)

  @doc "List names of all registered validators."
  def list_validators, do: :erlang.nif_error(:nif_not_loaded)

  @doc "Remove all registered validators."
  def clear_validators, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Compare two extraction results and return a structured diff.

  The comparison is purely structural — no I/O, no side effects. All fields
  of [`ExtractionDiff`] are populated according to the provided [`DiffOptions`].

  # Arguments

  * `a` — the "before" extraction result
  * `b` — the "after" extraction result
  * `opts` — controls which sections are compared and optional truncation

  # Example

  ```rust,no_run
  use kreuzberg::{ExtractionResult, diff::{compare, DiffOptions}};

  let mut a = ExtractionResult::default();
  let mut b = ExtractionResult::default();
  a.content = "Hello world".to_string();
  b.content = "Hello Rust".to_string();

  let diff = compare(&a, &b, &DiffOptions::default());
  assert_eq!(diff.content_diff.len(), 1);
  ```
  """
  def compare(_a, _b, _opts), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Generate embeddings asynchronously for a list of text strings.

  This is the async counterpart to [`embed_texts`]. It offloads the blocking
  ONNX inference work to a dedicated blocking thread pool via Tokio's
  `spawn_blocking`, keeping the async executor free.

  Returns one embedding vector per input text in the same order.

  # Arguments

  * `texts` - Vec of strings to embed (owned, sent to blocking thread)
  * `config` - Embedding configuration specifying model, batch size, and normalization

  # Errors

  - `KreuzbergError::MissingDependency` if ONNX Runtime is not installed
  - `KreuzbergError::Embedding` if the preset name is unknown, model download fails,
    or the blocking inference task panics

  # Example

  ```rust,ignore
  use kreuzberg::{embed_texts_async, EmbeddingConfig};

  let embeddings = embed_texts_async(
      vec!["Hello!".to_string()],
      &EmbeddingConfig::default(),
  ).await?;
  ```
  """
  def embed_texts_async(_texts, _config), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Render a single PDF page to PNG bytes.

  Returns raw PNG-encoded bytes for the specified page at the given DPI.
  Uses pdf_oxide with tiny-skia for pure-Rust rendering.

  # Arguments

  * `pdf_bytes` - Raw PDF file bytes
  * `page_index` - Zero-based page index
  * `dpi` - Resolution in dots per inch (default: 150)
  * `password` - Optional password for encrypted PDFs

  # Errors

  Returns `KreuzbergError::Parsing` if the PDF cannot be opened, authenticated,
  or rendered, or if `page_index` is out of range.
  """
  def render_pdf_page_to_png(_pdf_bytes, _page_index, _dpi, _password), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Detect the MIME type of a file at the given path.

  Uses the file extension and optionally the file content to determine the MIME type.
  Set `check_exists` to `true` to verify the file exists before detection.
  """
  def detect_mime_type(_path, _check_exists), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Embed a list of texts using the configured embedding model.

  Returns a 2D vector where each inner vector is the embedding for the corresponding text.
  """
  def embed_texts(_texts, _config), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Get an embedding preset by name.

  Returns `None` if no preset with the given name exists. Returns an owned
  clone so the value is safe to pass across FFI boundaries.
  """
  def get_embedding_preset(_name), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  List the names of all available embedding presets.

  Returns owned `String`s so the values are safe to pass across FFI boundaries.
  """
  def list_embedding_presets, do: :erlang.nif_error(:nif_not_loaded)
  def visitor_reply(_ref_id, _result), do: :erlang.nif_error(:nif_not_loaded)
  def complete_trait_call(_reply_id, _result_json), do: :erlang.nif_error(:nif_not_loaded)
  def fail_trait_call(_reply_id, _error_message), do: :erlang.nif_error(:nif_not_loaded)
  def register_ocr_backend(_pid, _name), do: :erlang.nif_error(:nif_not_loaded)
  def unregister_ocr_backend(_name), do: :erlang.nif_error(:nif_not_loaded)
  def register_post_processor(_pid, _name), do: :erlang.nif_error(:nif_not_loaded)
  def unregister_post_processor(_name), do: :erlang.nif_error(:nif_not_loaded)
  def register_validator(_pid, _name), do: :erlang.nif_error(:nif_not_loaded)
  def unregister_validator(_name), do: :erlang.nif_error(:nif_not_loaded)
  def register_embedding_backend(_pid, _name), do: :erlang.nif_error(:nif_not_loaded)
  def unregister_embedding_backend(_name), do: :erlang.nif_error(:nif_not_loaded)
  def register_document_extractor(_pid, _name), do: :erlang.nif_error(:nif_not_loaded)
  def unregister_document_extractor(_name), do: :erlang.nif_error(:nif_not_loaded)
  def register_renderer(_pid, _name), do: :erlang.nif_error(:nif_not_loaded)
  def unregister_renderer(_name), do: :erlang.nif_error(:nif_not_loaded)
  def contentfilterconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def extractionconfig_default, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Check if image processing is needed by examining OCR and image extraction settings.

  Returns `true` if either OCR is enabled or image extraction is configured,
  indicating that image decompression and processing should occur.
  Returns `false` if both are disabled, allowing optimization to skip unnecessary
  image decompression for text-only extraction workflows.

  # Optimization Impact
  For text-only extractions (no OCR, no image extraction), skipping image
  decompression can improve CPU utilization by 5-10% by avoiding wasteful
  image I/O and processing when results won't be used.
  """
  def extractionconfig_needs_image_processing(_obj), do: :erlang.nif_error(:nif_not_loaded)
  def imageextractionconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def tokenreductionoptions_default, do: :erlang.nif_error(:nif_not_loaded)
  def languagedetectionconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def htmloutputconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def layoutdetectionconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def ocrqualitythresholds_default, do: :erlang.nif_error(:nif_not_loaded)
  def ocrconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def pageconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def pdfconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def hierarchyconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def postprocessorconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def chunkingconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def embeddingconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def treesitterconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def treesitterprocessconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def serverconfig_default, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Get the server listen address (host:port).

  # Example

  ```rust
  use kreuzberg::core::ServerConfig;

  let config = ServerConfig::default();
  assert_eq!(config.listen_addr(), "127.0.0.1:8000");
  ```
  """
  def serverconfig_listen_addr(_obj), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Check if CORS allows all origins.

  Returns `true` if the `cors_origins` vector is empty, meaning all origins
  are allowed. Returns `false` if specific origins are configured.

  # Example

  ```rust
  use kreuzberg::core::ServerConfig;

  let mut config = ServerConfig::default();
  assert!(config.cors_allows_all());

  config.cors_origins.push("https://example.com".to_string());
  assert!(!config.cors_allows_all());
  ```
  """
  def serverconfig_cors_allows_all(_obj), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Check if a given origin is allowed by CORS configuration.

  Returns `true` if:
  - CORS allows all origins (empty origins list), or
  - The given origin is in the allowed origins list

  # Arguments

  * `origin` - The origin to check (e.g., "https://example.com")

  # Example

  ```rust
  use kreuzberg::core::ServerConfig;

  let mut config = ServerConfig::default();
  assert!(config.is_origin_allowed("https://example.com"));

  config.cors_origins.push("https://allowed.com".to_string());
  assert!(config.is_origin_allowed("https://allowed.com"));
  assert!(!config.is_origin_allowed("https://denied.com"));
  ```
  """
  def serverconfig_is_origin_allowed(_obj, _origin), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Get maximum request body size in megabytes (rounded up).

  # Example

  ```rust
  use kreuzberg::core::ServerConfig;

  let mut config = ServerConfig::default();
  assert_eq!(config.max_request_body_mb(), 100);
  ```
  """
  def serverconfig_max_request_body_mb(_obj), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Get maximum multipart field size in megabytes (rounded up).

  # Example

  ```rust
  use kreuzberg::core::ServerConfig;

  let mut config = ServerConfig::default();
  assert_eq!(config.max_multipart_field_mb(), 100);
  ```
  """
  def serverconfig_max_multipart_field_mb(_obj), do: :erlang.nif_error(:nif_not_loaded)
  def securitylimits_default, do: :erlang.nif_error(:nif_not_loaded)
  def tokenreductionconfig_default, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Compute and populate the `node_types` field from the current `nodes`.

  Call this after all nodes have been added to the structure. Internal
  construction paths (builder, derivation) call this automatically.

  # Examples

  ```rust
  use kreuzberg::types::document_structure::{DocumentStructure, DocumentNode, NodeContent, NodeId};

  let mut structure = DocumentStructure {
      nodes: vec![DocumentNode {
          id: NodeId::from("n1"),
          content: NodeContent::Paragraph { text: "Hello".into() },
          parent: None,
          children: vec![],
          content_layer: Default::default(),
          page: None,
          page_end: None,
          bbox: None,
          annotations: vec![],
          attributes: None,
      }],
      source_format: None,
      relationships: vec![],
      node_types: vec![],
  };
  structure.finalize_node_types();
  assert!(structure.node_types.contains(&"paragraph".to_string()));
  ```
  """
  def documentstructure_finalize_node_types(_obj), do: :erlang.nif_error(:nif_not_loaded)

  @doc "Check if the document structure is empty."
  def documentstructure_is_empty(_obj), do: :erlang.nif_error(:nif_not_loaded)
  def documentstructure_default, do: :erlang.nif_error(:nif_not_loaded)

  @doc "Convert from an OCR result."
  def extractionresult_from_ocr(_ocr), do: :erlang.nif_error(:nif_not_loaded)
  def imagepreprocessingconfig_default, do: :erlang.nif_error(:nif_not_loaded)
  def tesseractconfig_default, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Returns `true` when no metadata fields, format-specific metadata, or
  additional postprocessor fields are populated.
  """
  def metadata_is_empty(_obj), do: :erlang.nif_error(:nif_not_loaded)
  def diffoptions_default, do: :erlang.nif_error(:nif_not_loaded)
  def yakeparams_default, do: :erlang.nif_error(:nif_not_loaded)
  def rakeparams_default, do: :erlang.nif_error(:nif_not_loaded)
  def keywordconfig_default, do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Sets a custom cache directory for model files.

  # Arguments

  * `path` - Path to cache directory

  # Examples

  ```no_run
  use kreuzberg::PaddleOcrConfig;
  use std::path::PathBuf;

  let config = PaddleOcrConfig::new("en")
      .with_cache_dir(PathBuf::from("/tmp/paddle-cache"));
  ```
  """
  def paddleocrconfig_with_cache_dir(_obj, _path), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Enables or disables table structure detection.

  # Arguments

  * `enable` - Whether to enable table detection

  # Examples

  ```no_run
  use kreuzberg::PaddleOcrConfig;

  let config = PaddleOcrConfig::new("en")
      .with_table_detection(true);
  ```
  """
  def paddleocrconfig_with_table_detection(_obj, _enable), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Enables or disables angle classification for rotated text.

  # Arguments

  * `enable` - Whether to enable angle classification
  """
  def paddleocrconfig_with_angle_cls(_obj, _enable), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Sets the database threshold for text detection.

  # Arguments

  * `threshold` - Detection threshold (0.0-1.0)
  """
  def paddleocrconfig_with_det_db_thresh(_obj, _threshold), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Sets the box threshold for text bounding box refinement.

  # Arguments

  * `threshold` - Box threshold (0.0-1.0)
  """
  def paddleocrconfig_with_det_db_box_thresh(_obj, _threshold), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Sets the unclip ratio for expanding text bounding boxes.

  # Arguments

  * `ratio` - Unclip ratio (typically 1.5-2.0)
  """
  def paddleocrconfig_with_det_db_unclip_ratio(_obj, _ratio), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Sets the maximum side length for detection images.

  # Arguments

  * `length` - Maximum side length in pixels
  """
  def paddleocrconfig_with_det_limit_side_len(_obj, _length), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Sets the batch size for recognition inference.

  # Arguments

  * `batch_size` - Number of text regions to process simultaneously
  """
  def paddleocrconfig_with_rec_batch_num(_obj, _batch_size), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Sets the minimum recognition confidence threshold.

  # Arguments

  * `score` - Minimum confidence (0.0-1.0), text below this is dropped
  """
  def paddleocrconfig_with_drop_score(_obj, _score), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Sets padding in pixels added around images before detection.

  # Arguments

  * `padding` - Padding in pixels (0-100)
  """
  def paddleocrconfig_with_padding(_obj, _padding), do: :erlang.nif_error(:nif_not_loaded)

  @doc """
  Sets the model tier controlling detection/recognition model size.

  # Arguments

  * `tier` - `"mobile"` (default, lightweight, faster) or `"server"` (high accuracy, GPU/complex documents)
  """
  def paddleocrconfig_with_model_tier(_obj, _tier), do: :erlang.nif_error(:nif_not_loaded)

  @doc "Creates a default configuration with English language support."
  def paddleocrconfig_default, do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def acceleration_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def content_filter_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def email_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def extraction_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def file_extraction_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def batch_bytes_item_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def batch_file_item_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def image_extraction_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def token_reduction_options_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def language_detection_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def html_output_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def layout_detection_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def llm_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def structured_extraction_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def ocr_quality_thresholds_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def ocr_pipeline_stage_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def ocr_pipeline_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def ocr_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def page_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def pdf_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def hierarchy_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def post_processor_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def chunking_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def embedding_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def tree_sitter_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def tree_sitter_process_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def server_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def docx_app_properties_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def core_properties_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def security_limits_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def token_reduction_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def pdf_annotation_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def djot_content_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def formatted_block_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def inline_element_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def djot_image_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def djot_link_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def footnote_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def document_structure_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def document_relationship_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def document_node_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def table_grid_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def grid_cell_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def text_annotation_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def extraction_result_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def archive_entry_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def processing_warning_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def llm_usage_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def chunk_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def heading_context_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def heading_level_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def chunk_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def extracted_image_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def bounding_box_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def element_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def element_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def ocr_extraction_result_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def ocr_table_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def ocr_table_bounding_box_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def image_preprocessing_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def tesseract_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def image_preprocessing_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def excel_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def email_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def archive_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def image_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def xml_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def text_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def header_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def link_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def image_metadata_type_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def structured_data_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def html_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def ocr_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def error_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def pptx_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def docx_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def csv_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def bibtex_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def citation_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def year_range_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def fiction_book_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def dbf_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def dbf_field_info_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def jats_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def contributor_role_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def epub_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def pst_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def ocr_confidence_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def ocr_rotation_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def ocr_element_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def ocr_element_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def page_structure_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def page_boundary_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def page_info_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def page_content_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def layout_region_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def page_hierarchy_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def hierarchical_block_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def cell_change_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def document_revision_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def revision_delta_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def table_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def extracted_uri_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def diff_options_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def extraction_diff_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def diff_hunk_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def table_diff_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def embedded_changes_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def embedded_diff_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def embedding_preset_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def yake_params_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def rake_params_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def keyword_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def keyword_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def paddle_ocr_config_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)

  @doc false
  def pdf_metadata_from_json(_json), do: :erlang.nif_error(:nif_not_loaded)
end
