module Riffer::Rig::Settings::ModelOptions
Constants
- MODEL_STRING
- NATIVE_TOOLS_BY_PROVIDER
-
Upstream candidate: rifferโs Anthropic, OpenAI and Azure OpenAI classes read the web_search option and OpenRouter passes unknown options through to its API, but the provider seam cannot yet answer which provider takes which option, so rig keeps the mapping until it can. Mock consumes web_search, so tests and embedders can exercise the switches.
Public Instance Methods
(String model) → Hash[Symbol, untyped]
Source
# File lib/riffer/rig/settings/model_options.rb, line 48 def model_options(model) return { cache_control: { type: :ephemeral } } if provider_for(model) == 'anthropic' {} end
@rbs model: String @rbs return: Hash[Symbol, untyped]
(String model, Hash[Symbol, untyped] switches) → Hash[Symbol, untyped]
Source
# File lib/riffer/rig/settings/model_options.rb, line 57 def native_options(model, switches) provider = provider_for(model)&.to_sym switches.filter_map do |tool, switch| # Dropped silently: a switch is an on/off setting, so what the agent can # do follows the current provider. next unless provider && NATIVE_TOOLS_BY_PROVIDER[tool]&.key?(provider) [tool, switch] end.to_h end
@rbs model: String @rbs switches: Hash[Symbol, untyped] @rbs return: Hash[Symbol, untyped]
(String model) → String?
Source
# File lib/riffer/rig/settings/model_options.rb, line 19 def provider_for(model) model[MODEL_STRING, :provider] end
@rbs model: String @rbs return: String?
(String? level) → String?
Source
# File lib/riffer/rig/settings/model_options.rb, line 34 def reasoning_level(level) level if level && Riffer::Agent::Config::REASONING_LEVELS.include?(level.to_sym) end
@rbs level: String? @rbs return: String?
(String level) → String?
Source
# File lib/riffer/rig/settings/model_options.rb, line 40 def reasoning_rejection(level) return if reasoning_level(level) "#{level} is not a reasoning level; riffer accepts: #{Riffer::Agent::Config::REASONING_LEVELS.join(' ')}" end
@rbs level: String @rbs return: String?
(String model) → String?
Source
# File lib/riffer/rig/settings/model_options.rb, line 25 def rejection(model) provider = provider_for(model) return if provider && Riffer::Providers::Repository.find(provider) "#{model} is not a provider/name model string; the provider is one of: #{Riffer::Rig::Providers.list}" end
@rbs model: String @rbs return: String?