クラス Dialog::D ialogServiceConnector

class Dialog::DialogServiceConnector
  : public std::enable_shared_from_this< DialogServiceConnector >
  : public Utils::NonCopyable
  : public Utils::NonMovable

DirectLineSpeech または CustomCommands を接続するために使用されるオブジェクト。

この型のオブジェクトは、 FromConfig ファクトリ メソッドを使用して作成されます。

メンバー

認識されている

構文: public EventSignal< constSpeechRecognitionEventArgs & > Recognized;

音声認識結果を含むイベントのシグナル。

認識

構文: public EventSignal< constSpeechRecognitionEventArgs & > Recognizing;

中間認識結果を含むイベントのシグナル。

SessionStarted

構文: public EventSignal< constSessionEventArgs & > SessionStarted;

リッスン セッションの開始を示すシグナル。

SessionStopped

構文: public EventSignal< constSessionEventArgs & > SessionStopped;

リッスン セッションの終了を示すシグナル。

SpeechStartDetected

構文: public EventSignal< constRecognitionEventArgs & > SpeechStartDetected;

現在のフレーズ内の音声データの最初の検出を示すシグナル。

SpeechEndDetected

構文: public EventSignal< constRecognitionEventArgs & > SpeechEndDetected;

現在のフレーズの音声データの検出された終了を示すシグナル。

Canceled

構文: public EventSignal< constSpeechRecognitionCanceledEventArgs & > Canceled;

相互作用の取り消しに関連するイベントのシグナル。 イベントは、理由が直接取り消しまたはエラーであるかどうかを示します。

ActivityReceived

構文: public EventSignal< constActivityReceivedEventArgs & > ActivityReceived;

アクティビティがバックエンドから受信されたことを通知します。

TurnStatusReceived

構文: public EventSignal< constTurnStatusReceivedEventArgs & > TurnStatusReceived;

バックエンドからターン状態の更新が受信されたことを通知します。

プロパティ

構文: public PropertyCollection & Properties;

この DialogServiceConnector に対して定義されているプロパティとその値のコレクション。

~DialogServiceConnector

構文: public inline virtual ~DialogServiceConnector ( );

インスタンスを破棄します。

Connectasync

構文: public inline std::future< void > ConnectAsync ( );

バックエンドに接続します。

戻り値

接続を開始する非同期操作。

DisconnectAsync

構文: public inline std::future< void > DisconnectAsync ( );

バックエンドから切断します。

戻り値

切断を開始する非同期操作。

SendActivityAsync

構文: public inline std::future< std::string > SendActivityAsync ( const std::string & activity );

バッキング ダイアログにアクティビティを送信します。

パラメーター

  • activity 送信するアクティビティ

戻り値

操作を開始する非同期操作。

StartKeywordRecognitionAsync

構文: public inline std::future< void > StartKeywordRecognitionAsync ( std::shared_ptr< KeywordRecognitionModel > model );

認識キーワード (keyword)開始します。

パラメーター

  • model使用するキーワード (keyword) モデルを指定します。

戻り値

操作を開始する非同期操作。

StopKeywordRecognitionAsync

構文: public inline std::future< void > StopKeywordRecognitionAsync ( );

認識キーワード (keyword)停止します。

戻り値

操作を開始する非同期操作。

ListenOnceAsync

構文: public inline std::future< std::shared_ptr< SpeechRecognitionResult > > ListenOnceAsync ( );

最初の発話の後に終了するリッスン セッションを開始します。

戻り値

操作を開始する非同期操作。

StopListeningAsync

構文: public inline std::future< void > StopListeningAsync ( );

アクティブなリスニング操作が直ちに終了し、進行中の話し声を中断するように要求し、これまでにキャプチャされたオーディオ データを反映した結果を提供します。

戻り値

アクティブなリッスン セッションを停止する非同期操作を表すタスク。

SetAuthorizationToken

構文: public inline void SetAuthorizationToken ( const std::string & token );

サービスへの接続に使用する承認トークンを設定します。 注: 呼び出し元は、承認トークンが有効であることを確認する必要があります。 認証トークンの有効期限が切れる前に、呼び出し元は、新しい有効なトークンを使用してこのセッターを呼び出すことによって、認証トークンを更新する必要があります。 そうしないと、コネクタの操作中にエラーが発生します。

パラメーター

  • token 承認トークン。

GetAuthorizationToken

構文: public inline std::string GetAuthorizationToken ( );

承認トークンを取得します。

戻り値

承認トークン

SetSpeechActivityTemplate

構文: public inline void SetSpeechActivityTemplate ( const std::string & activityTemplate );

次の会話用に音声サービスに提供される JSON テンプレートを設定します。 サービスは、音声テキスト変換の結果の場合と同様に、SendActivityAsync を使用してクライアントによって生成されたか、サービスによって生成されたかにかかわらず、ダイアログ バックエンドに送信されるすべてのアクティビティにこのテンプレートをマージしようとします。

パラメーター

  • activityTemplate 適用可能なすべてのアクティビティ メッセージにマージされる JSON 文字列としてのアクティビティ ペイロード。

GetSpeechActivityTemplate

構文: public inline std::string GetSpeechActivityTemplate ( );

次の会話用に音声サービスに提供される JSON テンプレートを取得します。 サービスは、音声テキスト変換の結果の場合と同様に、クライアントが SendActivityAsync を使用するか、サービスによって生成されたかに関係なく、ダイアログ バックエンドに送信されるすべてのアクティビティにこのテンプレートをマージしようとします。

戻り値

現在、後続の要求で使用される JSON アクティビティ テンプレートが設定されています。

FromConfig

構文: public inline static std::shared_ptr< DialogServiceConnector > FromConfig ( std::shared_ptr< DialogServiceConfig > connectorConfig , std::shared_ptr< Audio::AudioConfig > audioConfig );

DialogServiceConfigAudio::AudioConfig からダイアログ サービス コネクタを作成します。 ユーザーは、この関数を使用してダイアログ サービス コネクタを作成する必要があります。

パラメーター

  • connectorConfig ダイアログ サービスの構成。

  • audioConfig オーディオ構成。

戻り値

作成されたダイアログ サービス コネクタの共有スマート ポインター。

auto audioConfig = [Audio::AudioConfig::FromDefaultMicrophoneInput](audio-audioconfig.md#fromdefaultmicrophoneinput)();
auto config = [CustomCommandsConfig::FromAuthorizationToken](dialog-customcommandsconfig.md#fromauthorizationtoken)("my_app_id","my_auth_token", "my_region");
auto connector = [DialogServiceConnector::FromConfig](#fromconfig)(config, audioConfig);

DialogServiceConfig と言えば、それを継承するクラスの 1 つを参照しています。 使用する特定のクラスは、使用されているダイアログ バックエンドによって異なります。