Alexa multipart prompt skill voice test Issue - alexa-skill

I am trying to build a new simple re-prompt skill to plan a trip. Its working fine when testing on developer test via text command but on https://echosim.io, It responds only to 1st time after that the response is "Sorry I don't know that" all the time. Please suggest me what's wrong I am doing.
My Skill JSON
{"interactionModel":{"languageModel":{"invocationName":"plan a short trip","intents":[{"name":"AMAZON.CancelIntent","samples":["Ghuso","abort","Cancel"]},{"name":"AMAZON.HelpIntent","samples":["Help me","Suggest me","Help"]},{"name":"AMAZON.StopIntent","samples":["Fuck off","do not proceed","quit","abort","exit","stop"]},{"name":"planMyTrip","slots":[{"name":"toCity","type":"IN_City","samples":["I'm planning to go to {toCity} on {travelDate} from {fromCity} for {activity}","I'm planning to go to {toCity} on {travelDate} for {activity}","I'm planning to go to {toCity} on {travelDate} from {fromCity} ","I'm planning to go to {toCity} on {travelDate}","I'm planning to go to {toCity}","I'll go to {toCity}","I would like to go to {toCity}","{toCity}"]},{"name":"travelDate","type":"AMAZON.DATE","samples":["I'll leave on {travelDate} for {activity}","I'll leave on {travelDate} for {activity} from {fromCity}","I'll leave on {travelDate} for {activity} from {fromCity} to {toCity}","I'll leave on {travelDate} for {activity} to {toCity}","I'll leave on {travelDate} for {activity} to {toCity} from {fromCity}","I'll leave on {travelDate} from {fromCity}","I'll leave on {travelDate} from {fromCity} to {toCity}","I'll leave on {travelDate} from {fromCity} to {toCity} for {activity}","I'll leave on {travelDate} from {fromCity} for {activity}","I'll leave on {travelDate} to {toCity}","I'll leave on {travelDate} to {toCity} from {fromCity}","I'll leave on {travelDate} to {toCity} from {fromCity} for {activity}","I'll leave on {travelDate} to {toCity} for {activity}","I'll leave on {travelDate}","I'm planning to leave on {travelDate} for {activity}","I'm planning to leave on {travelDate} for {activity} from {fromCity}","I'm planning to leave on {travelDate} for {activity} from {fromCity} to {toCity}","I'm planning to leave on {travelDate} for {activity} to {toCity}","I'm planning to leave on {travelDate} for {activity} to {toCity} from {fromCity}","I'm planning to leave on {travelDate} from {fromCity}","I'm planning to leave on {travelDate} from {fromCity} to {toCity}","I'm planning to leave on {travelDate} from {fromCity} to {toCity} for {activity}","I'm planning to leave on {travelDate} from {fromCity} for {activity}","I'm planning to leave on {travelDate} to {toCity}","I'm planning to leave on {travelDate} to {toCity} from {fromCity}","I'm planning to leave on {travelDate} to {toCity} from {fromCity} for {activity}","I'm planning to leave on {travelDate} to {toCity} for {activity}","I'm planning to leave on {travelDate}","I would like to leave on {travelDate} for {activity}","I would like to leave on {travelDate} for {activity} from {fromCity}","I would like to leave on {travelDate} for {activity} from {fromCity} to {toCity}","I would like to leave on {travelDate} for {activity} to {toCity}","I would like to leave on {travelDate} for {activity} to {toCity} from {fromCity}","I would like to leave on {travelDate} from {fromCity}","I would like to leave on {travelDate} from {fromCity} to {toCity}","I would like to leave on {travelDate} from {fromCity} to {toCity} for {activity}","I would like to leave on {travelDate} from {fromCity} for {activity}","I would like to leave on {travelDate} to {toCity}","I would like to leave on {travelDate} to {toCity} from {fromCity}","I would like to leave on {travelDate} to {toCity} from {fromCity} for {activity}","I would like to leave on {travelDate} to {toCity} for {activity}","I would like to leave on {travelDate}","{travelDate}"]},{"name":"fromCity","type":"IN_City","samples":["I'll start my journey from {fromCity} to {toCity} for {activity}","I'll start my journey from {fromCity}","I'll start my journey from {fromCity} to {toCity}","I'll start my journey from {fromCity} to {toCity} on {travelDate}","I'll start my journey from {fromCity} to {toCity} on {travelDate} for {activity}","I'll catch train from {fromCity}","I'll start my trip from {fromCity} to {toCity} on {travelDate} for {activity}","I'll start my trip from {fromCity} to {toCity} for {activity}","I'll start my trip from {fromCity} to {toCity} on {travelDate}","I'll start my trip from {fromCity} to {toCity}","I'll start my travel from {fromCity}","I'll start my trip from {fromCity}","I would like to start my journey from {fromCity}","{fromCity}"]},{"name":"activity","type":"Activity_List"}],"samples":["I'll leave on {travelDate} for {activity}","I'll leave on {travelDate} for {activity} from {fromCity}","I'll leave on {travelDate} for {activity} from {fromCity} to {toCity}","I'll leave on {travelDate} for {activity} to {toCity}","I'll leave on {travelDate} for {activity} to {toCity} from {fromCity}","I'll leave on {travelDate} from {fromCity}","I'll leave on {travelDate} from {fromCity} to {toCity}","I'll leave on {travelDate} from {fromCity} to {toCity} for {activity}","I'll leave on {travelDate} from {fromCity} for {activity}","I'll leave on {travelDate} to {toCity}","I'll leave on {travelDate} to {toCity} from {fromCity}","I'll leave on {travelDate} to {toCity} from {fromCity} for {activity}","I'll leave on {travelDate} to {toCity} for {activity}","I'll leave on {travelDate}","I'm planning to leave on {travelDate} for {activity}","I'm planning to leave on {travelDate} for {activity} from {fromCity}","I'm planning to leave on {travelDate} for {activity} from {fromCity} to {toCity}","I'm planning to leave on {travelDate} for {activity} to {toCity}","I'm planning to leave on {travelDate} for {activity} to {toCity} from {fromCity}","I'm planning to leave on {travelDate} from {fromCity}","I'm planning to leave on {travelDate} from {fromCity} to {toCity}","I'm planning to leave on {travelDate} from {fromCity} to {toCity} for {activity}","I'm planning to leave on {travelDate} from {fromCity} for {activity}","I'm planning to leave on {travelDate} to {toCity}","I'm planning to leave on {travelDate} to {toCity} from {fromCity}","I'm planning to leave on {travelDate} to {toCity} from {fromCity} for {activity}","I'm planning to leave on {travelDate} to {toCity} for {activity}","I'm planning to leave on {travelDate}","I would like to leave on {travelDate} for {activity}","I would like to leave on {travelDate} for {activity} from {fromCity}","I would like to leave on {travelDate} for {activity} from {fromCity} to {toCity}","I would like to leave on {travelDate} for {activity} to {toCity}","I would like to leave on {travelDate} for {activity} to {toCity} from {fromCity}","I would like to leave on {travelDate} from {fromCity}","I would like to leave on {travelDate} from {fromCity} to {toCity}","I would like to leave on {travelDate} from {fromCity} to {toCity} for {activity}","I would like to leave on {travelDate} from {fromCity} for {activity}","I would like to leave on {travelDate} to {toCity}","I would like to leave on {travelDate} to {toCity} from {fromCity}","I would like to leave on {travelDate} to {toCity} from {fromCity} for {activity}","I would like to leave on {travelDate} to {toCity} for {activity}","I would like to leave on {travelDate}","I'll start my journey from {fromCity} to {toCity} for {activity}","I'll start my journey from {fromCity}","I'll start my journey from {fromCity} to {toCity}","I'll start my journey from {fromCity} to {toCity} on {travelDate}","I'll start my journey from {fromCity} to {toCity} on {travelDate} for {activity}","I'll catch train from {fromCity}","I'll start my trip from {fromCity} to {toCity} on {travelDate} for {activity}","I'll start my trip from {fromCity} to {toCity} for {activity}","I'll start my trip from {fromCity} to {toCity} on {travelDate}","I'll start my trip from {fromCity} to {toCity}","I'll start my travel from {fromCity}","I'll start my trip from {fromCity}","I would like to start my journey from {fromCity}","I'll leave from {fromCity} to {toCity} on {travelDate} for {activity}","I'll leave to {toCity} on {travelDate}","I'll leave to {toCity}","I'll leave from {fromCity} to {toCity}","I'll leave from {fromCity} to {toCity} on {travelDate}","I'll leave from {fromCity}","I'm thinking to leave to {toCity} from {fromCity} on {travelDate} for {activity}","I'm thinking to leave to {toCity} on {travelDate}","I'm thinking to leave to {toCity} from {fromCity}","I'm thinking to leave to {toCity} from {fromCity} on {travelDate}","I'm thinking to leave to {toCity}","I'm thinking to leave on {travelDate} to {toCity}","I would like to go to {toCity} from {fromCity} on {travelDate} for {activity}","I would like to go to {toCity} on {travelDate} for {activity}","I would like to go to {toCity} for {activity}","I would like to go to {toCity} on {travelDate}","I would like to go to {toCity} from {fromCity} on {travelDate}","I would like to go to {toCity} from {fromCity}","I would like to go to {toCity} from {fromCity} for {activity}","I would like to go to {toCity}"]}],"types":[{"name":"IN_City","values":[{"name":{"value":"Bangaluru","synonyms":["Banglore"]}},{"name":{"value":"Kolkata","synonyms":["Calcutta"]}},{"name":{"value":"Chennai","synonyms":["Madras"]}},{"name":{"value":"Mumbai","synonyms":["Bombay"]}},{"name":{"value":"New Delhi","synonyms":["Nation Capital","Delhi"]}},{"name":{"value":"Banaras","synonyms":["Varansi"]}},{"name":{"value":"Kanpur"}},{"name":{"value":"Gorakhpur"}},{"name":{"value":"Lucknow","synonyms":["State Capital"]}},{"name":{"value":"Gonda","synonyms":["My Place"]}}]},{"name":"Activity_List","values":[{"name":{"value":"Eat panipuri"}},{"name":{"value":"Eat Ice Cream"}},{"name":{"value":"Hiking"}}]}]},"dialog":{"intents":[{"name":"planMyTrip","confirmationRequired":false,"prompts":{},"slots":[{"name":"toCity","type":"IN_City","confirmationRequired":false,"elicitationRequired":true,"prompts":{"elicitation":"Elicit.Slot.1452754453084.1423120820396"}},{"name":"travelDate","type":"AMAZON.DATE","confirmationRequired":false,"elicitationRequired":true,"prompts":{"elicitation":"Elicit.Slot.1452754453084.1050959742258"}},{"name":"fromCity","type":"IN_City","confirmationRequired":false,"elicitationRequired":true,"prompts":{"elicitation":"Elicit.Slot.1452754453084.1184330774841"}},{"name":"activity","type":"Activity_List","confirmationRequired":false,"elicitationRequired":false,"prompts":{}}]}]},"prompts":[{"id":"Elicit.Slot.1452754453084.1423120820396","variations":[{"type":"PlainText","value":"which city you want to go?"},{"type":"PlainText","value":"where would you want to go?"},{"type":"PlainText","value":"Where would you like to go?"},{"type":"PlainText","value":"Let's plan a trip. Where would you like to go?"},{"type":"PlainText","value":"Let me know where you'd like to go?"}]},{"id":"Elicit.Slot.1452754453084.1050959742258","variations":[{"type":"PlainText","value":"when are you planning to leave?"},{"type":"PlainText","value":"when is this trip?"},{"type":"PlainText","value":"When you want to leave?"},{"type":"PlainText","value":"Let me know, when you want to leave?"}]},{"id":"Elicit.Slot.1452754453084.1184330774841","variations":[{"type":"PlainText","value":"where from will you start your travel?"},{"type":"PlainText","value":"where from will you start your trip?"},{"type":"PlainText","value":"Where from you want to start your journey?"},{"type":"PlainText","value":"Let me know, where from you want to start your journey?"}]}]}}
My lambda function
/* eslint-disable func-names */
/* eslint quote-props: ['error', 'consistent']*/
// alexa-cookbook sample code
// There are three sections, Text Strings, Skill Code, and Helper Function(s).
// You can copy and paste the entire file contents as the code for a new Lambda function,
// or copy & paste section #3, the helper function, to the bottom of your existing Lambda code.
// TODO add URL to this entry in the cookbook
// 1. Text strings =====================================================================================================
// Modify these strings and messages to change the behavior of your Lambda function
let speechOutput;
const tripIntro = [
`This sounds like a cool trip. `,
`This will be fun. `,
`Oh, I like this trip. `,
`Oh, I like this trip. `
];
const languageStrings = {
'en': {
translation: {
SKILL_NAME: 'Plan My Trip',
WELCOME_MESSAGE: 'Let\'s plan a trip. Where would you like to go?',
WELCOME_REPROMPT: 'Let me know where you\'d like to go or when you\'d like to go on your trip',
HELP_MESSAGE: 'You can tell me such as, I would like to go to New Delhi or I\'m planning to go to Mumbai or I\'ll go to Kanpur',
HELP_REPROMPT: 'You can say things like, I\'m planning to go to Gonda on Next Saturday.',
STOP_MESSAGE: 'Fir milenge chalte chalte',
NOT_FOUND_MESSAGE: 'I\'m sorry, I currently do not find any thing to serve you.',
NOT_FOUND_REPROMPT: 'What else can I help with?',
},
},
'en-US': {
translation: {
SKILL_NAME: 'Plan My Trip',
WELCOME_MESSAGE: 'Let\'s plan a trip. Where would you like to go?',
WELCOME_REPROMPT: 'Let me know where you\'d like to go or when you\'d like to go on your trip',
HELP_MESSAGE: 'You can tell me such as, I would like to go to New Delhi or I\'m planning to go to Mumbai or I\'ll go to Kanpur',
HELP_REPROMPT: 'You can say things like, I\'m planning to go to Gonda on Next Saturday.',
STOP_MESSAGE: 'Fir milenge chalte chalte',
NOT_FOUND_MESSAGE: 'I\'m sorry, I currently do not find any thing to serve you.',
NOT_FOUND_REPROMPT: 'What else can I help with?',
},
},
'en-IN': {
translation: {
SKILL_NAME: 'Plan My Trip',
WELCOME_MESSAGE: 'Let\'s plan a trip. Where would you like to go?',
WELCOME_REPROMPT: 'Let me know where you\'d like to go or when you\'d like to go on your trip',
HELP_MESSAGE: 'You can tell me such as, I would like to go to New Delhi or I\'m planning to go to Mumbai or I\'ll go to Kanpur',
HELP_REPROMPT: 'You can say things like, I\'m planning to go to Gonda on Next Saturday.',
STOP_MESSAGE: 'Fir milenge chalte chalte',
NOT_FOUND_MESSAGE: 'I\'m sorry, I currently do not find any thing to serve you.',
NOT_FOUND_REPROMPT: 'What else can I help with?',
},
}
};
// 2. Skill Code =======================================================================================================
'use strict';
const Alexa = require('alexa-sdk');
const APP_ID = 'amzn1.ask.skill.4768447b-85d7-4d6b-8d1e-8ae2f49a4e59';
const handlers = {
'LaunchRequest': function () {
this.attributes.speechOutput = this.t('WELCOME_MESSAGE', this.t('SKILL_NAME'));
this.attributes.repromptSpeech = this.t('WELCOME_REPROMPT');
this.response.speak(this.attributes.speechOutput).listen(this.attributes.repromptSpeech);
this.emit(':responseReady');
},
'planMyTrip': function () {
//delegate to Alexa to collect all the required slot values
let filledSlots = delegateSlotCollection.call(this);
//compose speechOutput that simply reads all the collected slot values
speechOutput = randomPhrase(tripIntro);
//activity is optional so we'll add it to the output
//only when we have a valid activity
let travelMode = isSlotValid(this.event.request, `travelMode`);
if (travelMode)
speechOutput += travelMode;
else
speechOutput += `You'll go `;
//Now let's recap the trip
let fromCity = this.event.request.intent.slots.fromCity.value;
let toCity = this.event.request.intent.slots.toCity.value;
let travelDate = this.event.request.intent.slots.travelDate.value;
speechOutput += ` from ${fromCity} to ${toCity} on ${travelDate}`;
let activity = isSlotValid(this.event.request, `activity`);
if (activity)
speechOutput += ` to go ${activity}`;
//say the results
this.response.speak(speechOutput);
this.emit(`:responseReady`);
},
'AMAZON.HelpIntent': function () {
this.attributes.speechOutput = this.t('HELP_MESSAGE');
this.attributes.repromptSpeech = this.t('HELP_REPROMPT');
this.response.speak(this.attributes.speechOutput).listen(this.attributes.repromptSpeech);
this.emit(':responseReady');
},
'AMAZON.CancelIntent': function () {
this.emit('SessionEndedRequest');
},
'AMAZON.StopIntent': function () {
this.emit('SessionEndedRequest');
},
'AMAZON.RepeatIntent': function () {
this.response.speak(this.attributes.speechOutput).listen(this.attributes.repromptSpeech);
this.emit(':responseReady');
},
'SessionEndedRequest': function () {
this.attributes.speechOutput = this.t('STOP_MESSAGE');
this.response.speak(this.attributes.speechOutput);
this.emit(':responseReady');
},
'Unhandled': function () {
this.attributes.speechOutput = this.t('HELP_MESSAGE');
this.attributes.repromptSpeech = this.t('HELP_REPROMPT');
this.response.speak(this.attributes.speechOutput).listen(this.attributes.repromptSpeech);
this.emit(':responseReady');
},
};
exports.handler = (event, context) => {
let alexa = Alexa.handler(event, context);
alexa.appId = APP_ID;
// To enable string internationalization (i18n) features, set a resources object.
alexa.resources = languageStrings;
alexa.registerHandlers(handlers);
alexa.execute();
};
// END of Intent Handlers {} ========================================================================================
// 3. Helper Function =================================================================================================
function delegateSlotCollection(){
console.log(`in delegateSlotCollection`);
console.log(`current dialogState: ${this.event.request.dialogState}`);
if (this.event.request.dialogState === `STARTED`) {
console.log(`in Beginning`);
let updatedIntent = this.event.request.intent;
//optionally pre-fill slots: update the intent object with slot values for which
//you have defaults, then return Dialog.Delegate with this updated intent
// in the updatedIntent property
this.emit(`:delegate`, updatedIntent);
} else if (this.event.request.dialogState !== `COMPLETED`) {
console.log(`in not completed`);
// return a Dialog.Delegate directive with no updatedIntent property.
this.emit(`:delegate`);
} else {
console.log(`in completed`);
console.log(`returning: `+ JSON.stringify(this.event.request.intent));
// Dialog is now complete and all required slots should be filled,
// so call your normal intent handler.
return this.event.request.intent;
}
}
function randomPhrase(array) {
// the argument is an array [] of words or phrases
let i = 0;
i = Math.floor(Math.random() * array.length);
return(array[i]);
}
function isSlotValid(request, slotName){
let slot = request.intent.slots[slotName];
//console.log(`request = `+JSON.stringify(request)); //uncomment if you want to see the request
let slotValue;
//if we have a slot, get the text and store it into speechOutput
if (slot && slot.value) {
//we have a value in the slot
slotValue = slot.value.toLowerCase();
return slotValue;
} else {
//we didn't get a value in the slot.
return false;
}
}

Related

How to pay rent fee when creating solana wallet in nodejs

hello I create solana wallet with the following code on my nodejs server.
const SolanaWeb3 = require("#solana/web3.js");
SolanaWeb3.Keypair.generate();
I don't think this is an active wallet. Because I haven't paid the rent fee for this account.
**So I want to know when is the moment when this inactive account pays the rent fee.
(I want to know if it is activated when a transaction in which sol is deposited into this account occurs, or whether this account should generate a transaction that sends solana to another place.)
And I want to know if there is a javascript function that gives rent fee when account is created.**
thank you for your reply.
To your second question
And I want to know if there is a javascript function that gives rent fee when account is created
Yes there is. Assuming you just want a system account that holds SOL versus an account that has data:
// amount of space to reserve for the account. system accounts are 0 space
const space = 0;
// Get the rent, in lamports, for exemption
const rentExemptionAmount =
await connection.getMinimumBalanceForRentExemption(space);
To your first question
If you already have a funded account (fromKeyPair), you can use that accounts public key to fund the new account you want to create:
const newAccountKeypair = SolanaWeb3.Keypair.generate();
const createAccountParams = {
fromPubkey: fromKeyPair.publicKey,
newAccountPubkey: newAccountKeypair.publicKey,
lamports: rentExemptionAmount,
space,
programId: SolanaWeb3.SystemProgram.programId,
};
const createAccountTransaction = new SolanaWeb3.Transaction().add(
SolanaWeb3.SystemProgram.createAccount(createAccountParams)
);
await SolanaWeb3.sendAndConfirmTransaction(connection, createAccountTransaction, [
fromKeyPair,
newAccountKeypair,
]);

Using the onUpdate function in firebase, how do I pass in information from the front end?

So basically, I have a function that sends a user an email when a room Status becomes "Available"
exports.sendAvailableRoomEmail = functions.firestore.document('rooms/{roomId}/Status').onUpdate(async (snap, context) => {
const newVal = snap.after.data();
const oldVal = snap.before.data();
if(newVal == "Available"){
// send email
}
})
what I need passed into the function is the specific room that the user wants a notification from: {roomId}
How can I pass that specific room only when the user clicks the notify me button right next to it?
The triggers for a Cloud Function needs to be known when you deploy that function. That means you can either trigger for all rooms, or you can trigger for a specific room, but you can't trigger for rooms that meet a dynamic condition such as yours.
The common way to implement the use-case is to query Firestore inside the Cloud Functions code to find if any user need to be notified for the specific room that was updated.

Google meet streaming through MediaRecorder APIs

I am trying to record google meet audio and video using getDisplayMedia using media options.I am able to record my screen through getDisplayMedia but unable to record voice coming in google meet. How can I use passive recording or is there any way where I can record screen, audio and video in google meet through any mechanism or code?
navigator.mediaDevices.getDisplayMedia({audio: true,video: true});
let mediaRecorder = new MediaRecorder(mediaStreamObj);
let chunks = [];
mediaRecorder.start();
console.log(mediaRecorder.state);
mediaRecorder.ondataavailable = function(ev) {
chunks.push(ev.data);
}
setTimeout(function() {
console.log("Stopping!");
mediaRecorder.stop();
console.log(mediaRecorder.state);
mediaRecorder.onstop = (ev) => {
let blob = new Blob(chunks, {
'type': 'video/mp4;'
});
chunks = [];
let videoURL = window.URL.createObjectURL(blob);
console.log(videoURL);
}
}, 40000);
i did it with puppeteer. i build a google meet bot who will join your meetings from google calendar and record audio + save all transcript . when meeting ends everything will be sent over email or you can see in app dashboard.

Use multiple QnA services in one bot

I have multiple QnA services running, each with it's own knowledgeBaseId and subscriptionKey. I want to use them both in a single chatbot and I've written a piece of code which takes the user input and assigns the correct Knowledgebase details. However, I'm unable to get the 2nd QnA service to become active and the bot is linking only to the first service. What might be going wrong here?
Sample code:
var knowledgeId = "FIRST_QNA_SERVICE_KNOWLEDGE_ID";
var subscriptionId = "FIRST_QNA_SERVICE_SUBSCRIPTION_ID";
var bot = new builder.UniversalBot(connector);
var qnarecognizer = new cognitiveservices.QnAMakerRecognizer({
knowledgeBaseId: knowledgeId,
subscriptionKey: subscriptionId,
qnaThreshold:0.3,
top:1});
var intentrecognizer = new builder.IntentDialog();
var intents = new builder.IntentDialog({ recognizers: [intentrecognizer, qnarecognizer] });
bot.dialog('/', intents);
intents.matches('qna', [
function (session, args, next) {
args.entities.forEach(function(element) {
session.send(element.entity);
}, this);
}
]);
intents.matchesAny([/hi/i, /main menu/i], [
function (session) {
builder.Prompts.choice(session, "Hi, What would you like to ask me about?", ["Service1","Service2"],{ listStyle: builder.ListStyle.button});
},
function (session, result) {
var selection = result.response.entity;
switch (selection) {
case "Service1":
knowledgeId = "FIRST_QNA_SERVICE_KNOWLEDGE_ID";
subscriptionId = "FIRST_QNA_SERVICE_SUBSCRIPTION_ID";
session.send('You can now ask me anything about '+selection+'. Type \'main menu\' anytime to choose a different topic.')
session.endConversation();
return
case "Service2":
knowledgeId = "SECOND_QNA_SERVICE_KNOWLEDGE_ID";
subscriptionId = "SECOND_QNA_SERVICE_SUBSCRIPTION_ID";
session.send('You can now ask me anything about '+selection+'. Type \'main menu\' anytime to choose a different topic.')
session.endConversation();
return
}
}
])
You never updated the knowledgeId/subscriptionId on the QnAMakerRecognizer... that's the reason you are always seeing the first QnA service being called.
See if there is a way to update those values in the QnAMakerRecognizer.
Check out if my answer is valid to your purpose on this question:
Multiple QnA Maker services for a single bot
Hope you find it useful.

amqp exchanges are not auto-deleted

I have rabbitmq 3.3.5 running and nodejs project based on amqplib 0.2.1
The problem is that once exchange has been asserted it does not deleted after connection to rabbitmq is closed.
If we start such example
var amqp = require('amqplib');
var when = require('when');
amqp.connect('amqp://localhost').then(function(conn) {
return when(conn.createChannel().then(function(ch) {
var ex = 'logs_new';
var ok = ch.assertExchange(ex, 'fanout', {durable: false, autoDelete: true}})
var message = process.argv.slice(2).join(' ') ||
'info: Hello World!';
return ok.then(function() {
ch.publish(ex, '', new Buffer(message));
console.log(" [x] Sent '%s'", message);
return ch.close();
});
})).ensure(function() { conn.close(); });
}).then(null, console.warn);
and run
#rabbitmqctl list_exchanges
Listing exchanges ...
amq.rabbitmq.log topic
amq.rabbitmq.trace topic
amq.topic topic
logs_new fanout
...done.
Though connection to rabbitmq was closed, but exchange (logs_new) still persists.
How to tell rabbitmq that exchange needs to be deleted if it is not used by any connection ?
edit:
As it is stated at http://www.squaremobius.net/amqp.node/doc/channel_api.html autoDelete option should be 'true'. but nevertheless even exchange with new name is not deleted. What could be wrong?
You should set the auto_delete flag to True when declaring the exchange. This will automatically delete the exchange when all channels are done with it.
Keep in mind that this means that it will stay as long as there is an active binding to the exchange. If you delete the binding, or queue, the exchange will be deleted.
If you need to keep the queue, but not the exchange you can remove the binding once you are done publishing. This should automatically remove the exchange.

Resources