Module: Ai::OpenRouterOptions
- Defined in:
- app/services/ai/open_router_options.rb
Overview
The privacy contract for every OpenRouter call Heatwave makes.
It lives in one place because it is a data-protection control, not a tuning
knob: prompts on this gateway carry customer names, revenue and call
transcripts, and open-weight models route to third-party hosts with wildly
different retention policies. A second copy that drifts is a silent leak,
not a bug you'd notice in a test.
Enforcement does not depend on this hash. The API key carries an
account-level ZDR guardrail (doc/development/OPENROUTER.md), and the
per-request zdr flag ORs with it — it can only ADD enforcement, never
relax it. We send it anyway so the requirement is visible at the call site
and still holds if a key is ever provisioned without the guardrail.
Class Method Summary collapse
-
.provider_prefs(require_parameters: true) ⇒ Hash
The
providerblock for with_provider_options. -
.single_shot(session_id: nil) ⇒ Hash
Body extensions for a single-shot (tool-free) OpenRouter call.
Class Method Details
.provider_prefs(require_parameters: true) ⇒ Hash
Returns the provider block for with_provider_options.
26 27 28 29 30 31 32 |
# File 'app/services/ai/open_router_options.rb', line 26 def self.provider_prefs(require_parameters: true) { data_collection: 'deny', zdr: true, require_parameters: require_parameters } end |
.single_shot(session_id: nil) ⇒ Hash
Body extensions for a single-shot (tool-free) OpenRouter call.
40 41 42 |
# File 'app/services/ai/open_router_options.rb', line 40 def self.single_shot(session_id: nil) { provider: provider_prefs(require_parameters: false), session_id: session_id }.compact end |