Class: Roast::Workflow::PromptStep

Inherits:
BaseStep
  • Object
show all
Defined in:
lib/roast/workflow/prompt_step.rb

Instance Attribute Summary

Attributes inherited from BaseStep

#available_tools, #coerce_to, #context_path, #json, #model, #name, #params, #print_response, #resource, #workflow

Instance Method Summary collapse

Constructor Details

#initialize(workflow, **kwargs) ⇒ PromptStep

Returns a new instance of PromptStep.



6
7
8
# File 'lib/roast/workflow/prompt_step.rb', line 6

def initialize(workflow, **kwargs)
  super(workflow, **kwargs)
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
# File 'lib/roast/workflow/prompt_step.rb', line 10

def call
  prompt(name)
  result = chat_completion(print_response:, json:, params:)

  # Apply coercion if configured
  apply_coercion(result)
end