Skip to content

Commit 109cdc3

Browse files
committed
fix(visualRecognition): classifier_ids should be passed to classify as an array of strings
1 parent f3f3434 commit 109cdc3

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

lib/ibm_watson/visual_recognition_v3.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ def classify(images_file: nil, accept_language: nil, url: nil, threshold: nil, o
140140
images_file = images_file.instance_of?(StringIO) ? HTTP::FormData::File.new(images_file, content_type: mime_type) : HTTP::FormData::File.new(images_file.path, content_type: mime_type)
141141
end
142142
end
143-
threshold = HTTP::FormData::Part.new(threshold, content_type: "text/plain") unless threshold.nil?
144-
owners = HTTP::FormData::Part.new(owners, content_type: "text/plain") unless owners.nil?
145-
classifier_ids = HTTP::FormData::Part.new(classifier_ids, content_type: "text/plain") unless classifier_ids.nil?
146143
method_url = "/v3/classify"
147144
response = request(
148145
method: "POST",

test/integration/test_visual_recognition_v3.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_classify
2929
dog_results = @service.classify(
3030
images_file: image_file,
3131
threshold: "0.1",
32-
classifier_ids: "default"
32+
classifier_ids: %w[default food]
3333
).result
3434
refute(dog_results.nil?)
3535
end

0 commit comments

Comments
 (0)