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.
31 32 33 |
# File 'lib/mistri/content.rb', line 31 def initialize(thinking:, signature: nil, redacted: false) super(thinking: Content.freeze_string(thinking), signature:, redacted:) end |
Instance Attribute Details
#redacted ⇒ Object (readonly)
Returns the value of attribute redacted
30 31 32 |
# File 'lib/mistri/content.rb', line 30 def redacted @redacted end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature
30 31 32 |
# File 'lib/mistri/content.rb', line 30 def signature @signature end |
#thinking ⇒ Object (readonly)
Returns the value of attribute thinking
30 31 32 |
# File 'lib/mistri/content.rb', line 30 def thinking @thinking end |
Instance Method Details
#redacted? ⇒ Boolean
37 |
# File 'lib/mistri/content.rb', line 37 def redacted? = redacted |
#to_h ⇒ Object
39 40 41 42 43 44 |
# File 'lib/mistri/content.rb', line 39 def to_h h = { type: :thinking, thinking: } h[:signature] = signature if signature h[:redacted] = true if redacted h end |
#type ⇒ Object
35 |
# File 'lib/mistri/content.rb', line 35 def type = :thinking |