Class: FlowEngine::LLM::IntakePromptBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/flowengine/llm/intake_prompt_builder.rb

Overview

Builds system prompts for AI intake steps. Unlike SystemPromptBuilder (used for the definition-level introduction), this builder is aware of already-answered steps, conversation history, and instructs the LLM to optionally ask follow-up questions.

Instance Method Summary collapse

Constructor Details

#initialize(definition, answered: {}, conversation_history: []) ⇒ IntakePromptBuilder



12
13
14
15
16
# File 'lib/flowengine/llm/intake_prompt_builder.rb', line 12

def initialize(definition, answered: {}, conversation_history: [])
  @definition = definition
  @answered = answered
  @conversation_history = conversation_history
end

Instance Method Details

#build ⇒ String



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/flowengine/llm/intake_prompt_builder.rb', line 19

def build
  sections = [
    context_section,
    unanswered_steps_section,
    answered_steps_section,
    conversation_history_section,
    response_format_section
  ].compact

  sections.join("\n\n")
end