Class: RubyLLM::SemanticRouter::Strategies::Semantic::InMemoryMatch

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyllm/semantic_router/strategies/semantic.rb

Overview

Wrapper for in-memory matches to provide a consistent interface

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(example, distance) ⇒ InMemoryMatch

Returns a new instance of InMemoryMatch.



179
180
181
182
# File 'lib/rubyllm/semantic_router/strategies/semantic.rb', line 179

def initialize(example, distance)
  @example = example
  @distance = distance
end

Instance Attribute Details

#distanceObject (readonly)

Returns the value of attribute distance.



177
178
179
# File 'lib/rubyllm/semantic_router/strategies/semantic.rb', line 177

def distance
  @distance
end

#exampleObject (readonly)

Returns the value of attribute example.



177
178
179
# File 'lib/rubyllm/semantic_router/strategies/semantic.rb', line 177

def example
  @example
end

Instance Method Details

#agent_nameObject



184
185
186
# File 'lib/rubyllm/semantic_router/strategies/semantic.rb', line 184

def agent_name
  example.agent_name
end

#example_textObject



188
189
190
# File 'lib/rubyllm/semantic_router/strategies/semantic.rb', line 188

def example_text
  example.example_text
end

#neighbor_distanceObject



192
193
194
# File 'lib/rubyllm/semantic_router/strategies/semantic.rb', line 192

def neighbor_distance
  distance
end