Class: SwarmSDK::Agent::Chat::SymbolKeyHash

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/swarm_sdk/agent/chat.rb

Overview

Hash wrapper that supports both string and symbol keys

This allows tests to use tools or tools while RubyLLM internally uses string keys.

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



268
269
270
# File 'lib/swarm_sdk/agent/chat.rb', line 268

def [](key)
  __getobj__[key.to_s] || __getobj__[key.to_sym]
end

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


272
273
274
# File 'lib/swarm_sdk/agent/chat.rb', line 272

def key?(key)
  __getobj__.key?(key.to_s) || __getobj__.key?(key.to_sym)
end