Class: ActiveAgent::Providers::OpenRouter::Requests::ProviderPreferences
- Inherits:
-
Common::BaseModel
- Object
- Common::BaseModel
- ActiveAgent::Providers::OpenRouter::Requests::ProviderPreferences
- Defined in:
- lib/active_agent/providers/open_router/requests/provider_preferences.rb
Overview
Provider preferences for routing requests to specific providers
Controls how OpenRouter selects and routes requests to underlying model providers. Enables filtering by parameters, cost constraints, privacy settings, and provider-specific preferences.
Instance Attribute Summary collapse
-
#allow_fallbacks ⇒ Boolean?
Whether to allow backup providers when primary is unavailable - true: (default) use next best provider when primary unavailable - false: only use primary/custom provider, return error if unavailable.
-
#data_collection ⇒ String?
Data collection preference - ‘allow’: (default) allow providers which store/train on user data - ‘deny’: only use providers that don’t collect user data.
-
#ignore ⇒ Array<String>
Blocklist of provider slugs (merged with account settings).
-
#max_price ⇒ MaxPrice?
Maximum price constraints per token/operation.
-
#only ⇒ Array<String>
Allowlist of provider slugs (merged with account settings).
-
#order ⇒ Array<String>
Ordered list of provider slugs to try in sequence.
-
#quantizations ⇒ Array<String>
Quantization levels to filter providers by Options: int4, int8, fp4, fp6, fp8, fp16, bf16, fp32, unknown.
-
#require_parameters ⇒ Boolean?
Whether to filter to providers supporting all parameters - true: only use providers that support all provided parameters - false: providers receive only the parameters they support.
-
#sort ⇒ String?
Sorting strategy when order not specified Options: price, throughput, latency Note: disables load balancing when set.
-
#zdr ⇒ Boolean?
Zero data retention mode (stricter privacy).
Method Summary
Methods inherited from Common::BaseModel
#<=>, #==, attribute, #deep_compact, #deep_dup, delegate_attributes, drop_attributes, inherited, #initialize, #inspect, keys, #merge!, required_attributes, #serialize, #to_h, #to_hash
Constructor Details
This class inherits a constructor from ActiveAgent::Providers::Common::BaseModel
Instance Attribute Details
#allow_fallbacks ⇒ Boolean?
Returns whether to allow backup providers when primary is unavailable
-
true: (default) use next best provider when primary unavailable
-
false: only use primary/custom provider, return error if unavailable.
46 |
# File 'lib/active_agent/providers/open_router/requests/provider_preferences.rb', line 46 attribute :allow_fallbacks, :boolean |
#data_collection ⇒ String?
Returns data collection preference
-
‘allow’: (default) allow providers which store/train on user data
-
‘deny’: only use providers that don’t collect user data.
58 |
# File 'lib/active_agent/providers/open_router/requests/provider_preferences.rb', line 58 attribute :data_collection, :string |
#ignore ⇒ Array<String>
Returns blocklist of provider slugs (merged with account settings).
74 |
# File 'lib/active_agent/providers/open_router/requests/provider_preferences.rb', line 74 attribute :ignore, default: -> { [] } |
#max_price ⇒ MaxPrice?
Returns maximum price constraints per token/operation.
89 |
# File 'lib/active_agent/providers/open_router/requests/provider_preferences.rb', line 89 attribute :max_price, MaxPriceType.new |
#only ⇒ Array<String>
Returns allowlist of provider slugs (merged with account settings).
70 |
# File 'lib/active_agent/providers/open_router/requests/provider_preferences.rb', line 70 attribute :only, default: -> { [] } |
#order ⇒ Array<String>
Returns ordered list of provider slugs to try in sequence.
66 |
# File 'lib/active_agent/providers/open_router/requests/provider_preferences.rb', line 66 attribute :order, default: -> { [] } |
#quantizations ⇒ Array<String>
Returns quantization levels to filter providers by Options: int4, int8, fp4, fp6, fp8, fp16, bf16, fp32, unknown.
79 |
# File 'lib/active_agent/providers/open_router/requests/provider_preferences.rb', line 79 attribute :quantizations, default: -> { [] } |
#require_parameters ⇒ Boolean?
Returns whether to filter to providers supporting all parameters
-
true: only use providers that support all provided parameters
-
false: providers receive only the parameters they support.
52 |
# File 'lib/active_agent/providers/open_router/requests/provider_preferences.rb', line 52 attribute :require_parameters, :boolean |
#sort ⇒ String?
Returns sorting strategy when order not specified Options: price, throughput, latency Note: disables load balancing when set.
85 |
# File 'lib/active_agent/providers/open_router/requests/provider_preferences.rb', line 85 attribute :sort, :string |
#zdr ⇒ Boolean?
Returns zero data retention mode (stricter privacy).
62 |
# File 'lib/active_agent/providers/open_router/requests/provider_preferences.rb', line 62 attribute :zdr, :boolean |