Class: BruteCLI::Execution::ShellCallTerminal

Inherits:
Object
  • Object
show all
Defined in:
lib/brute_cli/execution.rb

Overview

── Shell Agent Terminal ──A terminal middleware that uses Brute::Providers::Shell instead of RubyLLM::Provider.resolve. Mimics LLMCall but delegates to the Shell pseudo-provider.

Instance Method Summary collapse

Constructor Details

#initialize(shell_provider) ⇒ ShellCallTerminal

Returns a new instance of ShellCallTerminal.



264
265
266
# File 'lib/brute_cli/execution.rb', line 264

def initialize(shell_provider)
  @shell = shell_provider
end

Instance Method Details

#call(env) ⇒ Object



268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/brute_cli/execution.rb', line 268

def call(env)
  response = @shell.complete(
    env[:messages].to_a,
    model: env[:model],
    tools: env[:tools],
  )

  response.messages.each do |msg|
    env[:messages] << msg
  end

  env
end