Class: RubyLLM::Agents::ImagePipeline
- Inherits:
-
Object
- Object
- RubyLLM::Agents::ImagePipeline
- Extended by:
- DSL
- Includes:
- Execution
- Defined in:
- lib/ruby_llm/agents/image/pipeline.rb,
lib/ruby_llm/agents/image/pipeline/dsl.rb,
lib/ruby_llm/agents/image/pipeline/execution.rb
Overview
Image pipeline for chaining multiple image operations
Orchestrates complex image workflows by chaining generators, transformers, upscalers, analyzers, and other image operations into a single pipeline with aggregated results and costs.
Defined Under Namespace
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#step_results ⇒ Object
readonly
Returns the value of attribute step_results.
-
#tenant_id ⇒ Object
readonly
Returns the value of attribute tenant_id.
Class Method Summary collapse
-
.call(**options) ⇒ ImagePipelineResult
Execute pipeline with the given options.
-
.inherited(subclass) ⇒ Object
Ensure subclasses inherit DSL settings and steps.
Instance Method Summary collapse
-
#call ⇒ ImagePipelineResult
Execute the pipeline.
-
#initialize(**options) ⇒ ImagePipeline
constructor
Initialize a new pipeline instance.
Constructor Details
#initialize(**options) ⇒ ImagePipeline
Initialize a new pipeline instance
82 83 84 85 86 87 |
# File 'lib/ruby_llm/agents/image/pipeline.rb', line 82 def initialize(**) @options = @tenant_id = nil @step_results = [] @context = .dup end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
74 75 76 |
# File 'lib/ruby_llm/agents/image/pipeline.rb', line 74 def context @context end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
74 75 76 |
# File 'lib/ruby_llm/agents/image/pipeline.rb', line 74 def @options end |
#step_results ⇒ Object (readonly)
Returns the value of attribute step_results.
74 75 76 |
# File 'lib/ruby_llm/agents/image/pipeline.rb', line 74 def step_results @step_results end |
#tenant_id ⇒ Object (readonly)
Returns the value of attribute tenant_id.
74 75 76 |
# File 'lib/ruby_llm/agents/image/pipeline.rb', line 74 def tenant_id @tenant_id end |
Class Method Details
.call(**options) ⇒ ImagePipelineResult
Execute pipeline with the given options
57 58 59 |
# File 'lib/ruby_llm/agents/image/pipeline.rb', line 57 def call(**) new(**).call end |
.inherited(subclass) ⇒ Object
Ensure subclasses inherit DSL settings and steps
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/ruby_llm/agents/image/pipeline.rb', line 62 def inherited(subclass) super # Copy steps to subclass subclass.instance_variable_set(:@steps, @steps&.dup || []) subclass.instance_variable_set(:@callbacks, @callbacks&.dup || {before: [], after: []}) subclass.instance_variable_set(:@version, @version) subclass.instance_variable_set(:@description, @description) subclass.instance_variable_set(:@cache_ttl, @cache_ttl) subclass.instance_variable_set(:@stop_on_error, @stop_on_error) end |
Instance Method Details
#call ⇒ ImagePipelineResult
Execute the pipeline
92 93 94 |
# File 'lib/ruby_llm/agents/image/pipeline.rb', line 92 def call execute end |