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



510
511
512
# File 'lib/liter_llm/native.rb', line 510

def json_schema
  @json_schema
end

Class Method Details

.from_hash(hash) ⇒ Object



526
527
528
# File 'lib/liter_llm/native.rb', line 526

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

Instance Method Details

#json_object?Boolean

Returns:

  • (Boolean)


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

def json_object? = false

#json_schema?Boolean

Returns:

  • (Boolean)


522
523
524
# File 'lib/liter_llm/native.rb', line 522

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

#text?Boolean

Returns:

  • (Boolean)


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

def text? = false