Module: RubyLLM::Agents::ImageEditor::DSL

Includes:
Concerns::ImageOperationDSL
Defined in:
lib/ruby_llm/agents/image/editor/dsl.rb

Overview

DSL for configuring image editors

Provides class-level methods to configure model, size, and other image editing parameters.

Examples:

class ProductEditor < RubyLLM::Agents::ImageEditor
  model "gpt-image-1"
  size "1024x1024"
end

Instance Method Summary collapse

Methods included from Concerns::ImageOperationDSL

#cache_enabled?, #cache_for, #cache_ttl, #description, #model

Instance Method Details

#size(value = nil) ⇒ String

Set or get the output image size

Parameters:

  • value (String, nil) (defaults to: nil)

    Size (e.g., “1024x1024”)

Returns:

  • (String)

    The size to use



26
27
28
29
30
31
32
# File 'lib/ruby_llm/agents/image/editor/dsl.rb', line 26

def size(value = nil)
  if value
    @size = value
  else
    @size || inherited_or_default(:size, config.default_image_size)
  end
end