We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34c665e commit 7cc7e57Copy full SHA for 7cc7e57
lib/openai/images.rb
@@ -22,16 +22,20 @@ def open_files(parameters)
22
params = parameters.dup
23
24
if params[:image].is_a?(Array)
25
- # Create indexed image parameters (image[0], image[1], etc.)
26
- params[:image].each_with_index do |img_path, index|
27
- params[:"image[#{index}]"] = File.open(img_path)
28
- end
29
- params.delete(:image)
+ process_image_array(params)
30
else
31
params[:image] = File.open(params[:image])
32
end
+
33
params[:mask] = File.open(params[:mask]) if params[:mask]
34
params
35
+ def process_image_array(params)
+ params[:image].each_with_index do |img_path, index|
36
+ params[:"image[#{index}]"] = File.open(img_path)
37
+ end
38
+ params.delete(:image)
39
40
41
0 commit comments