Using createSessionEntityTypes I have created a session entity which is added to already existing entity type if I make use of listSessionEntityTypes I can view the created new entity but if I try with my DialogFlow it's not recognized by it.
As an example: I created an entity named kitchen and now if I try to access it saying "Turn on kitchen light" kitchen is not recognized by the light entitytype.
It is weird because when I use listSessionEntitytypes I see kitchen in that list but my DialogFlow is not recognizing it as Entity when I speak. Here is the code that I am working on:
function createSessionEntityType() {
const sessionEntityTypesClient = new
dialogflow.SessionEntityTypesClient();
const entityType = 'any';
const sessionPath = `sessionpath`;
const sessionEntityTypePath = `sessionentitypath`;
const entities = [{
"value": "Library",
"synonyms": ["Study room"]
}];
const entityOverrideMode = "ENTITY_OVERRIDE_MODE_OVERRIDE";
const sessionEntityTypeRequest = {
parent: sessionPath,
sessionEntityType: {
name: sessionEntityTypePath,
entityOverrideMode: entityOverrideMode,
entities: entities,
},
};
sessionEntityTypesClient
.createSessionEntityType(sessionEntityTypeRequest)
.then(responses => {
console.log('SessionEntityType created:', responses);
});
}