Class: Brute::Turn::Pipeline
- Inherits:
-
Rack::Builder
- Object
- Rack::Builder
- Brute::Turn::Pipeline
- Includes:
- Chainable
- Defined in:
- lib/brute/turn/pipeline.rb
Direct Known Subclasses
Defined Under Namespace
Modules: Chainable Classes: NullSink
Constant Summary
Constants included from Hooks
Hooks::AFTER_LLM_EVENT, Hooks::AFTER_TOOL_EVENT, Hooks::APPROVE_TOOL_EVENT, Hooks::BEFORE_LLM_EVENT, Hooks::BEFORE_TOOL_EVENT, Hooks::COMPACTED_EVENT, Hooks::COMPACT_DURATION_EVENT, Hooks::DURATION_EVENT, Hooks::ENTER_EVENT, Hooks::EXIT_EVENT, Hooks::FARADAY_ERROR_EVENT, Hooks::LLM_DURATION_EVENT, Hooks::LLM_FAILURE_EVENT, Hooks::MIDDLEWARE_ADDED_EVENT, Hooks::OPEN_ROUTER_SERVER_ERROR_EVENT, Hooks::STANDARD_ERROR_EVENT, Hooks::TOOL_DURATION_EVENT, Hooks::TURN_DURATION_EVENT, Hooks::TURN_END_EVENT, Hooks::TURN_START_EVENT
Class Method Summary collapse
-
.new_from_string(builder_script, path = "(rackup)", **options) ⇒ Object
Rack's
new_from_stringevaluates the script then returnsto_app— the built callable.
Instance Method Summary collapse
-
#hooks ⇒ Object
The lifecycle-hook registry for this pipeline (see Brute::Hooks).
Methods included from Chainable
Methods included from Hooks
Class Method Details
.new_from_string(builder_script, path = "(rackup)", **options) ⇒ Object
Rack's new_from_string evaluates the script then returns to_app —
the built callable. An agent, though, is the builder: you .start it,
and it may be re-used or served through the Rack adapter. So evaluate
the script against a fresh builder and hand back the builder itself.
This also backs parse_file (→ load_file → here), so
AgentPipeline.parse_file("agent.ru").start(prompt) works as documented.
109 110 111 112 113 |
# File 'lib/brute/turn/pipeline.rb', line 109 def self.new_from_string(builder_script, path = "(rackup)", **) builder = new(**) eval(builder_script, ::Rack::BUILDER_TOPLEVEL_BINDING.call(builder), path) # rubocop:disable Security/Eval builder end |