Module: Brute::Turn::Pipeline::Chainable

Included in:
Brute::Turn::Pipeline
Defined in:
lib/brute/turn/pipeline.rb

Instance Method Summary collapse

Instance Method Details

#onObject

Subscribe a lifecycle hook (see Brute::Hooks):

Brute.agent
.use(MaxProfit)
.run(->(env) { ... })
.on(:before_llm) { |env| ... }
.on(:approve_tool) { |call| call[:name] != "exec" }


31
# File 'lib/brute/turn/pipeline.rb', line 31

def on(...) = tap { hooks.on(...) }

#runObject



21
# File 'lib/brute/turn/pipeline.rb', line 21

def run(...) = tap { super }

#useObject

Enables the following syntax:

Brute.agent
.use(UltraSecurity)
.use(MaxProfit)
.use(DontTellMom)
.run -> (env) {
  your_llm_library.complete("How to make money?")
}


20
# File 'lib/brute/turn/pipeline.rb', line 20

def use(...) = tap { super }