ChunkMetadata

org.llm4s.chunking.ChunkMetadata
See theChunkMetadata companion object
final case class ChunkMetadata(sourceFile: Option[String], startOffset: Option[Int], endOffset: Option[Int], headings: Seq[String], isCodeBlock: Boolean, language: Option[String])

Metadata about a chunk's origin and structure.

Value parameters

endOffset

End character offset

headings

Heading hierarchy (e.g., Seq("Chapter 1", "Section 2"))

isCodeBlock

Whether chunk is from a code block

language

Code language if applicable

sourceFile

Original file name

startOffset

Character offset in source

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def asCodeBlock(lang: Option[String]): ChunkMetadata

Mark as a code block.

Mark as a code block.

Attributes

def withHeading(heading: String): ChunkMetadata

Add a heading to the hierarchy.

Add a heading to the hierarchy.

Attributes

def withOffsets(start: Int, end: Int): ChunkMetadata

Set the character offsets.

Set the character offsets.

Attributes

def withSource(file: String): ChunkMetadata

Set the source file.

Set the source file.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product