Class: Mistri::Content::Text

Inherits:
Data
  • Object
show all
Defined in:
lib/mistri/content.rb

Overview

signature carries opaque provider metadata that must round-trip, such as the OpenAI Responses message id and output phase.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text:, signature: nil) ⇒ Text

Returns a new instance of Text.



20
# File 'lib/mistri/content.rb', line 20

def initialize(text:, signature: nil) = super(text: Content.freeze_string(text), signature:)

Instance Attribute Details

#signatureObject (readonly)

Returns the value of attribute signature

Returns:

  • (Object)

    the current value of signature



19
20
21
# File 'lib/mistri/content.rb', line 19

def signature
  @signature
end

#textObject (readonly)

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



19
20
21
# File 'lib/mistri/content.rb', line 19

def text
  @text
end

Instance Method Details

#to_hObject



24
# File 'lib/mistri/content.rb', line 24

def to_h = { type: :text, text:, signature: }.compact

#typeObject



22
# File 'lib/mistri/content.rb', line 22

def type = :text