Class: AgUi::Middleware::ForwardedProps
- Inherits:
-
Object
- Object
- AgUi::Middleware::ForwardedProps
- Defined in:
- lib/ag_ui/middleware/forwarded_props.rb
Overview
Exposes RunAgentInput.forwardedProps on the turn env so downstream
middleware and the terminal can honor client-driven knobs — most
importantly toolChoice ("function", function: {name}),
which the suggestions engine uses to force copilotkitSuggest.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, props: nil) ⇒ ForwardedProps
constructor
A new instance of ForwardedProps.
Constructor Details
#initialize(app, props: nil) ⇒ ForwardedProps
Returns a new instance of ForwardedProps.
13 14 15 16 |
# File 'lib/ag_ui/middleware/forwarded_props.rb', line 13 def initialize(app, props: nil) @app = app @props = props end |
Instance Method Details
#call(env) ⇒ Object
18 19 20 21 |
# File 'lib/ag_ui/middleware/forwarded_props.rb', line 18 def call(env) env[:forwarded_props] = @props @app.call(env) end |