PredictionAPIClient class

Extends

Constructors

PredictionAPIClient(ServiceClientCredentials, string, ServiceClientOptions)

Initializes a new instance of the PredictionAPIClient class.

Inherited Properties

credentials
endpoint

Methods

classifyImage(string, string, HttpRequestBody, PredictionAPIClientClassifyImageOptionalParams)
classifyImage(string, string, HttpRequestBody, PredictionAPIClientClassifyImageOptionalParams, ServiceCallback<ImagePrediction>)
classifyImage(string, string, HttpRequestBody, ServiceCallback<ImagePrediction>)
classifyImageUrl(string, string, ImageUrl, PredictionAPIClientClassifyImageUrlOptionalParams)
classifyImageUrl(string, string, ImageUrl, PredictionAPIClientClassifyImageUrlOptionalParams, ServiceCallback<ImagePrediction>)
classifyImageUrl(string, string, ImageUrl, ServiceCallback<ImagePrediction>)
classifyImageUrlWithNoStore(string, string, ImageUrl, PredictionAPIClientClassifyImageUrlWithNoStoreOptionalParams)
classifyImageUrlWithNoStore(string, string, ImageUrl, PredictionAPIClientClassifyImageUrlWithNoStoreOptionalParams, ServiceCallback<ImagePrediction>)
classifyImageUrlWithNoStore(string, string, ImageUrl, ServiceCallback<ImagePrediction>)
classifyImageWithNoStore(string, string, HttpRequestBody, PredictionAPIClientClassifyImageWithNoStoreOptionalParams)
classifyImageWithNoStore(string, string, HttpRequestBody, PredictionAPIClientClassifyImageWithNoStoreOptionalParams, ServiceCallback<ImagePrediction>)
classifyImageWithNoStore(string, string, HttpRequestBody, ServiceCallback<ImagePrediction>)
detectImage(string, string, HttpRequestBody, PredictionAPIClientDetectImageOptionalParams)
detectImage(string, string, HttpRequestBody, PredictionAPIClientDetectImageOptionalParams, ServiceCallback<ImagePrediction>)
detectImage(string, string, HttpRequestBody, ServiceCallback<ImagePrediction>)
detectImageUrl(string, string, ImageUrl, PredictionAPIClientDetectImageUrlOptionalParams)
detectImageUrl(string, string, ImageUrl, PredictionAPIClientDetectImageUrlOptionalParams, ServiceCallback<ImagePrediction>)
detectImageUrl(string, string, ImageUrl, ServiceCallback<ImagePrediction>)
detectImageUrlWithNoStore(string, string, ImageUrl, PredictionAPIClientDetectImageUrlWithNoStoreOptionalParams)
detectImageUrlWithNoStore(string, string, ImageUrl, PredictionAPIClientDetectImageUrlWithNoStoreOptionalParams, ServiceCallback<ImagePrediction>)
detectImageUrlWithNoStore(string, string, ImageUrl, ServiceCallback<ImagePrediction>)
detectImageWithNoStore(string, string, HttpRequestBody, PredictionAPIClientDetectImageWithNoStoreOptionalParams)
detectImageWithNoStore(string, string, HttpRequestBody, PredictionAPIClientDetectImageWithNoStoreOptionalParams, ServiceCallback<ImagePrediction>)
detectImageWithNoStore(string, string, HttpRequestBody, ServiceCallback<ImagePrediction>)

Inherited Methods

sendOperationRequest(OperationArguments, OperationSpec, ServiceCallback<any>)

Send an HTTP request that is populated using the provided OperationSpec.

sendRequest(RequestPrepareOptions | WebResourceLike)

Send the provided httpRequest.

Constructor Details

PredictionAPIClient(ServiceClientCredentials, string, ServiceClientOptions)

Initializes a new instance of the PredictionAPIClient class.

new PredictionAPIClient(credentials: ServiceClientCredentials, endpoint: string, options?: ServiceClientOptions)

Parameters

credentials
ServiceClientCredentials

Subscription credentials which uniquely identify client subscription.

endpoint

string

Supported Cognitive Services endpoints.

options
ServiceClientOptions

The parameter options

Inherited Property Details

credentials

credentials: ServiceClientCredentials

Property Value

Inherited From PredictionAPIClientContext.credentials

endpoint

endpoint: string

Property Value

string

Inherited From PredictionAPIClientContext.endpoint

Method Details

classifyImage(string, string, HttpRequestBody, PredictionAPIClientClassifyImageOptionalParams)

function classifyImage(projectId: string, publishedName: string, imageData: HttpRequestBody, options?: PredictionAPIClientClassifyImageOptionalParams): Promise<ClassifyImageResponse>

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageData
HttpRequestBody

Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.

options
PredictionAPIClientClassifyImageOptionalParams

The optional parameters

Returns

Promise<Models.ClassifyImageResponse>

classifyImage(string, string, HttpRequestBody, PredictionAPIClientClassifyImageOptionalParams, ServiceCallback<ImagePrediction>)

function classifyImage(projectId: string, publishedName: string, imageData: HttpRequestBody, options: PredictionAPIClientClassifyImageOptionalParams, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageData
HttpRequestBody

Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.

options
PredictionAPIClientClassifyImageOptionalParams

The optional parameters

callback

ServiceCallback<ImagePrediction>

The callback

classifyImage(string, string, HttpRequestBody, ServiceCallback<ImagePrediction>)

function classifyImage(projectId: string, publishedName: string, imageData: HttpRequestBody, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageData
HttpRequestBody

Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.

callback

ServiceCallback<ImagePrediction>

The callback

classifyImageUrl(string, string, ImageUrl, PredictionAPIClientClassifyImageUrlOptionalParams)

function classifyImageUrl(projectId: string, publishedName: string, imageUrl: ImageUrl, options?: PredictionAPIClientClassifyImageUrlOptionalParams): Promise<ClassifyImageUrlResponse>

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageUrl
ImageUrl

An ImageUrl that contains the url of the image to be evaluated.

options
PredictionAPIClientClassifyImageUrlOptionalParams

The optional parameters

Returns

Promise<Models.ClassifyImageUrlResponse>

classifyImageUrl(string, string, ImageUrl, PredictionAPIClientClassifyImageUrlOptionalParams, ServiceCallback<ImagePrediction>)

function classifyImageUrl(projectId: string, publishedName: string, imageUrl: ImageUrl, options: PredictionAPIClientClassifyImageUrlOptionalParams, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageUrl
ImageUrl

An ImageUrl that contains the url of the image to be evaluated.

options
PredictionAPIClientClassifyImageUrlOptionalParams

The optional parameters

callback

ServiceCallback<ImagePrediction>

The callback

classifyImageUrl(string, string, ImageUrl, ServiceCallback<ImagePrediction>)

function classifyImageUrl(projectId: string, publishedName: string, imageUrl: ImageUrl, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageUrl
ImageUrl

An ImageUrl that contains the url of the image to be evaluated.

callback

ServiceCallback<ImagePrediction>

The callback

classifyImageUrlWithNoStore(string, string, ImageUrl, PredictionAPIClientClassifyImageUrlWithNoStoreOptionalParams)

function classifyImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: ImageUrl, options?: PredictionAPIClientClassifyImageUrlWithNoStoreOptionalParams): Promise<ClassifyImageUrlWithNoStoreResponse>

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageUrl
ImageUrl

An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be evaluated.

Returns

Promise<Models.ClassifyImageUrlWithNoStoreResponse>

classifyImageUrlWithNoStore(string, string, ImageUrl, PredictionAPIClientClassifyImageUrlWithNoStoreOptionalParams, ServiceCallback<ImagePrediction>)

function classifyImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: ImageUrl, options: PredictionAPIClientClassifyImageUrlWithNoStoreOptionalParams, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageUrl
ImageUrl

An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be evaluated.

callback

ServiceCallback<ImagePrediction>

The callback

classifyImageUrlWithNoStore(string, string, ImageUrl, ServiceCallback<ImagePrediction>)

function classifyImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: ImageUrl, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageUrl
ImageUrl

An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be evaluated.

callback

ServiceCallback<ImagePrediction>

The callback

classifyImageWithNoStore(string, string, HttpRequestBody, PredictionAPIClientClassifyImageWithNoStoreOptionalParams)

function classifyImageWithNoStore(projectId: string, publishedName: string, imageData: HttpRequestBody, options?: PredictionAPIClientClassifyImageWithNoStoreOptionalParams): Promise<ClassifyImageWithNoStoreResponse>

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageData
HttpRequestBody

Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.

Returns

Promise<Models.ClassifyImageWithNoStoreResponse>

classifyImageWithNoStore(string, string, HttpRequestBody, PredictionAPIClientClassifyImageWithNoStoreOptionalParams, ServiceCallback<ImagePrediction>)

function classifyImageWithNoStore(projectId: string, publishedName: string, imageData: HttpRequestBody, options: PredictionAPIClientClassifyImageWithNoStoreOptionalParams, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageData
HttpRequestBody

Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.

callback

ServiceCallback<ImagePrediction>

The callback

classifyImageWithNoStore(string, string, HttpRequestBody, ServiceCallback<ImagePrediction>)

function classifyImageWithNoStore(projectId: string, publishedName: string, imageData: HttpRequestBody, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageData
HttpRequestBody

Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.

callback

ServiceCallback<ImagePrediction>

The callback

detectImage(string, string, HttpRequestBody, PredictionAPIClientDetectImageOptionalParams)

function detectImage(projectId: string, publishedName: string, imageData: HttpRequestBody, options?: PredictionAPIClientDetectImageOptionalParams): Promise<DetectImageResponse>

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageData
HttpRequestBody

Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.

options
PredictionAPIClientDetectImageOptionalParams

The optional parameters

Returns

Promise<Models.DetectImageResponse>

detectImage(string, string, HttpRequestBody, PredictionAPIClientDetectImageOptionalParams, ServiceCallback<ImagePrediction>)

function detectImage(projectId: string, publishedName: string, imageData: HttpRequestBody, options: PredictionAPIClientDetectImageOptionalParams, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageData
HttpRequestBody

Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.

options
PredictionAPIClientDetectImageOptionalParams

The optional parameters

callback

ServiceCallback<ImagePrediction>

The callback

detectImage(string, string, HttpRequestBody, ServiceCallback<ImagePrediction>)

function detectImage(projectId: string, publishedName: string, imageData: HttpRequestBody, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageData
HttpRequestBody

Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.

callback

ServiceCallback<ImagePrediction>

The callback

detectImageUrl(string, string, ImageUrl, PredictionAPIClientDetectImageUrlOptionalParams)

function detectImageUrl(projectId: string, publishedName: string, imageUrl: ImageUrl, options?: PredictionAPIClientDetectImageUrlOptionalParams): Promise<DetectImageUrlResponse>

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageUrl
ImageUrl

An ImageUrl that contains the url of the image to be evaluated.

options
PredictionAPIClientDetectImageUrlOptionalParams

The optional parameters

Returns

Promise<Models.DetectImageUrlResponse>

detectImageUrl(string, string, ImageUrl, PredictionAPIClientDetectImageUrlOptionalParams, ServiceCallback<ImagePrediction>)

function detectImageUrl(projectId: string, publishedName: string, imageUrl: ImageUrl, options: PredictionAPIClientDetectImageUrlOptionalParams, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageUrl
ImageUrl

An ImageUrl that contains the url of the image to be evaluated.

options
PredictionAPIClientDetectImageUrlOptionalParams

The optional parameters

callback

ServiceCallback<ImagePrediction>

The callback

detectImageUrl(string, string, ImageUrl, ServiceCallback<ImagePrediction>)

function detectImageUrl(projectId: string, publishedName: string, imageUrl: ImageUrl, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageUrl
ImageUrl

An ImageUrl that contains the url of the image to be evaluated.

callback

ServiceCallback<ImagePrediction>

The callback

detectImageUrlWithNoStore(string, string, ImageUrl, PredictionAPIClientDetectImageUrlWithNoStoreOptionalParams)

function detectImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: ImageUrl, options?: PredictionAPIClientDetectImageUrlWithNoStoreOptionalParams): Promise<DetectImageUrlWithNoStoreResponse>

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageUrl
ImageUrl

An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be evaluated.

Returns

Promise<Models.DetectImageUrlWithNoStoreResponse>

detectImageUrlWithNoStore(string, string, ImageUrl, PredictionAPIClientDetectImageUrlWithNoStoreOptionalParams, ServiceCallback<ImagePrediction>)

function detectImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: ImageUrl, options: PredictionAPIClientDetectImageUrlWithNoStoreOptionalParams, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageUrl
ImageUrl

An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be evaluated.

callback

ServiceCallback<ImagePrediction>

The callback

detectImageUrlWithNoStore(string, string, ImageUrl, ServiceCallback<ImagePrediction>)

function detectImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: ImageUrl, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageUrl
ImageUrl

An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be evaluated.

callback

ServiceCallback<ImagePrediction>

The callback

detectImageWithNoStore(string, string, HttpRequestBody, PredictionAPIClientDetectImageWithNoStoreOptionalParams)

function detectImageWithNoStore(projectId: string, publishedName: string, imageData: HttpRequestBody, options?: PredictionAPIClientDetectImageWithNoStoreOptionalParams): Promise<DetectImageWithNoStoreResponse>

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageData
HttpRequestBody

Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.

Returns

Promise<Models.DetectImageWithNoStoreResponse>

detectImageWithNoStore(string, string, HttpRequestBody, PredictionAPIClientDetectImageWithNoStoreOptionalParams, ServiceCallback<ImagePrediction>)

function detectImageWithNoStore(projectId: string, publishedName: string, imageData: HttpRequestBody, options: PredictionAPIClientDetectImageWithNoStoreOptionalParams, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageData
HttpRequestBody

Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.

callback

ServiceCallback<ImagePrediction>

The callback

detectImageWithNoStore(string, string, HttpRequestBody, ServiceCallback<ImagePrediction>)

function detectImageWithNoStore(projectId: string, publishedName: string, imageData: HttpRequestBody, callback: ServiceCallback<ImagePrediction>)

Parameters

projectId

string

The project id.

publishedName

string

Specifies the name of the model to evaluate against.

imageData
HttpRequestBody

Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 4MB.

callback

ServiceCallback<ImagePrediction>

The callback

Inherited Method Details

sendOperationRequest(OperationArguments, OperationSpec, ServiceCallback<any>)

Send an HTTP request that is populated using the provided OperationSpec.

function sendOperationRequest(operationArguments: OperationArguments, operationSpec: OperationSpec, callback?: ServiceCallback<any>): Promise<RestResponse>

Parameters

operationArguments
OperationArguments

The arguments that the HTTP request's templated values will be populated from.

operationSpec
OperationSpec

The OperationSpec to use to populate the httpRequest.

callback

ServiceCallback<any>

The callback to call when the response is received.

Returns

Promise<RestResponse>

Inherited From PredictionAPIClientContext.sendOperationRequest

sendRequest(RequestPrepareOptions | WebResourceLike)

Send the provided httpRequest.

function sendRequest(options: RequestPrepareOptions | WebResourceLike): Promise<HttpOperationResponse>

Parameters

Returns

Inherited From PredictionAPIClientContext.sendRequest