Class: RubyLLM::Toolbox::Sandbox::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/toolbox/sandbox/base.rb

Overview

Shared behavior for every backend.

Direct Known Subclasses

Bubblewrap, Docker, Null, SandboxExec

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Base

Returns a new instance of Base.



69
70
71
# File 'lib/ruby_llm/toolbox/sandbox/base.rb', line 69

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



73
74
75
# File 'lib/ruby_llm/toolbox/sandbox/base.rb', line 73

def config
  @config
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/ruby_llm/toolbox/sandbox/base.rb', line 79

def available?
  false
end

#command(_argv, image: nil) ⇒ Object

Raises:

  • (NotImplementedError)


87
88
89
# File 'lib/ruby_llm/toolbox/sandbox/base.rb', line 87

def command(_argv, image: nil)
  raise NotImplementedError
end

#nameObject



75
76
77
# File 'lib/ruby_llm/toolbox/sandbox/base.rb', line 75

def name
  self.class.name.split("::").last.downcase
end

#run(_argv, stdin: nil, image: nil) ⇒ Object

Raises:

  • (NotImplementedError)


83
84
85
# File 'lib/ruby_llm/toolbox/sandbox/base.rb', line 83

def run(_argv, stdin: nil, image: nil)
  raise NotImplementedError
end