Class: RubyLLM::MCP::Sample::Hint
- Inherits:
-
Object
- Object
- RubyLLM::MCP::Sample::Hint
- Defined in:
- lib/ruby_llm/mcp/sample.rb
Instance Attribute Summary collapse
-
#cost_priority ⇒ Object
readonly
Returns the value of attribute cost_priority.
-
#intelligence_priority ⇒ Object
readonly
Returns the value of attribute intelligence_priority.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#speed_priority ⇒ Object
readonly
Returns the value of attribute speed_priority.
Instance Method Summary collapse
- #hints ⇒ Object
-
#initialize(model, model_preferences) ⇒ Hint
constructor
A new instance of Hint.
- #to_h ⇒ Object
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_priority ⇒ Object (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_priority ⇒ Object (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 |
#model ⇒ Object (readonly)
Returns the value of attribute model.
7 8 9 |
# File 'lib/ruby_llm/mcp/sample.rb', line 7 def model @model end |
#speed_priority ⇒ Object (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
#hints ⇒ Object
19 20 21 |
# File 'lib/ruby_llm/mcp/sample.rb', line 19 def hints @hints.map { |hint| hint["name"] } end |
#to_h ⇒ Object
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 |