Module: OmniAI::Schema
  
  
  
  
  
  
  
  
  
  
  
  
    - Defined in:
- lib/omniai/schema.rb,
 lib/omniai/schema/array.rb,
 lib/omniai/schema/format.rb,
 lib/omniai/schema/object.rb,
 lib/omniai/schema/scalar.rb
 
Overview
Defined Under Namespace
  
    
  
    
      Classes: Array, Format, Object, Scalar
    
  
  
    
      Class Method Summary
      collapse
    
    
      
        - 
  
    
      .array(items:, min_items: nil, max_items: nil, description: nil)  ⇒ OmniAI::Schema::Array 
    
    
  
  
  
  
  
  
  
  
  
    
  
- 
  
    
      .boolean(description: nil, enum: nil)  ⇒ OmniAI::Schema::Scalar 
    
    
  
  
  
  
  
  
  
  
  
    
  
- 
  
    
      .build(kind, **args)  ⇒ OmniAI::Schema::Object, ... 
    
    
  
  
  
  
  
  
  
  
  
    
  
- 
  
    
      .deserialize(data)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
  
- 
  
    
      .format(name:, schema:)  ⇒ OmniAI::Schema::Format 
    
    
  
  
  
  
  
  
  
  
  
    
  
- 
  
    
      .integer(description: nil, enum: nil)  ⇒ OmniAI::Schema::Scalar 
    
    
  
  
  
  
  
  
  
  
  
    
  
- 
  
    
      .number(description: nil, enum: nil)  ⇒ OmniAI::Schema::Scalar 
    
    
  
  
  
  
  
  
  
  
  
    
  
- 
  
    
      .object(title: nil, properties: {}, required: [], description: nil)  ⇒ OmniAI::Schema::Array 
    
    
  
  
  
  
  
  
  
  
  
    
  
- 
  
    
      .string(description: nil, enum: nil)  ⇒ OmniAI::Schema::Scalar 
    
    
  
  
  
  
  
  
  
  
  
    
  
    Class Method Details
    
      
  
  
    .array(items:, min_items: nil, max_items: nil, description: nil)  ⇒ OmniAI::Schema::Array 
  
  
  
  
    | 
85
86
87 | # File 'lib/omniai/schema.rb', line 85
def self.array(items:, min_items: nil, max_items: nil, description: nil)
  OmniAI::Schema::Array.new(items:, description:, min_items:, max_items:)
end | 
 
    
      
    
      
  
  
    | 
60
61
62
63
64
65
66
67
68
69 | # File 'lib/omniai/schema.rb', line 60
def self.build(kind, **args)
  case kind
  when :array then array(**args)
  when :object then object(**args)
  when :boolean then boolean(**args)
  when :integer then integer(**args)
  when :number then number(**args)
  when :string then string(**args)
  end
end | 
 
    
      
    
      
  
  
    | 
161
162
163 | # File 'lib/omniai/schema.rb', line 161
def self.format(name:, schema:)
  OmniAI::Schema::Format.new(name:, schema:)
end | 
 
    
      
    
      
    
      
  
  
    .object(title: nil, properties: {}, required: [], description: nil)  ⇒ OmniAI::Schema::Array 
  
  
  
  
    | 
106
107
108 | # File 'lib/omniai/schema.rb', line 106
def self.object(title: nil, properties: {}, required: [], description: nil)
  OmniAI::Schema::Object.new(title:, properties:, required:, description:)
end |