if (FALSE) {
# Example using different field types
address_schema <- tidyllm_schema(
name = "AddressSchema",
Street = field_chr("A common street name"),
house_number = field_dbl(),
City = field_chr("Name of a city"),
State = field_fct("State abbreviation", .levels = c("CA", "TX", "Other")),
Country = "string",
PostalCode = "string"
)
llm_message("Imagine an address") |> chat(openai, .json_schema = address_schema)
# Example with vector field
tidyllm_schema(
plz = field_dbl(.vector = TRUE)
)
}
Run the code above in your browser using DataLab