Anthropic::OutputSchema
Inherits Anthropic::BaseOutputSchema < Reference < Object
Output schema for structured outputs
Defines the expected structure of Claude's response using JSON Schema. When provided, Claude will output JSON matching the schema.
output_schema = OutputSchema.new(
name: "analysis_result",
schema: {
"summary" => Schema.string("Brief summary"),
"score" => Schema.number("Confidence score", minimum: 0.0, maximum: 1.0),
"tags" => Schema.array(Schema.string, description: "Relevant tags"),
},
required: ["summary", "score"]
)
Constructors
Instance methods
description
Sourcename
Sourcerequired
Sourceschema
Source