Class: A2UI::InputParser
- Inherits:
-
DSPy::Module
- Object
- DSPy::Module
- A2UI::InputParser
- Extended by:
- T::Sig
- Defined in:
- lib/a2ui/modules/input_parser.rb
Instance Method Summary collapse
- #forward(**input_values) ⇒ Object
-
#initialize ⇒ InputParser
constructor
A new instance of InputParser.
Constructor Details
#initialize ⇒ InputParser
Returns a new instance of InputParser.
9 10 11 12 |
# File 'lib/a2ui/modules/input_parser.rb', line 9 def initialize super @predictor = DSPy::Predict.new(ParseInput) end |
Instance Method Details
#forward(**input_values) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/a2ui/modules/input_parser.rb', line 17 def forward(**input_values) @predictor.call( text: input_values.fetch(:text), target_path: input_values.fetch(:target_path), expected_schema: input_values.fetch(:expected_schema, '') ) end |