Class: Assistant::TechnicalSupport::CaseReplay::SystemPromptTurn
- Inherits:
-
Data
- Object
- Data
- Assistant::TechnicalSupport::CaseReplay::SystemPromptTurn
- Defined in:
- app/services/assistant/technical_support/case_replay/system_prompt_turn.rb
Overview
Immutable fingerprint of every system-prompt block used for one replay turn.
Constant Summary collapse
- BLOCK_KEYS =
%i[position content_sha256 cache_until_here].freeze
Instance Attribute Summary collapse
-
#blocks ⇒ Object
readonly
Returns the value of attribute blocks.
-
#turn_number ⇒ Object
readonly
Returns the value of attribute turn_number.
Instance Method Summary collapse
-
#initialize(turn_number: nil, blocks: []) ⇒ SystemPromptTurn
constructor
A new instance of SystemPromptTurn.
Constructor Details
#initialize(turn_number: nil, blocks: []) ⇒ SystemPromptTurn
Returns a new instance of SystemPromptTurn.
8 9 10 11 12 13 14 |
# File 'app/services/assistant/technical_support/case_replay/system_prompt_turn.rb', line 8 def initialize(turn_number: nil, blocks: []) normalized_blocks = Array(blocks).map do |block| block.to_h.symbolize_keys.slice(*BLOCK_KEYS).freeze end.freeze super(turn_number:, blocks: normalized_blocks) end |
Instance Attribute Details
#blocks ⇒ Object (readonly)
Returns the value of attribute blocks
5 6 7 |
# File 'app/services/assistant/technical_support/case_replay/system_prompt_turn.rb', line 5 def blocks @blocks end |
#turn_number ⇒ Object (readonly)
Returns the value of attribute turn_number
5 6 7 |
# File 'app/services/assistant/technical_support/case_replay/system_prompt_turn.rb', line 5 def turn_number @turn_number end |