Brute
Brute::Middleware::Summarize
module Brute::Middleware class Summarize < Base endendRuns a final tool-free LLM call after the
Loop::ToolResult
completes, ensuring the agent produces a clean summary response.
This middleware sits above
Loop::ToolResult in
the stack. After the tool loop finishes (either naturally or via
MaxIterations),
Summarize injects a summary
prompt and calls the inner stack one more time with tools removed. The LLM
responds with text only, giving the agent a proper final answer.
Stack order:
use Summarizeuse Loop::ToolResultuse MaxIterationsuse ToolPipelinerun ->(env) { ... } # inline LLM call proc (see Brute.agent)Constants
DEFAULT_PROMPT
DEFAULT_PROMPT = "Provide your complete findings based on everything you've explored."Not documented.
Class Methods
self.new
new(app, prompt: DEFAULT_PROMPT)Not documented.
Instance Methods
#call
call(env)Not documented.
Defined in
lib/brute/middleware/004_summarize.rb