Skip to main content

generate_schema

Function generate_schema 

Source
pub fn generate_schema<T: JsonSchema>() -> Result<String, ClaudeError>
Available on crate feature structured only.
Expand description

Generates a JSON Schema string from a type implementing JsonSchema.

Use the result with ClaudeConfigBuilder::json_schema to enable structured output from the CLI.

ยงErrors

Returns ClaudeError::ParseError if schema serialization fails.