Class: Legion::CLI::Chat::Tools::SystemStatus

Inherits:
RubyLLM::Tool
  • Object
show all
Defined in:
lib/legion/cli/chat/tools/system_status.rb

Constant Summary collapse

DEFAULT_PORT =
4567
DEFAULT_HOST =
'127.0.0.1'

Instance Method Summary collapse

Instance Method Details

#executeObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/legion/cli/chat/tools/system_status.rb', line 25

def execute
  health = fetch_health
  ready = fetch_ready
  format_status(health, ready)
rescue Errno::ECONNREFUSED
  format('Legion daemon not running (cannot connect to API on port %d).', api_port)
rescue StandardError => e
  Legion::Logging.warn("SystemStatus#execute failed: #{e.message}") if defined?(Legion::Logging)
  "Error checking system status: #{e.message}"
end