Class: A2UI::ActionHandler
- Inherits:
-
DSPy::Module
- Object
- DSPy::Module
- A2UI::ActionHandler
- Extended by:
- T::Sig
- Defined in:
- lib/a2ui/modules/action_handler.rb
Instance Method Summary collapse
- #forward(**input_values) ⇒ Object
-
#initialize ⇒ ActionHandler
constructor
A new instance of ActionHandler.
Constructor Details
#initialize ⇒ ActionHandler
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 |