Class: RubyLLM::MCP::Configuration::Sampling
- Inherits:
-
Object
- Object
- RubyLLM::MCP::Configuration::Sampling
- Defined in:
- lib/ruby_llm/mcp/configuration.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#handler(handler_class = nil, **options) ⇒ Object
Set or get the handler (class or block).
- #preferred_model(&block) ⇒ Object
-
#tools ⇒ Object
Returns the value of attribute tools.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
- #guard(&block) ⇒ Object
-
#initialize ⇒ Sampling
constructor
A new instance of Sampling.
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ Sampling
Returns a new instance of Sampling.
54 55 56 |
# File 'lib/ruby_llm/mcp/configuration.rb', line 54 def initialize set_defaults end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
51 52 53 |
# File 'lib/ruby_llm/mcp/configuration.rb', line 51 def context @context end |
#enabled ⇒ Object
Returns the value of attribute enabled.
51 52 53 |
# File 'lib/ruby_llm/mcp/configuration.rb', line 51 def enabled @enabled end |
#handler(handler_class = nil, **options) ⇒ Object
Set or get the handler (class or block)
76 77 78 79 80 81 82 83 84 85 |
# File 'lib/ruby_llm/mcp/configuration.rb', line 76 def handler(handler_class = nil, **) if handler_class @handler = if .any? { class: handler_class, options: } else handler_class end end @handler end |
#preferred_model(&block) ⇒ Object
67 68 69 70 |
# File 'lib/ruby_llm/mcp/configuration.rb', line 67 def preferred_model(&block) @preferred_model = block if block_given? @preferred_model end |
#tools ⇒ Object
Returns the value of attribute tools.
51 52 53 |
# File 'lib/ruby_llm/mcp/configuration.rb', line 51 def tools @tools end |
Instance Method Details
#enabled? ⇒ Boolean
87 88 89 |
# File 'lib/ruby_llm/mcp/configuration.rb', line 87 def enabled? @enabled end |
#guard(&block) ⇒ Object
62 63 64 65 |
# File 'lib/ruby_llm/mcp/configuration.rb', line 62 def guard(&block) @guard = block if block_given? @guard end |
#reset! ⇒ Object
58 59 60 |
# File 'lib/ruby_llm/mcp/configuration.rb', line 58 def reset! set_defaults end |