Class: Kreuzberg::Element

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/kreuzberg/types.rb

Overview

Semantic element extracted from document.

Represents a logical unit of content with semantic classification, unique identifier, and metadata for tracking origin and position. Compatible with Unstructured.io element format when output_format=‘element_based’.

Examples:

element = Kreuzberg::Element.new(
  element_id: "elem-abc123",
  element_type: "narrative_text",
  text: "This is the main content.",
  metadata: 
)
puts "#{element.element_type}: #{element.text}"