Skip to contents

Runs gptr's conformance suite, offline, in a scratch registry. For a spec: its fields and kind validator, schema validity, direct tool descriptions of at most 400 tokens, prompt-section budgets, empty-input handling of tools, the permission matrix for policies, start and cancel for backends, and wire-fixture replay for adapters when the adapter checker is available. For a factory function(gptr): it loads, registers something, takes no action at load, and each registered spec passes. For an installed package name: its inst/gptr/plugin.json manifest, API requirement, factory, every provided capability, and bare gptr identifiers in its code.

Usage

gptr_check(x, error = FALSE, tokens = FALSE)

Arguments

x

A spec, a factory function(gptr), or the name of an installed plugin package.

error

TRUE to signal gptr_error_conformance when a check fails.

tokens

TRUE to also report declaration costs and the printed cost of each member's examples.

Value

A gptr_check data frame with columns target, check, ok and message.

Examples

gptr_check(gptr_tool("add", "Add two numbers",
                     parameters = list(type = "object", required = I(c("a", "b")),
                                       properties = list(a = list(type = "number"),
                                                         b = list(type = "number"))),
                     fun = function(a, b) a + b, exposure = "r", namespace = "demo"))
#> <gptr_check> 4 check(s), 0 failed
#>   ok    tool:add  spec.class
#>   ok    tool:add  spec.fields
#>   ok    tool:add  tool.schema
#>   ok    tool:add  tool.empty_input: empty input fails schema validation before execute()