Class: Roast::Workflow::BaseStep
- Inherits:
-
Object
- Object
- Roast::Workflow::BaseStep
- Defined in:
- lib/roast/workflow/base_step.rb
Direct Known Subclasses
AgentStep, BaseIterationStep, CaseStep, ConditionalStep, InputStep, PromptStep, ShellScriptStep
Instance Attribute Summary collapse
-
#available_tools ⇒ Object
Returns the value of attribute available_tools.
-
#coerce_to ⇒ Object
Returns the value of attribute coerce_to.
-
#context_path ⇒ Object
readonly
Returns the value of attribute context_path.
-
#json ⇒ Object
Returns the value of attribute json.
-
#model ⇒ Object
Returns the value of attribute model.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
Returns the value of attribute params.
-
#print_response ⇒ Object
Returns the value of attribute print_response.
-
#resource ⇒ Object
Returns the value of attribute resource.
-
#workflow ⇒ Object
readonly
Returns the value of attribute workflow.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(workflow, model: "anthropic:claude-opus-4", name: nil, context_path: nil) ⇒ BaseStep
constructor
TODO: is this really the model we want to default to, and is this the right place to set it?.
Constructor Details
#initialize(workflow, model: "anthropic:claude-opus-4", name: nil, context_path: nil) ⇒ BaseStep
TODO: is this really the model we want to default to, and is this the right place to set it?
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/roast/workflow/base_step.rb', line 13 def initialize(workflow, model: "anthropic:claude-opus-4", name: nil, context_path: nil) @workflow = workflow @model = model @name = normalize_name(name) @context_path = context_path || ContextPathResolver.resolve(self.class) @print_response = false @json = false @params = {} @coerce_to = nil @available_tools = nil @resource = workflow.resource if workflow.respond_to?(:resource) end |
Instance Attribute Details
#available_tools ⇒ Object
Returns the value of attribute available_tools.
6 7 8 |
# File 'lib/roast/workflow/base_step.rb', line 6 def available_tools @available_tools end |
#coerce_to ⇒ Object
Returns the value of attribute coerce_to.
6 7 8 |
# File 'lib/roast/workflow/base_step.rb', line 6 def coerce_to @coerce_to end |
#context_path ⇒ Object (readonly)
Returns the value of attribute context_path.
7 8 9 |
# File 'lib/roast/workflow/base_step.rb', line 7 def context_path @context_path end |
#json ⇒ Object
Returns the value of attribute json.
6 7 8 |
# File 'lib/roast/workflow/base_step.rb', line 6 def json @json end |
#model ⇒ Object
Returns the value of attribute model.
6 7 8 |
# File 'lib/roast/workflow/base_step.rb', line 6 def model @model end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/roast/workflow/base_step.rb', line 7 def name @name end |
#params ⇒ Object
Returns the value of attribute params.
6 7 8 |
# File 'lib/roast/workflow/base_step.rb', line 6 def params @params end |
#print_response ⇒ Object
Returns the value of attribute print_response.
6 7 8 |
# File 'lib/roast/workflow/base_step.rb', line 6 def print_response @print_response end |
#resource ⇒ Object
Returns the value of attribute resource.
6 7 8 |
# File 'lib/roast/workflow/base_step.rb', line 6 def resource @resource end |
#workflow ⇒ Object (readonly)
Returns the value of attribute workflow.
7 8 9 |
# File 'lib/roast/workflow/base_step.rb', line 7 def workflow @workflow end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/roast/workflow/base_step.rb', line 26 def call prompt(read_sidecar_prompt) result = chat_completion(print_response:, json:, params:, available_tools:) # Apply coercion if configured apply_coercion(result) end |