Class: Roast::Workflow::BaseStep
- Inherits:
-
Object
- Object
- Roast::Workflow::BaseStep
- Extended by:
- Forwardable
- Defined in:
- lib/roast/workflow/base_step.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#auto_loop ⇒ Object
Returns the value of attribute auto_loop.
-
#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-3-7-sonnet", name: nil, context_path: nil, auto_loop: true) ⇒ BaseStep
constructor
A new instance of BaseStep.
Constructor Details
#initialize(workflow, model: "anthropic:claude-3-7-sonnet", name: nil, context_path: nil, auto_loop: true) ⇒ BaseStep
Returns a new instance of BaseStep.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/roast/workflow/base_step.rb', line 18 def initialize(workflow, model: "anthropic:claude-3-7-sonnet", name: nil, context_path: nil, auto_loop: true) @workflow = workflow @model = model @name = name || self.class.name.underscore.split("/").last @context_path = context_path || determine_context_path @print_response = false @auto_loop = auto_loop @json = false @params = {} @resource = workflow.resource if workflow.respond_to?(:resource) end |
Instance Attribute Details
#auto_loop ⇒ Object
Returns the value of attribute auto_loop.
11 12 13 |
# File 'lib/roast/workflow/base_step.rb', line 11 def auto_loop @auto_loop end |
#context_path ⇒ Object (readonly)
Returns the value of attribute context_path.
12 13 14 |
# File 'lib/roast/workflow/base_step.rb', line 12 def context_path @context_path end |
#json ⇒ Object
Returns the value of attribute json.
11 12 13 |
# File 'lib/roast/workflow/base_step.rb', line 11 def json @json end |
#model ⇒ Object
Returns the value of attribute model.
11 12 13 |
# File 'lib/roast/workflow/base_step.rb', line 11 def model @model end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/roast/workflow/base_step.rb', line 12 def name @name end |
#params ⇒ Object
Returns the value of attribute params.
11 12 13 |
# File 'lib/roast/workflow/base_step.rb', line 11 def params @params end |
#print_response ⇒ Object
Returns the value of attribute print_response.
11 12 13 |
# File 'lib/roast/workflow/base_step.rb', line 11 def print_response @print_response end |
#resource ⇒ Object
Returns the value of attribute resource.
11 12 13 |
# File 'lib/roast/workflow/base_step.rb', line 11 def resource @resource end |
#workflow ⇒ Object (readonly)
Returns the value of attribute workflow.
12 13 14 |
# File 'lib/roast/workflow/base_step.rb', line 12 def workflow @workflow end |
Instance Method Details
#call ⇒ Object
30 31 32 33 |
# File 'lib/roast/workflow/base_step.rb', line 30 def call prompt(read_sidecar_prompt) chat_completion(print_response:, auto_loop:, json:, params:) end |