Skip to contents

Constructs an S7 object representing a text document with metadata.

Usage

document(text, metadata = list(), id = NULL)

Arguments

text

Character string of document content.

metadata

Named list of arbitrary metadata.

id

Optional document identifier. Generated if NULL.

Value

A securecontext_document object.

Examples

doc <- document("Hello world", metadata = list(source = "test"))
doc
#> <securecontext::securecontext_document>
#>  @ text    : chr "Hello world"
#>  @ metadata:List of 1
#>  .. $ source: chr "test"
#>  @ id      : chr "doc_20260310163649_ec1d6ada"