本文整理匯總了TypeScript中actions-on-google.DialogflowApp類的典型用法代碼示例。如果您正苦於以下問題:TypeScript DialogflowApp類的具體用法?TypeScript DialogflowApp怎麽用?TypeScript DialogflowApp使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了DialogflowApp類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: testDialogflow
function testDialogflow(request: express.Request, response: express.Response) {
const app = new DialogflowApp({request, response});
const actionMap = new Map();
actionMap.set(app.StandardIntents.MAIN, () => {
const order: Transactions.Order = app.buildOrder('foo');
app.askForTransactionDecision(order, {
type: app.Transactions.PaymentType.PAYMENT_CARD,
displayName: 'VISA-1234',
deliveryAddressRequired: true
});
});
app.handleRequest(actionMap);
}
示例2: DialogflowApp
export const helloWorld = functions.https.onRequest((request, response) => {
console.log('Request headers: ' + JSON.stringify(request.headers));
console.log('Request body: ' + JSON.stringify(request.body));
let dialogApp = new DialogflowApp({ request, response });
function ingredientList(app: DialogflowApp) {
app.tell(`I see you want to know about ${app.getArgument('recipe_name')}`);
}
let actionMap = new Map();
actionMap.set('IngredientList', ingredientList);
dialogApp.handleRequest(actionMap);
});
示例3: ingredientList
function ingredientList(app: DialogflowApp) {
app.tell(`I see you want to know about ${app.getArgument('recipe_name')}`);
}