Class: Mistri::Content::Thinking
- Inherits:
-
Data
- Object
- Data
- Mistri::Content::Thinking
- Defined in:
- lib/mistri/content.rb
Overview
A model's reasoning. signature is the opaque payload a provider needs to
replay the block on a later turn; redacted marks reasoning a safety
filter hid, leaving only the signature.
Instance Attribute Summary collapse
-
#redacted ⇒ Object
readonly
Returns the value of attribute redacted.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
-
#thinking ⇒ Object
readonly
Returns the value of attribute thinking.
Instance Method Summary collapse
-
#initialize(thinking:, signature: nil, redacted: false) ⇒ Thinking
constructor
A new instance of Thinking.
- #redacted? ⇒ Boolean
- #to_h ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(thinking:, signature: nil, redacted: false) ⇒ Thinking
Returns a new instance of Thinking.
34 35 36 37 |
# File 'lib/mistri/content.rb', line 34 def initialize(thinking:, signature: nil, redacted: false) signature = Content.freeze_string(signature) if signature.is_a?(String) super(thinking: Content.freeze_string(thinking), signature:, redacted:) end |
Instance Attribute Details
#redacted ⇒ Object (readonly)
Returns the value of attribute redacted
33 34 35 |
# File 'lib/mistri/content.rb', line 33 def redacted @redacted end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature
33 34 35 |
# File 'lib/mistri/content.rb', line 33 def signature @signature end |
#thinking ⇒ Object (readonly)
Returns the value of attribute thinking
33 34 35 |
# File 'lib/mistri/content.rb', line 33 def thinking @thinking end |
Instance Method Details
#redacted? ⇒ Boolean
41 |
# File 'lib/mistri/content.rb', line 41 def redacted? = redacted |
#to_h ⇒ Object
43 44 45 46 47 48 |
# File 'lib/mistri/content.rb', line 43 def to_h h = { type: :thinking, thinking: } h[:signature] = signature if signature h[:redacted] = true if redacted h end |
#type ⇒ Object
39 |
# File 'lib/mistri/content.rb', line 39 def type = :thinking |