Class: LiterLlm::AssistantPartText

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

Overview

A text segment of the response.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#textObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



370
371
372
# File 'lib/liter_llm/native.rb', line 370

def text
  @text
end

Class Method Details

.from_hash(hash) ⇒ Object



388
389
390
# File 'lib/liter_llm/native.rb', line 388

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

Instance Method Details

#output_audio?Boolean

Returns:

  • (Boolean)


384
385
386
# File 'lib/liter_llm/native.rb', line 384

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

#output_image?Boolean

Returns:

  • (Boolean)


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

def output_image? = false

#refusal?Boolean

Returns:

  • (Boolean)


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

def refusal? = false

#text?Boolean

Returns:

  • (Boolean)


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

def text? = true