Class: RubyLLM::Agents::ImageEditor
- Inherits:
-
Object
- Object
- RubyLLM::Agents::ImageEditor
- Extended by:
- DSL
- Includes:
- Execution
- Defined in:
- lib/ruby_llm/agents/image/editor.rb,
lib/ruby_llm/agents/image/editor/dsl.rb,
lib/ruby_llm/agents/image/editor/execution.rb
Overview
Image editor for inpainting and image editing
Allows editing specific regions of an image using a mask. The mask indicates which parts of the image should be modified. White areas in the mask are edited, black areas are preserved.
Defined Under Namespace
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#mask ⇒ Object
readonly
Returns the value of attribute mask.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
-
#tenant_id ⇒ Object
readonly
Returns the value of attribute tenant_id.
Class Method Summary collapse
-
.call(image:, mask:, prompt:, **options) ⇒ ImageEditResult
Execute image editing with the given source image, mask, and prompt.
-
.inherited(subclass) ⇒ Object
Ensure subclasses inherit DSL settings.
Instance Method Summary collapse
-
#call ⇒ ImageEditResult
Execute the image edit.
-
#initialize(image:, mask:, prompt:, **options) ⇒ ImageEditor
constructor
Initialize a new image editor instance.
Methods included from Execution
Constructor Details
#initialize(image:, mask:, prompt:, **options) ⇒ ImageEditor
Initialize a new image editor instance
75 76 77 78 79 80 81 |
# File 'lib/ruby_llm/agents/image/editor.rb', line 75 def initialize(image:, mask:, prompt:, **) @image = image @mask = mask @prompt = prompt @options = @tenant_id = nil end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
63 64 65 |
# File 'lib/ruby_llm/agents/image/editor.rb', line 63 def image @image end |
#mask ⇒ Object (readonly)
Returns the value of attribute mask.
63 64 65 |
# File 'lib/ruby_llm/agents/image/editor.rb', line 63 def mask @mask end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
63 64 65 |
# File 'lib/ruby_llm/agents/image/editor.rb', line 63 def @options end |
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
63 64 65 |
# File 'lib/ruby_llm/agents/image/editor.rb', line 63 def prompt @prompt end |
#tenant_id ⇒ Object (readonly)
Returns the value of attribute tenant_id.
63 64 65 |
# File 'lib/ruby_llm/agents/image/editor.rb', line 63 def tenant_id @tenant_id end |
Class Method Details
.call(image:, mask:, prompt:, **options) ⇒ ImageEditResult
Execute image editing with the given source image, mask, and prompt
48 49 50 |
# File 'lib/ruby_llm/agents/image/editor.rb', line 48 def call(image:, mask:, prompt:, **) new(image: image, mask: mask, prompt: prompt, **).call end |
.inherited(subclass) ⇒ Object
Ensure subclasses inherit DSL settings
53 54 55 56 57 58 59 60 |
# File 'lib/ruby_llm/agents/image/editor.rb', line 53 def inherited(subclass) super subclass.instance_variable_set(:@model, @model) subclass.instance_variable_set(:@size, @size) subclass.instance_variable_set(:@version, @version) subclass.instance_variable_set(:@description, @description) subclass.instance_variable_set(:@cache_ttl, @cache_ttl) end |
Instance Method Details
#call ⇒ ImageEditResult
Execute the image edit
86 87 88 |
# File 'lib/ruby_llm/agents/image/editor.rb', line 86 def call execute end |