@@ -29,12 +29,9 @@ def generate(prompt)
2929
3030 def namespace = OpenRouter
3131
32+ # OpenAI + OpenRouter
3233 def build_provider_parameters
33- # Start with base OpenAI parameters
34- params = super
35-
36- # Add OpenRouter-specific parameters
37- add_openrouter_params ( params )
34+ super . merge ( options . chat_parameters )
3835 end
3936
4037 def format_content_item ( item )
@@ -82,37 +79,6 @@ def build_provider_preferences
8279 end
8380 end
8481
85- def add_openrouter_params ( params )
86- # Add OpenRouter-specific routing parameters
87- if @fallback_models . present?
88- params [ :models ] = @fallback_models
89- params [ :route ] = @route
90- end
91-
92- # Add transforms
93- params [ :transforms ] = @transforms if @transforms . present?
94-
95- # Add provider configuration (always include if we have data_collection or other settings)
96- # Check both configured and runtime data_collection/require_parameters values
97- runtime_data_collection = prompt &.options &.key? ( :data_collection )
98- runtime_require_parameters = prompt &.options &.key? ( :require_parameters )
99- runtime_provider_options = prompt &.options &.keys &.any? { |k | [ :only , :ignore , :quantizations , :sort , :max_price ] . include? ( k ) }
100-
101- if options . provider . present? || @data_collection != "allow" || @require_parameters != false ||
102- @only_providers . present? || @ignore_providers . present? || @quantizations . present? ||
103- @sort_preference . present? || @max_price . present? ||
104- runtime_data_collection || runtime_require_parameters || runtime_provider_options
105- params [ :provider ] = build_provider_preferences
106- end
107-
108- # Add plugins (e.g., for PDF processing)
109- if prompt . options [ :plugins ] . present?
110- params [ :plugins ] = prompt . options [ :plugins ]
111- end
112-
113- params
114- end
115-
11682 def execute_with_fallback ( parameters )
11783 parameters [ :stream ] = provider_stream if prompt . options [ :stream ] || config [ "stream" ]
11884
0 commit comments