Class: Assistant::TechnicalSupport::CaseReplay::SystemPromptTurn

Inherits:
Data
  • Object
show all
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

Instance Method Summary collapse

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

#blocksObject (readonly)

Returns the value of attribute blocks

Returns:

  • (Object)

    the current value of blocks



5
6
7
# File 'app/services/assistant/technical_support/case_replay/system_prompt_turn.rb', line 5

def blocks
  @blocks
end

#turn_numberObject (readonly)

Returns the value of attribute turn_number

Returns:

  • (Object)

    the current value of 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