Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,8 @@ def recognize_printed_text_async(detect_orientation, url, language = nil, custom
# an error code and a message to help understand what went wrong.
#
# @param url [String] Publicly reachable URL of an image
# @param max_candidates [String] Maximum number of candidate descriptions to be
# returned. The default is 1.
# @param max_candidates [Integer] Maximum number of candidate descriptions to
# be returned. The default is 1.
# @param language [Enum] The desired language for output generation. If this
# parameter is not specified, the default value is "en".Supported
# languages:en - English, Default. es - Spanish, ja - Japanese, pt -
Expand All @@ -677,7 +677,7 @@ def recognize_printed_text_async(detect_orientation, url, language = nil, custom
#
# @return [ImageDescription] operation results.
#
def describe_image(url, max_candidates = '1', language = nil, custom_headers = nil)
def describe_image(url, max_candidates = 1, language = nil, custom_headers = nil)
response = describe_image_async(url, max_candidates, language, custom_headers).value!
response.body unless response.nil?
end
Expand All @@ -693,8 +693,8 @@ def describe_image(url, max_candidates = '1', language = nil, custom_headers = n
# an error code and a message to help understand what went wrong.
#
# @param url [String] Publicly reachable URL of an image
# @param max_candidates [String] Maximum number of candidate descriptions to be
# returned. The default is 1.
# @param max_candidates [Integer] Maximum number of candidate descriptions to
# be returned. The default is 1.
# @param language [Enum] The desired language for output generation. If this
# parameter is not specified, the default value is "en".Supported
# languages:en - English, Default. es - Spanish, ja - Japanese, pt -
Expand All @@ -705,7 +705,7 @@ def describe_image(url, max_candidates = '1', language = nil, custom_headers = n
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def describe_image_with_http_info(url, max_candidates = '1', language = nil, custom_headers = nil)
def describe_image_with_http_info(url, max_candidates = 1, language = nil, custom_headers = nil)
describe_image_async(url, max_candidates, language, custom_headers).value!
end

Expand All @@ -720,8 +720,8 @@ def describe_image_with_http_info(url, max_candidates = '1', language = nil, cus
# an error code and a message to help understand what went wrong.
#
# @param url [String] Publicly reachable URL of an image
# @param max_candidates [String] Maximum number of candidate descriptions to be
# returned. The default is 1.
# @param max_candidates [Integer] Maximum number of candidate descriptions to
# be returned. The default is 1.
# @param language [Enum] The desired language for output generation. If this
# parameter is not specified, the default value is "en".Supported
# languages:en - English, Default. es - Spanish, ja - Japanese, pt -
Expand All @@ -732,7 +732,7 @@ def describe_image_with_http_info(url, max_candidates = '1', language = nil, cus
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def describe_image_async(url, max_candidates = '1', language = nil, custom_headers = nil)
def describe_image_async(url, max_candidates = 1, language = nil, custom_headers = nil)
fail ArgumentError, 'endpoint is nil' if endpoint.nil?
fail ArgumentError, 'url is nil' if url.nil?

Expand Down Expand Up @@ -1282,10 +1282,10 @@ def get_text_operation_result_async(operation_id, custom_headers = nil)
# the accent color, dominant color, and whether an image is black&white.Adult -
# detects if the image is pornographic in nature (depicts nudity or a sex act).
# Sexually suggestive content is also detected.
# @param details [Enum] A string indicating which domain-specific details to
# return. Multiple values should be comma-separated. Valid visual feature types
# include:Celebrities - identifies celebrities if detected in the image.
# Possible values include: 'Celebrities', 'Landmarks'
# @param details [Array<Details>] A string indicating which domain-specific
# details to return. Multiple values should be comma-separated. Valid visual
# feature types include:Celebrities - identifies celebrities if detected in the
# image.
# @param language [Enum] The desired language for output generation. If this
# parameter is not specified, the default value is &quot;en&quot;.Supported
# languages:en - English, Default. es - Spanish, ja - Japanese, pt -
Expand Down Expand Up @@ -1317,10 +1317,10 @@ def analyze_image_in_stream(image, visual_features = nil, details = nil, languag
# the accent color, dominant color, and whether an image is black&white.Adult -
# detects if the image is pornographic in nature (depicts nudity or a sex act).
# Sexually suggestive content is also detected.
# @param details [Enum] A string indicating which domain-specific details to
# return. Multiple values should be comma-separated. Valid visual feature types
# include:Celebrities - identifies celebrities if detected in the image.
# Possible values include: 'Celebrities', 'Landmarks'
# @param details [Array<Details>] A string indicating which domain-specific
# details to return. Multiple values should be comma-separated. Valid visual
# feature types include:Celebrities - identifies celebrities if detected in the
# image.
# @param language [Enum] The desired language for output generation. If this
# parameter is not specified, the default value is &quot;en&quot;.Supported
# languages:en - English, Default. es - Spanish, ja - Japanese, pt -
Expand Down Expand Up @@ -1351,10 +1351,10 @@ def analyze_image_in_stream_with_http_info(image, visual_features = nil, details
# the accent color, dominant color, and whether an image is black&white.Adult -
# detects if the image is pornographic in nature (depicts nudity or a sex act).
# Sexually suggestive content is also detected.
# @param details [Enum] A string indicating which domain-specific details to
# return. Multiple values should be comma-separated. Valid visual feature types
# include:Celebrities - identifies celebrities if detected in the image.
# Possible values include: 'Celebrities', 'Landmarks'
# @param details [Array<Details>] A string indicating which domain-specific
# details to return. Multiple values should be comma-separated. Valid visual
# feature types include:Celebrities - identifies celebrities if detected in the
# image.
# @param language [Enum] The desired language for output generation. If this
# parameter is not specified, the default value is &quot;en&quot;.Supported
# languages:en - English, Default. es - Spanish, ja - Japanese, pt -
Expand Down Expand Up @@ -1396,7 +1396,7 @@ def analyze_image_in_stream_async(image, visual_features = nil, details = nil, l

options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
query_params: {'visualFeatures' => visual_features.nil? ? nil : visual_features.join(','),'details' => details,'language' => language},
query_params: {'visualFeatures' => visual_features.nil? ? nil : visual_features.join(','),'details' => details.nil? ? nil : details.join(','),'language' => language},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
Expand Down Expand Up @@ -1727,8 +1727,8 @@ def recognize_printed_text_in_stream_async(detect_orientation, image, language =
# an error code and a message to help understand what went wrong.
#
# @param image An image stream.
# @param max_candidates [String] Maximum number of candidate descriptions to be
# returned. The default is 1.
# @param max_candidates [Integer] Maximum number of candidate descriptions to
# be returned. The default is 1.
# @param language [Enum] The desired language for output generation. If this
# parameter is not specified, the default value is &quot;en&quot;.Supported
# languages:en - English, Default. es - Spanish, ja - Japanese, pt -
Expand All @@ -1739,7 +1739,7 @@ def recognize_printed_text_in_stream_async(detect_orientation, image, language =
#
# @return [ImageDescription] operation results.
#
def describe_image_in_stream(image, max_candidates = '1', language = nil, custom_headers = nil)
def describe_image_in_stream(image, max_candidates = 1, language = nil, custom_headers = nil)
response = describe_image_in_stream_async(image, max_candidates, language, custom_headers).value!
response.body unless response.nil?
end
Expand All @@ -1755,8 +1755,8 @@ def describe_image_in_stream(image, max_candidates = '1', language = nil, custom
# an error code and a message to help understand what went wrong.
#
# @param image An image stream.
# @param max_candidates [String] Maximum number of candidate descriptions to be
# returned. The default is 1.
# @param max_candidates [Integer] Maximum number of candidate descriptions to
# be returned. The default is 1.
# @param language [Enum] The desired language for output generation. If this
# parameter is not specified, the default value is &quot;en&quot;.Supported
# languages:en - English, Default. es - Spanish, ja - Japanese, pt -
Expand All @@ -1767,7 +1767,7 @@ def describe_image_in_stream(image, max_candidates = '1', language = nil, custom
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def describe_image_in_stream_with_http_info(image, max_candidates = '1', language = nil, custom_headers = nil)
def describe_image_in_stream_with_http_info(image, max_candidates = 1, language = nil, custom_headers = nil)
describe_image_in_stream_async(image, max_candidates, language, custom_headers).value!
end

Expand All @@ -1782,8 +1782,8 @@ def describe_image_in_stream_with_http_info(image, max_candidates = '1', languag
# an error code and a message to help understand what went wrong.
#
# @param image An image stream.
# @param max_candidates [String] Maximum number of candidate descriptions to be
# returned. The default is 1.
# @param max_candidates [Integer] Maximum number of candidate descriptions to
# be returned. The default is 1.
# @param language [Enum] The desired language for output generation. If this
# parameter is not specified, the default value is &quot;en&quot;.Supported
# languages:en - English, Default. es - Spanish, ja - Japanese, pt -
Expand All @@ -1794,7 +1794,7 @@ def describe_image_in_stream_with_http_info(image, max_candidates = '1', languag
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def describe_image_in_stream_async(image, max_candidates = '1', language = nil, custom_headers = nil)
def describe_image_in_stream_async(image, max_candidates = 1, language = nil, custom_headers = nil)
fail ArgumentError, 'endpoint is nil' if endpoint.nil?
fail ArgumentError, 'image is nil' if image.nil?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class ImageType

include MsRestAzure

# @return [Float] Confidence level that the image is a clip art.
# @return [Integer] Confidence level that the image is a clip art.
attr_accessor :clip_art_type

# @return [Float] Confidence level that the image is a line drawing.
# @return [Integer] Confidence level that the image is a line drawing.
attr_accessor :line_drawing_type


Expand All @@ -35,14 +35,14 @@ def self.mapper()
required: false,
serialized_name: 'clipArtType',
type: {
name: 'Double'
name: 'Number'
}
},
line_drawing_type: {
required: false,
serialized_name: 'lineDrawingType',
type: {
name: 'Double'
name: 'Number'
}
}
}
Expand Down