Class: OxAiWorkers::Assistant::Sysop

Inherits:
Object
  • Object
show all
Includes:
ModuleBase
Defined in:
lib/oxaiworkers/assistant/sysop.rb

Instance Attribute Summary

Attributes included from ModuleBase

#iterator

Attributes included from LoadI18n

#locale

Instance Method Summary collapse

Methods included from ModuleBase

#add_response, #execute, #init_worker, #task=

Methods included from LoadI18n

#store_locale, #with_locale

Constructor Details

#initialize(delayed: false, model: nil) ⇒ Sysop

Returns a new instance of Sysop.



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/oxaiworkers/assistant/sysop.rb', line 8

def initialize(delayed: false, model: nil)
  store_locale
  @iterator = Iterator.new(
    worker: init_worker(delayed: delayed, model: model),
    role: I18n.t('oxaiworkers.assistant.sysop.role'),
    tools: [Tool::Eval.new(only: :sh), Tool::FileSystem.new(only: %i[read_file write_to_file])],
    locale: @locale,
    on_inner_monologue: ->(text:) { puts "monologue: #{text}".colorize(:yellow) },
    on_outer_voice: ->(text:) { puts "voice: #{text}".colorize(:green) },
    on_action_request: ->(text:) { puts "action: #{text}".colorize(:red) },
    on_summarize: ->(text:) { puts "summary: #{text}".colorize(:blue) }
  )
end