Module: ActiveAgent::Callbacks::ClassMethods

Defined in:
lib/active_agent/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#after_generate(*filters) ⇒ Object

Defines a callback that will get called right after the prompt’s generation method is finished.



21
22
23
# File 'lib/active_agent/callbacks.rb', line 21

def after_generate(*filters, &)
  set_callback(:generate, :after, *filters, &)
end

#around_generate(*filters) ⇒ Object

Defines a callback that will get called around the prompt’s generation method.



26
27
28
# File 'lib/active_agent/callbacks.rb', line 26

def around_generate(*filters, &)
  set_callback(:generate, :around, *filters, &)
end

#before_generate(*filters) ⇒ Object

Defines a callback that will get called right before the prompt is sent to the generation provider method.



15
16
17
# File 'lib/active_agent/callbacks.rb', line 15

def before_generate(*filters, &)
  set_callback(:generate, :before, *filters, &)
end