Builder

class Builder(content: String)(source)

Java-friendly builder for DocumentWithMetadata.

Usage from Java:

DocumentWithMetadata doc = new DocumentWithMetadata.Builder("Hello world")
.metadata("author", "Alice")
.metadata("year", 2024)
.id("doc-1")
.build();

Constructors

Link copied to clipboard
constructor(content: String)

Functions

Link copied to clipboard
Link copied to clipboard

Sets the document id.

Link copied to clipboard

Replaces all metadata with the given map.

Adds a single metadata entry.