Skip to contents

One table across the kinds of module: each registered extractor, cleaner, segmenter, reader, embedder, protocol and step, with its description, the call stems it declares, its version and the contract it was registered under. Ask for one kind to add the columns only that kind has, such as a reader's signature or an extractor's extensions. The kind's own listing, such as gr_readers(), keeps its columns and adds version and contract as its last two.

Usage

hr_modules(kind = NULL)

Arguments

kind

NULL (the default) for every kind, or one kind, such as "reader". A kind the package does not know is an error of class hr_unknown_kind.

Value

A data frame with one row per module, sorted by kind in the order the kinds were registered and by name within a kind: kind, name, description, and calls, a list column of the call stems each module declares (character(0) for none). With kind, it also has a column for each other setting the kind's modules were registered with, except functions; a setting with more than one value per module, such as an extractor's extensions, is a list column. The last two columns are always version and contract (character): the module's version and the module contract it was registered under with hr_register(), NA for a module registered through its kind's own function.

Examples

m <- hr_modules()
table(m$kind)
#> 
#>   cleaner  embedder extractor  protocol    reader segmenter 
#>        15         3         7         5        14        10 

# One kind, with that kind's own columns.
r <- hr_modules("reader")
r[r$name %in% c("stuff", "retrieve"), c("name", "signature", "cost_calls")]
#>        name   signature     cost_calls
#> 11 retrieve topk|1|none 1 + embeddings
#> 14    stuff  all|1|none              1
r$calls[r$name == "refine"][[1]]
#> [1] "refine.draft"  "refine.revise" "refine.answer"