Class: Legion::CLI::Chat::Tools::GraphExplore

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

Constant Summary collapse

DEFAULT_PORT =
4567
DEFAULT_HOST =
'127.0.0.1'

Instance Method Summary collapse

Instance Method Details

#execute(action: 'topology') ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/legion/cli/chat/tools/graph_explore.rb', line 32

def execute(action: 'topology')
  case action.to_s
  when 'expertise' then format_expertise
  when 'disputed'  then format_disputed
  else format_topology
  end
rescue Errno::ECONNREFUSED
  'Apollo unavailable (daemon not running).'
rescue StandardError => e
  Legion::Logging.warn("GraphExplore#execute failed: #{e.message}") if defined?(Legion::Logging)
  "Error exploring knowledge graph: #{e.message}"
end