@@ -30,7 +30,7 @@ module IBMWatson
3030 # The Visual Recognition V3 service.
3131 class VisualRecognitionV3 < IBMCloudSdkCore ::BaseService
3232 include Concurrent ::Async
33- DEFAULT_SERVICE_NAME = "watson_vision_combined "
33+ DEFAULT_SERVICE_NAME = "visual_recognition "
3434 DEFAULT_SERVICE_URL = "https://gateway.watsonplatform.net/visual-recognition/api"
3535 ##
3636 # @!method initialize(args)
@@ -132,19 +132,16 @@ def classify(images_file: nil, images_filename: nil, images_file_content_type: n
132132 form_data [ :images_file ] = HTTP ::FormData ::File . new ( images_file , content_type : images_file_content_type . nil? ? "application/octet-stream" : images_file_content_type , filename : images_filename )
133133 end
134134
135+ classifier_ids *= "," unless classifier_ids . nil?
136+ owners *= "," unless owners . nil?
137+
135138 form_data [ :url ] = HTTP ::FormData ::Part . new ( url . to_s , content_type : "text/plain" ) unless url . nil?
136139
137140 form_data [ :threshold ] = HTTP ::FormData ::Part . new ( threshold . to_s , content_type : "application/json" ) unless threshold . nil?
138141
139- form_data [ :owners ] = [ ]
140- owners &.each do |item |
141- form_data [ :owners ] . push ( HTTP ::FormData ::Part . new ( item . to_s , content_type : "text/plain" ) )
142- end
142+ form_data [ :owners ] = HTTP ::FormData ::Part . new ( owners , content_type : "application/json" ) unless owners . nil?
143143
144- form_data [ :classifier_ids ] = [ ]
145- classifier_ids &.each do |item |
146- form_data [ :classifier_ids ] . push ( HTTP ::FormData ::Part . new ( item . to_s , content_type : "text/plain" ) )
147- end
144+ form_data [ :classifier_ids ] = HTTP ::FormData ::Part . new ( classifier_ids , content_type : "application/json" ) unless classifier_ids . nil?
148145
149146 method_url = "/v3/classify"
150147
0 commit comments