CustomCommandsConfig Class

Class used to initialize a DialogServiceConnector that will connect to a Custom Commands application as published from Speech Studio for a speech service resource.

See also the custom commands page /azure/cognitive-services/speech-service/custom-commands.

The configuration can be initialized in following ways:

  • from subscription: pass an application id, a subscription key and a region

  • from authorization token: pass an application id, an authorization token and a region

Inheritance
CustomCommandsConfig

Constructor

CustomCommandsConfig(app_id: str | None = None, subscription: str | None = None, auth_token: str | None = None, region: str | None = None)

Parameters

Name Description
app_id

The Custom Commands application id.

Default value: None
subscription

The subscription key.

Default value: None
auth_token

The authorization token.

Default value: None
region

The region name (see the region page).

Default value: None

Methods

get_property

Get a property by id.

get_property_by_name

Get a property by name.

set_property

Set a property by id.

set_property_by_name

Set a property by name.

set_proxy

Set proxy information.

Note

Proxy functionality is not available on macOS. This function will have no effect on

this platform.

set_service_property

Sets a property value that will be passed to service using the specified channel.

get_property

Get a property by id.

get_property(property_id: PropertyId) -> str

Parameters

Name Description
property_id
Required

The id of the property to be retrieved.

Returns

Type Description

The value of the property.

get_property_by_name

Get a property by name.

get_property_by_name(property_name: str) -> str

Parameters

Name Description
property_name
Required

The name of the property to be retrieved.

Returns

Type Description

The value of the property.

set_property

Set a property by id.

set_property(property_id: PropertyId, value: str)

Parameters

Name Description
property_id
Required

The id of the property to be set.

value
Required

The value to be set for the property.

set_property_by_name

Set a property by name.

set_property_by_name(property_name: str, value: str)

Parameters

Name Description
property_name
Required

The name of the property to be set.

value
Required

The value to be set for the property.

set_proxy

Set proxy information.

Note

Proxy functionality is not available on macOS. This function will have no effect on

this platform.

set_proxy(hostname: str, port: str, username: str, password: str)

Parameters

Name Description
hostname
Required

The host name of the proxy server. Do not add protocol information (http) to the hostname.

port
Required

The port number of the proxy server.

username
Required

The user name of the proxy server.

password
Required

The password of the proxy server.

set_service_property

Sets a property value that will be passed to service using the specified channel.

set_service_property(name: str, value: str, channel: ServicePropertyChannel)

Parameters

Name Description
name
Required

The property name.

value
Required

The property value.

channel
Required

The channel used to pass the specified property to service.

Attributes

application_id

Get the identifier for the Custom Commands application to use, as selected from the subscription.

language

The language identifier used for speech-to-text, expressed in BCP-47 format.