
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
botbuilder-calling-speech
Advanced tools
Dialog extensions for botbuilder-calling to manage speech-to-text and language understanding
npm install --save botbuilder-calling-speech
npm install --save botbuilder-calling cognitive-speech-client cognitive-luis-client
Use the static methods of SpeechDialog
to prompt the caller to either understandSpeech()
(speech-to-text and LUIS) or recognizeSpeech()
(just speech-to-text). These methods extend the functionality of the built in Prompts class.
import { SpeechDialog, speechLibrary } from 'botbuilder-calling-speech';
import { UniversalCallBot } from 'botbuilder-calling';
import { SpeechAuthClient, SpeechClient, SpeechResult } from 'cognitive-speech-client';
import { LuisClient, LuisResult } from 'cognitive-luis-client';
// your bot
const bot = new UniversalCallBot(/* params */);
// cognitive apis
const speechClient = new SpeechClient(new SpeechAuthClient('key'));
const luisClient = new LuisClient('appId', 'key');
// attach attach speech library to your bot
bot.library(speechLibrary(speechClient, luisClient));
// use SpeechDialog to prompt for a recording and process it
bot.dialog('/', [
(session: CallSession, args, next) => {
// speech-to-text and language understanding
SpeechDialog.understandSpeech(session, 'Where do you want to go today?');
// just speech-to-text
// SpeechDialog.recognizeSpeech(session, 'Where do you want to go today?');
},
(session: CallSession, args, next) => {
if (args.error) {
console.error(args.err);
return session.error(args.error);
}
const speech: SpeechResult = args.response.speech;
const luis: LuisResult = args.response.language;
session.endDialog(`You said ${speech.header.name}, with intent ${luis.topScoringIntent.intent} and ${luis.entities.length} entities`);
},
]);
Use a LuisDialog
instance and its triggerAction()
method to automatically call a dialog when a certain intent is recognized by LUIS.
import { IUnderstandRecording, LuisDialog } from 'botbuilder-calling-speech';
bot.dialog('myIntentDialog', new LuisDialog([
(session, args: IUnderstandRecording, next) => {
session.endDialog('Your order is shipping soon!');
},
]).triggerAction({
match: 'intent.order.status',
threshold: 0.8, // optional
}));
Note Automatic dialog mapping only occurs for prompts initiated by
SpeechDialog.understandSpeech()
.
const bcs = require('botbuilder-calling-speech');
const bc = require('botbuilder-calling');
const csc = require('cognitive-speech-client');
const clc = require('cognitive-luis-client');
// your bot
const bot = new bc.UniversalCallBot(/* params */);
// cognitive apis
const speechClient = new csc.SpeechClient(new SpeechAuthClient('key'));
const luisClient = new clc.LuisClient('appId', 'key');
// attach attach speech library to your bot
bot.library(bcs.speechLibrary(speechClient, luisClient));
// see TypeScript section for examples of bcs.SpeechDialog prompts
Use the static SpeechDialog
functions just like you would use the static Prompt
functions from botbuilder-calling
.
SpeechClient
.
CallSession
objectstring
. May be any prompt recognized by -Prompts.record()from
botbuilder-calling`IRecordPromptOptions
object from botbuilder-calling
SpeechClient
and LuisClient
.
CallSession
objectstring
. May be any prompt recognized by - rompts.record()from
botbuilder-calling`IRecordPromptOptions
object from botbuilder-calling
Wrap a dialog around a specific LUIS intent
Dialog|IDialogWaterfallStep[]|IDialogWaterfallStep
that will handle the intentFAQs
Dialog extensions for botbuilder-calling to manage speech-to-text and language understanding
The npm package botbuilder-calling-speech receives a total of 7 weekly downloads. As such, botbuilder-calling-speech popularity was classified as not popular.
We found that botbuilder-calling-speech demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.