Skip to content

Latest commit

 

History

History
655 lines (486 loc) · 25 KB

CustomSpeechModelsApi.md

File metadata and controls

655 lines (486 loc) · 25 KB

swagger_client.CustomSpeechModelsApi

All URIs are relative to https://localhost

Method HTTP request Description
copy_model_to_subscription POST /models/{id}/copyto Copies a model from one subscription to another.
create_model POST /models Creates a new model.
delete_model DELETE /models/{id} Deletes the model identified by the given ID.
get_base_model GET /models/base/{id} Gets the base model identified by the given ID.
get_base_model_manifest GET /models/base/{id}/manifest Returns an manifest for this base model which can be used in an on-premise container.
get_base_models GET /models/base Gets the list of base models for the authenticated subscription.
get_model GET /models/{id} Gets the model identified by the given ID.
get_model_manifest GET /models/{id}/manifest Returns an manifest for this model which can be used in an on-premise container.
get_models GET /models Gets the list of custom models for the authenticated subscription.
get_supported_locales_for_models GET /models/locales Gets a list of supported locales for model adaptation.
update_model PATCH /models/{id} Updates the metadata of the model identified by the given ID.

copy_model_to_subscription

Model copy_model_to_subscription(id, model_copy)

Copies a model from one subscription to another.

This method can be used to copy a model from one location to another. If the target subscription key belongs to a subscription created for another location, the model will be copied to that location. Only adapted models are allowed to copy to another subscription.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['Ocp-Apim-Subscription-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Ocp-Apim-Subscription-Key'] = 'Bearer'
# Configure API key authorization: token
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CustomSpeechModelsApi(swagger_client.ApiClient(configuration))
id = 'id_example' # str | The identifier of the model that will be copied.
model_copy = swagger_client.ModelCopy() # ModelCopy | The body contains the subscription key of the target subscription.

try:
    # Copies a model from one subscription to another.
    api_response = api_instance.copy_model_to_subscription(id, model_copy)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomSpeechModelsApi->copy_model_to_subscription: %s\n" % e)

Parameters

Name Type Description Notes
id str The identifier of the model that will be copied.
model_copy ModelCopy The body contains the subscription key of the target subscription.

Return type

Model

Authorization

api_key, token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_model

Model create_model(model)

Creates a new model.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['Ocp-Apim-Subscription-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Ocp-Apim-Subscription-Key'] = 'Bearer'
# Configure API key authorization: token
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CustomSpeechModelsApi(swagger_client.ApiClient(configuration))
model = swagger_client.Model() # Model | The details of the new model.

try:
    # Creates a new model.
    api_response = api_instance.create_model(model)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomSpeechModelsApi->create_model: %s\n" % e)

Parameters

Name Type Description Notes
model Model The details of the new model.

Return type

Model

Authorization

api_key, token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_model

delete_model(id)

Deletes the model identified by the given ID.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['Ocp-Apim-Subscription-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Ocp-Apim-Subscription-Key'] = 'Bearer'
# Configure API key authorization: token
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CustomSpeechModelsApi(swagger_client.ApiClient(configuration))
id = 'id_example' # str | The identifier of the model.

try:
    # Deletes the model identified by the given ID.
    api_instance.delete_model(id)
except ApiException as e:
    print("Exception when calling CustomSpeechModelsApi->delete_model: %s\n" % e)

Parameters

Name Type Description Notes
id str The identifier of the model.

Return type

void (empty response body)

Authorization

api_key, token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_base_model

Model get_base_model(id)

Gets the base model identified by the given ID.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['Ocp-Apim-Subscription-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Ocp-Apim-Subscription-Key'] = 'Bearer'
# Configure API key authorization: token
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CustomSpeechModelsApi(swagger_client.ApiClient(configuration))
id = 'id_example' # str | The identifier of the base model.

try:
    # Gets the base model identified by the given ID.
    api_response = api_instance.get_base_model(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomSpeechModelsApi->get_base_model: %s\n" % e)

Parameters

Name Type Description Notes
id str The identifier of the base model.

Return type

Model

Authorization

api_key, token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_base_model_manifest

ModelManifest get_base_model_manifest(id, sas_validity_in_seconds=sas_validity_in_seconds)

Returns an manifest for this base model which can be used in an on-premise container.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['Ocp-Apim-Subscription-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Ocp-Apim-Subscription-Key'] = 'Bearer'
# Configure API key authorization: token
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CustomSpeechModelsApi(swagger_client.ApiClient(configuration))
id = 'id_example' # str | The ID of the model to generate a manifest for.
sas_validity_in_seconds = 56 # int | The duration in seconds that an SAS url should be valid. The default duration is 12 hours.              When using BYOS (https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-encryption-of-data-at-rest#bring-your-own-storage-byos-for-customization-and-logging): A value of 0 means that a plain blob URI without SAS token will be generated. (optional)

try:
    # Returns an manifest for this base model which can be used in an on-premise container.
    api_response = api_instance.get_base_model_manifest(id, sas_validity_in_seconds=sas_validity_in_seconds)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomSpeechModelsApi->get_base_model_manifest: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the model to generate a manifest for.
sas_validity_in_seconds int The duration in seconds that an SAS url should be valid. The default duration is 12 hours. When using BYOS (https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-encryption-of-data-at-rest#bring-your-own-storage-byos-for-customization-and-logging): A value of 0 means that a plain blob URI without SAS token will be generated. [optional]

Return type

ModelManifest

Authorization

api_key, token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_base_models

PaginatedModels get_base_models(skip=skip, top=top)

Gets the list of base models for the authenticated subscription.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['Ocp-Apim-Subscription-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Ocp-Apim-Subscription-Key'] = 'Bearer'
# Configure API key authorization: token
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CustomSpeechModelsApi(swagger_client.ApiClient(configuration))
skip = 56 # int | Number of datasets that will be skipped. (optional)
top = 56 # int | Number of datasets that will be included after skipping. (optional)

try:
    # Gets the list of base models for the authenticated subscription.
    api_response = api_instance.get_base_models(skip=skip, top=top)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomSpeechModelsApi->get_base_models: %s\n" % e)

Parameters

Name Type Description Notes
skip int Number of datasets that will be skipped. [optional]
top int Number of datasets that will be included after skipping. [optional]

Return type

PaginatedModels

Authorization

api_key, token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_model

Model get_model(id)

Gets the model identified by the given ID.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['Ocp-Apim-Subscription-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Ocp-Apim-Subscription-Key'] = 'Bearer'
# Configure API key authorization: token
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CustomSpeechModelsApi(swagger_client.ApiClient(configuration))
id = 'id_example' # str | The identifier of the model.

try:
    # Gets the model identified by the given ID.
    api_response = api_instance.get_model(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomSpeechModelsApi->get_model: %s\n" % e)

Parameters

Name Type Description Notes
id str The identifier of the model.

Return type

Model

Authorization

api_key, token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_model_manifest

ModelManifest get_model_manifest(id, sas_validity_in_seconds=sas_validity_in_seconds)

Returns an manifest for this model which can be used in an on-premise container.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['Ocp-Apim-Subscription-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Ocp-Apim-Subscription-Key'] = 'Bearer'
# Configure API key authorization: token
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CustomSpeechModelsApi(swagger_client.ApiClient(configuration))
id = 'id_example' # str | The ID of the model to generate a manifest for.
sas_validity_in_seconds = 56 # int | The duration in seconds that an SAS url should be valid. The default duration is 12 hours.              When using BYOS (https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-encryption-of-data-at-rest#bring-your-own-storage-byos-for-customization-and-logging): A value of 0 means that a plain blob URI without SAS token will be generated. (optional)

try:
    # Returns an manifest for this model which can be used in an on-premise container.
    api_response = api_instance.get_model_manifest(id, sas_validity_in_seconds=sas_validity_in_seconds)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomSpeechModelsApi->get_model_manifest: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the model to generate a manifest for.
sas_validity_in_seconds int The duration in seconds that an SAS url should be valid. The default duration is 12 hours. When using BYOS (https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-encryption-of-data-at-rest#bring-your-own-storage-byos-for-customization-and-logging): A value of 0 means that a plain blob URI without SAS token will be generated. [optional]

Return type

ModelManifest

Authorization

api_key, token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_models

PaginatedModels get_models(skip=skip, top=top)

Gets the list of custom models for the authenticated subscription.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['Ocp-Apim-Subscription-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Ocp-Apim-Subscription-Key'] = 'Bearer'
# Configure API key authorization: token
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CustomSpeechModelsApi(swagger_client.ApiClient(configuration))
skip = 56 # int | Number of datasets that will be skipped. (optional)
top = 56 # int | Number of datasets that will be included after skipping. (optional)

try:
    # Gets the list of custom models for the authenticated subscription.
    api_response = api_instance.get_models(skip=skip, top=top)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomSpeechModelsApi->get_models: %s\n" % e)

Parameters

Name Type Description Notes
skip int Number of datasets that will be skipped. [optional]
top int Number of datasets that will be included after skipping. [optional]

Return type

PaginatedModels

Authorization

api_key, token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_supported_locales_for_models

list[str] get_supported_locales_for_models()

Gets a list of supported locales for model adaptation.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['Ocp-Apim-Subscription-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Ocp-Apim-Subscription-Key'] = 'Bearer'
# Configure API key authorization: token
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CustomSpeechModelsApi(swagger_client.ApiClient(configuration))

try:
    # Gets a list of supported locales for model adaptation.
    api_response = api_instance.get_supported_locales_for_models()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomSpeechModelsApi->get_supported_locales_for_models: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

list[str]

Authorization

api_key, token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_model

Model update_model(id, model_update)

Updates the metadata of the model identified by the given ID.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = swagger_client.Configuration()
configuration.api_key['Ocp-Apim-Subscription-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Ocp-Apim-Subscription-Key'] = 'Bearer'
# Configure API key authorization: token
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CustomSpeechModelsApi(swagger_client.ApiClient(configuration))
id = 'id_example' # str | The identifier of the model.
model_update = swagger_client.ModelUpdate() # ModelUpdate | The updated values for the model.

try:
    # Updates the metadata of the model identified by the given ID.
    api_response = api_instance.update_model(id, model_update)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomSpeechModelsApi->update_model: %s\n" % e)

Parameters

Name Type Description Notes
id str The identifier of the model.
model_update ModelUpdate The updated values for the model.

Return type

Model

Authorization

api_key, token

HTTP request headers

  • Content-Type: application/json, application/merge-patch+json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]