Class: Retab::GenerateSchemaRequest

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/schemas/generate_schema_request.rb

Constant Summary collapse

HASH_ATTRS =
{
  documents: :documents,
  model: :model,
  reasoning_effort: :reasoning_effort,
  instructions: :instructions,
  image_resolution_dpi: :image_resolution_dpi,
  stream: :stream
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ GenerateSchemaRequest

Returns a new instance of GenerateSchemaRequest.



25
26
27
28
29
30
31
32
33
# File 'lib/retab/schemas/generate_schema_request.rb', line 25

def initialize(json)
  hash = self.class.normalize(json)
  @documents = (hash[:documents] || []).map { |item| item ? Retab::MimeData.new(item) : nil }
  @model = hash[:model]
  @reasoning_effort = hash[:reasoning_effort]
  @instructions = hash[:instructions]
  @image_resolution_dpi = hash[:image_resolution_dpi]
  @stream = hash[:stream]
end

Instance Attribute Details

#documentsObject

Returns the value of attribute documents.



17
18
19
# File 'lib/retab/schemas/generate_schema_request.rb', line 17

def documents
  @documents
end

#image_resolution_dpiObject

Returns the value of attribute image_resolution_dpi.



17
18
19
# File 'lib/retab/schemas/generate_schema_request.rb', line 17

def image_resolution_dpi
  @image_resolution_dpi
end

#instructionsObject

Returns the value of attribute instructions.



17
18
19
# File 'lib/retab/schemas/generate_schema_request.rb', line 17

def instructions
  @instructions
end

#modelObject

Returns the value of attribute model.



17
18
19
# File 'lib/retab/schemas/generate_schema_request.rb', line 17

def model
  @model
end

#reasoning_effortObject

Returns the value of attribute reasoning_effort.



17
18
19
# File 'lib/retab/schemas/generate_schema_request.rb', line 17

def reasoning_effort
  @reasoning_effort
end

#streamObject

Returns the value of attribute stream.



17
18
19
# File 'lib/retab/schemas/generate_schema_request.rb', line 17

def stream
  @stream
end