Document

org.llm4s.rag.loader.Document
See theDocument companion object
final case class Document(id: String, content: String, metadata: Map[String, String], hints: Option[DocumentHints], version: Option[DocumentVersion])

A document ready for RAG ingestion.

Documents represent content from any source (files, URLs, databases, APIs) in a normalized form ready for chunking and embedding.

Value parameters

content

The text content of the document

hints

Optional processing hints suggested by the loader

id

Unique identifier for this document

metadata

Key-value metadata (source, author, timestamp, etc.)

version

Optional version for change detection

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

Compute version from content if not already set

Compute version from content if not already set

Attributes

def isEmpty: Boolean

Check if document is empty

Check if document is empty

Attributes

def length: Int

Content length in characters

Content length in characters

Attributes

def nonEmpty: Boolean

Check if document is non-empty

Check if document is non-empty

Attributes

Set processing hints

Set processing hints

Attributes

def withMetadata(key: String, value: String): Document

Add metadata entry

Add metadata entry

Attributes

def withMetadata(entries: Map[String, String]): Document

Add multiple metadata entries

Add multiple metadata entries

Attributes

Set version

Set version

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product