foundry_consistency: Measure repeated-extraction consistency

View source: R/validation.R

foundry_consistencyR Documentation

Measure repeated-extraction consistency

Description

Run the same extraction multiple times and summarize how often each input receives the same structured result. Use batch execution externally for large jobs; this helper intentionally keeps the local loop simple.

Usage

foundry_consistency(text, schema, n = 3L, ...)

Arguments

text

Character vector of inputs.

schema

List. JSON Schema object.

n

Integer. Number of repeated extractions.

...

Additional arguments passed to foundry_extract().

Value

A tibble with one row per input.

Examples

## Not run: 
# Requires a configured Azure endpoint, credentials, and AZURE_FOUNDRY_MODEL
# naming a deployment that supports structured outputs.
schema <- foundry_schema(label = schema_enum(c("yes", "no")))
foundry_consistency(c("Example text"), schema, n = 3)

## End(Not run)

foundryR documentation built on Sept. 25, 2026, 1:10 a.m.