Class: A2UI::ActionHandler

Inherits:
DSPy::Module
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/a2ui/modules/action_handler.rb

Instance Method Summary collapse

Constructor Details

#initializeActionHandler

Returns a new instance of ActionHandler.



9
10
11
12
# File 'lib/a2ui/modules/action_handler.rb', line 9

def initialize
  super
  @predictor = DSPy::ChainOfThought.new(HandleAction)
end

Instance Method Details

#forward(**input_values) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/a2ui/modules/action_handler.rb', line 17

def forward(**input_values)
  @predictor.call(
    action: input_values.fetch(:action),
    current_data: input_values.fetch(:current_data, '{}'),
    business_rules: input_values.fetch(:business_rules, '')
  )
end