dialogflow-fulfillment-nodejs
dialogflow-fulfillment-nodejs copied to clipboard
How to create session entities
When using the API directly you can set sessionEntityTypes
to add session entities to the fulfillment. I haven't found a way to do this using dialogflow-fulfillment
@newtonmunene99 did you found how to do it?
No I did not. As this library is no longer maintained, I don't think it will get patched in. I just reverted back to using the api without a wrapper. I started working on an express js wrapper but I'm currently overwhelmed by work and it will take a while before I can finish working on it.
Yeah, thing are a little slow here, I see.
I discovered a way to make it work.
if (agent.requestSource == PLATFORMS.ACTIONS_ON_GOOGLE) {
const conv = agent.conv();
// Add Entities
conv.sessionEntities.add({
name: 'Opportunity',
entities: [
{
value: 'a',
synonyms: ['react']
}
]
});
conv.sessionEntities.send();
}
Calling agent.conv()
you can get the conv
object and it worked like expected.
Anyway, I'm using play with it to see how it works. Thanks, @newtonmunene99 for your quick response.
👍