Learn R Programming

llmhelper (version 1.0.0)

generate_json_schema: Interactive JSON Schema Generator using tidyprompt

Description

This function creates an interactive system to generate JSON schemas based on user descriptions. It supports multi-turn conversations until the user is satisfied with the generated schema.

Usage

generate_json_schema(
  description,
  llm_client,
  max_iterations = 5,
  interactive = TRUE,
  verbose = TRUE
)

Value

A list containing the final JSON schema and conversation history

Arguments

description

Initial description of the desired JSON structure

llm_client

The LLM provider object (from llm_openai or llm_ollama)

max_iterations

Maximum number of refinement iterations (default: 5)

interactive

Whether to run in interactive mode (default: TRUE)

verbose

Whether to show detailed conversation logs (default: TRUE)

Author

Zaoqu Liu; Email: liuzaoqu@163.com