Class: Rixie::Context::Plan
- Inherits:
-
Object
- Object
- Rixie::Context::Plan
- Defined in:
- lib/rixie/context/plan.rb
Instance Method Summary collapse
-
#initialize(steps:, current_step:) ⇒ Plan
constructor
A new instance of Plan.
- #to_message ⇒ Object
Constructor Details
#initialize(steps:, current_step:) ⇒ Plan
Returns a new instance of Plan.
6 7 8 9 |
# File 'lib/rixie/context/plan.rb', line 6 def initialize(steps:, current_step:) @steps = steps @current_step = current_step end |
Instance Method Details
#to_message ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rixie/context/plan.rb', line 11 def numbered = @steps.each_with_index.map { |s, i| "#{i + 1}. #{s[:title]}" }.join("\n") content = <<~PROMPT You are executing one step of a multi-step plan. Your output for this step will be combined with the outputs of other steps into a single response. Full plan: #{numbered} Current step: #{@current_step[:title]} #{@current_step[:description]} Output instructions: - Produce only the content for this step. Do not summarize other steps. - Do not add closing remarks, transition sentences, or offers to elaborate (e.g. "Feel free to ask if you want more details"). - Write as if the reader will continue reading the next step's output immediately after. PROMPT [Message::System.new(content: content)] end |