Closed (fixed)
Project:
Dialogflow (Api.AI) Webhook
Version:
8.x-2.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Jan 2023 at 15:14 UTC
Updated:
14 Mar 2023 at 10:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gambryIf this is a missing feature, feel free to provide merge request with your suggestion.
Otherwise, you can always subscribe to the
api_ai_webhook_event.requestevent, where you will be able to adjust your response accordingly.If you use chatbot_api_apiai, make sure your event subscriber has got a higher wait than the one in that submodule.
Comment #3
gambryAlso, from a quick look at the code, you should be able to do it from the plugin.
For example with something like:
Let me know. Closing for now.
Comment #4
gambryI triple-checked. Messages are not implemented.
So, I can see 3 options:
DialogFlow\Model\Fulfillment, and overridegetMessages()Comment #5
d0t15t commentedI created patches for the SDK and this module in order to support rich-responses and event-responses. https://github.com/gambry/dialogflow-webhook/pull/1
Comment #7
gambry@dotist thanks for your work. The patch can be accepted as it is, most of the changes are not really needed (all comments, creation of unused variable, dockblock not needed).
This is a risky change of API. If committed, integrations may break until developers upgrade their code.
What about something like
setIntentResponse($data, string $type = 'text') {}, with text being the default. So we make this backcompatible?We need to make sure we don't break things and new code is tested.
I'll comment changes to
gambry/dialogflow-webhookin its own PR.Thanks!
Comment #8
d0t15t commentedThanks for your feedback @gambry, I've updated the function and cleaned up the patch!
Comment #9
gambry@dotist I'll post it in here too, in case you haven't seen it.
Based on your PR, I created this one: https://github.com/gambry/dialogflow-webhook/pull/3
Please have a look if it has got everything you had in mind, so I can merge it and we finish working on this issue.
Thanks!
Comment #10
gambryComment #11
gambryLet's kick tests.
Comment #12
gambryWhile tests run, a bit of documentation.
There are two main ways custom payload or event can be added to the fulfilment:
$this->response->getFulfillment()->addMessage()$this->response->setIntentRespose()Comment #13
gambryComment #14
gambryFixing the test.
Comment #16
gambryFixed! Thanks a lot!