
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
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
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.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.