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 58a917f commit 34c665eCopy full SHA for 34c665e
lib/openai/images.rb
@@ -23,18 +23,14 @@ def open_files(parameters)
23
24
if params[:image].is_a?(Array)
25
# Create indexed image parameters (image[0], image[1], etc.)
26
- image_array = params[:image]
27
- params.delete(:image)
28
-
29
- image_array.each_with_index do |img_path, index|
+ params[:image].each_with_index do |img_path, index|
30
params[:"image[#{index}]"] = File.open(img_path)
31
end
+ params.delete(:image)
32
else
33
params[:image] = File.open(params[:image])
34
35
36
params[:mask] = File.open(params[:mask]) if params[:mask]
37
38
params
39
40
0 commit comments