BotFrameworkConfig Class

Class that is used to initialize a DialogServiceConnector that will connect to a Bot Framework bot using the Direct Line Speech channel.

See also the direct line speech page /azure/cognitive-services/speech-service/direct-line-speech.

The configuration can be initialized in following ways:

  • from subscription: pass a subscription key, a region and a bot_id (optional)

  • from authorization token: pass an authorization token, a region and a bot_id (optional)

Inheritance
BotFrameworkConfig

Constructor

BotFrameworkConfig(subscription: str | None = None, auth_token: str | None = None, region: str | None = None, bot_id: str | None = '')

Parameters

Name Description
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
bot_id
Required

The identifier of a specific bot resource to request.

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

language

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