Class: LLM::Schema::Array
Overview
The LLM::Schema::Array class represents an array value in a JSON schema. It is a subclass of LLM::Schema::Leaf and provides methods that can act as constraints.
Class Method Summary collapse
-
.[](type) ⇒ LLM::Schema::Array
Returns an array for the given type.
Instance Method Summary collapse
-
#initialize(items) ⇒ Array
constructor
A new instance of Array.
- #to_h ⇒ Object
- #to_json(options = {}) ⇒ Object
Methods inherited from Leaf
#==, #const, #default, #description, #enum, #optional, #optional?, #required, #required?
Constructor Details
#initialize(items) ⇒ Array
Returns a new instance of Array.
17 18 19 |
# File 'lib/llm/schema/array.rb', line 17 def initialize(items) @items = items end |
Class Method Details
.[](type) ⇒ LLM::Schema::Array
Returns an array for the given type
13 14 15 |
# File 'lib/llm/schema/array.rb', line 13 def self.[](type) new(type.new) end |