Learn R Programming

aisdk (version 1.1.0)

z_object: Create Object Schema

Description

Create a JSON Schema for object type. This is the primary schema builder for defining tool parameters.

Usage

z_object(
  ...,
  .description = NULL,
  .required = NULL,
  .additional_properties = FALSE
)

Value

A list representing JSON Schema for object.

Arguments

...

Named arguments where names are property names and values are z_schema objects created by z_* functions.

.description

Optional description of the object.

.required

Character vector of required field names. If NULL (default), all fields are considered required.

.additional_properties

Whether to allow additional properties. Default FALSE.

Examples

Run this code
z_object(
  location = z_string(description = "City name, e.g., Beijing"),
  unit = z_enum(c("celsius", "fahrenheit"), description = "Temperature unit")
)

Run the code above in your browser using DataLab