Module: OxAiWorkers::Assistant::ModuleBase

Includes:
LoadI18n
Included in:
Coder, Localizer, Sysop
Defined in:
lib/oxaiworkers/assistant/module_base.rb

Instance Attribute Summary collapse

Attributes included from LoadI18n

#locale

Instance Method Summary collapse

Methods included from LoadI18n

#store_locale, #with_locale

Instance Attribute Details

#iteratorObject

Returns the value of attribute iterator.



8
9
10
# File 'lib/oxaiworkers/assistant/module_base.rb', line 8

def iterator
  @iterator
end

Instance Method Details

#add_response(text) ⇒ Object



15
16
17
# File 'lib/oxaiworkers/assistant/module_base.rb', line 15

def add_response(text)
  @iterator.add_task text
end

#executeObject



19
20
21
# File 'lib/oxaiworkers/assistant/module_base.rb', line 19

def execute
  @iterator.execute
end

#init_worker(delayed: false, model: nil) ⇒ Object



23
24
25
26
27
# File 'lib/oxaiworkers/assistant/module_base.rb', line 23

def init_worker(delayed: false, model: nil)
  worker = delayed ? DelayedRequest.new : Request.new
  worker.model = model || OxAiWorkers.configuration.model
  worker
end

#task=(task) ⇒ Object



10
11
12
13
# File 'lib/oxaiworkers/assistant/module_base.rb', line 10

def task=(task)
  @iterator.cleanup
  @iterator.add_task task
end