Class: OxAiWorkers::Assistant::Painter
- Inherits:
-
Object
- Object
- OxAiWorkers::Assistant::Painter
- Includes:
- ModuleBase
- Defined in:
- lib/oxaiworkers/assistant/painter.rb
Instance Attribute Summary
Attributes included from ModuleBase
#capabilities, #description, #id, #iterator, #role, #title
Attributes included from LoadI18n
Instance Method Summary collapse
-
#initialize(current_dir: nil, delayed: false, model: nil, image_model: nil) ⇒ Painter
constructor
A new instance of Painter.
Methods included from ModuleBase
#add_file, #add_image, #add_task, #execute, #init_worker, #replace_context, #run_task, #task=
Methods included from LoadI18n
Constructor Details
#initialize(current_dir: nil, delayed: false, model: nil, image_model: nil) ⇒ Painter
Returns a new instance of Painter.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/oxaiworkers/assistant/painter.rb', line 8 def initialize(current_dir: nil, delayed: false, model: nil, image_model: nil) store_locale @current_dir = current_dir with_locale do @id = 'painter' @role = I18n.t('oxaiworkers.assistant.painter.role') @description = I18n.t('oxaiworkers.assistant.painter.description') @capabilities = I18n.t('oxaiworkers.assistant.painter.capabilities').split(',').map(&:strip) @title = I18n.t('oxaiworkers.assistant.painter.title') end worker = init_worker(delayed:, model:) image_model ||= OxAiWorkers::Models::OpenaiDalle3.new @iterator = Iterator.new( worker:, role: @role, tools: [Tool::Pixels.new(worker: image_model, current_dir:)], locale: @locale, on_inner_monologue: ->(text:) { puts "monologue: #{text}".colorize(:yellow) }, on_outer_voice: ->(text:) { puts "voice: #{text}".colorize(:green) } ) end |