Class: A2UI::LayoutAdapter

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

Instance Method Summary collapse

Constructor Details

#initializeLayoutAdapter

Returns a new instance of LayoutAdapter.



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

def initialize
  super
  @predictor = DSPy::Predict.new(AdaptLayout)
end

Instance Method Details

#forward(**input_values) ⇒ Object



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

def forward(**input_values)
  @predictor.call(
    components: input_values.fetch(:components),
    root_id: input_values.fetch(:root_id),
    screen: input_values.fetch(:screen)
  )
end