Class: RubyLLM::MCP::Sample::Hint

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/mcp/sample.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, model_preferences) ⇒ Hint

Returns a new instance of Hint.



9
10
11
12
13
14
15
16
17
# File 'lib/ruby_llm/mcp/sample.rb', line 9

def initialize(model, model_preferences)
  @model = model
  @model_preferences = model_preferences

  @hints = model_preferences&.fetch("hints", [])
  @cost_priority = model_preferences&.fetch("costPriority", nil)
  @speed_priority = model_preferences&.fetch("speedPriority", nil)
  @intelligence_priority = model_preferences&.fetch("intelligencePriority", nil)
end

Instance Attribute Details

#cost_priorityObject (readonly)

Returns the value of attribute cost_priority.



7
8
9
# File 'lib/ruby_llm/mcp/sample.rb', line 7

def cost_priority
  @cost_priority
end

#intelligence_priorityObject (readonly)

Returns the value of attribute intelligence_priority.



7
8
9
# File 'lib/ruby_llm/mcp/sample.rb', line 7

def intelligence_priority
  @intelligence_priority
end

#modelObject (readonly)

Returns the value of attribute model.



7
8
9
# File 'lib/ruby_llm/mcp/sample.rb', line 7

def model
  @model
end

#speed_priorityObject (readonly)

Returns the value of attribute speed_priority.



7
8
9
# File 'lib/ruby_llm/mcp/sample.rb', line 7

def speed_priority
  @speed_priority
end

Instance Method Details

#hintsObject



19
20
21
# File 'lib/ruby_llm/mcp/sample.rb', line 19

def hints
  @hints.map { |hint| hint["name"] }
end

#to_hObject



23
24
25
26
27
28
29
30
31
# File 'lib/ruby_llm/mcp/sample.rb', line 23

def to_h
  {
    model: model,
    hints: hints,
    cost_priority: @cost_priority,
    speed_priority: @speed_priority,
    intelligence_priority: @intelligence_priority
  }
end