Class: FlowEngine::ClarificationResult

Inherits:
Data
  • Object
show all
Defined in:
lib/flowengine/clarification_result.rb

Overview

Immutable result from an AI intake or clarification round.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(answered: {}, pending_steps: [], follow_up: nil, round: 1) ⇒ ClarificationResult

Returns a new instance of ClarificationResult.



11
12
13
14
# File 'lib/flowengine/clarification_result.rb', line 11

def initialize(answered: {}, pending_steps: [], follow_up: nil, round: 1)
  super
  freeze
end

Instance Attribute Details

#answered ⇒ Hash<Symbol, Object> (readonly)

step_id => value pairs filled this round

Returns:

  • (Hash<Symbol, Object>) —

    the current value of answered



10
11
12
# File 'lib/flowengine/clarification_result.rb', line 10

def answered
  @answered
end

#follow_up ⇒ String? (readonly)

clarifying question from the LLM, or nil if done

Returns:

  • (String, nil) —

    the current value of follow_up



10
11
12
# File 'lib/flowengine/clarification_result.rb', line 10

def follow_up
  @follow_up
end

#pending_steps ⇒ Array<Symbol> (readonly)

step ids still unanswered after this round

Returns:

  • (Array<Symbol>) —

    the current value of pending_steps



10
11
12
# File 'lib/flowengine/clarification_result.rb', line 10

def pending_steps
  @pending_steps
end

#round ⇒ Integer (readonly)

current clarification round (1-based)

Returns:

  • (Integer) —

    the current value of round



10
11
12
# File 'lib/flowengine/clarification_result.rb', line 10

def round
  @round
end

Instance Method Details

#done? ⇒ Boolean

Returns true when the LLM has no more questions or max rounds reached.

Returns:

  • (Boolean) —

    true when the LLM has no more questions or max rounds reached



17
18
19
# File 'lib/flowengine/clarification_result.rb', line 17

def done?
  follow_up.nil?
end