Class: LiterLlm::ResponseFormatJsonSchema

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
ResponseFormat
Defined in:
lib/liter_llm/native.rb

Overview

Output must conform to the specified JSON schema.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#json_schemaObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



537
538
539
# File 'lib/liter_llm/native.rb', line 537

def json_schema
  @json_schema
end

Class Method Details

.from_hash(hash) ⇒ Object



553
554
555
# File 'lib/liter_llm/native.rb', line 553

def self.from_hash(hash)
  new(json_schema: hash[:json_schema] || hash["json_schema"])
end

Instance Method Details

#json_object?Boolean

Returns:

  • (Boolean)


547
# File 'lib/liter_llm/native.rb', line 547

def json_object? = false

#json_schema?Boolean

Returns:

  • (Boolean)


549
550
551
# File 'lib/liter_llm/native.rb', line 549

def json_schema? = true
# @param hash [Hash] deserialized from the native extension
# @return [self]

#text?Boolean

Returns:

  • (Boolean)


545
# File 'lib/liter_llm/native.rb', line 545

def text? = false