Class: LLM::Schema::AnyOf
Overview
The LLM::Schema::AnyOf class represents an anyOf union in a JSON schema. It is a subclass of LLM::Schema::Leaf.
Class Method Summary collapse
-
.[](*types) ⇒
LLM::Schema::AnyOf
Returns an anyOf union for the given types.
Instance Method Summary collapse
- #initialize(values) ⇒ LLM::Schema::AnyOf constructor
- #to_h ⇒ Hash
Methods inherited from Leaf
#==, #const, #default, #description, #enum, #optional, #optional?, #required, #required?, #to_json
Constructor Details
#initialize(values) ⇒ LLM::Schema::AnyOf
21 22 23 |
# File 'lib/llm/schema/any_of.rb', line 21 def initialize(values) @values = values end |
Class Method Details
Instance Method Details
#to_h ⇒ Hash
27 28 29 |
# File 'lib/llm/schema/any_of.rb', line 27 def to_h super.merge!(anyOf: @values) end |