I am working with Google’s DialogFlow API for building an ChatBot with OpenAI GPT. Basically when the conversation can’t be handled by DialogFlow it will pass the message to OpenAI GPT API so the bot can always respond something relevant.
Process:
-
I created a new API Workflow with POST inputs. Twilio will send al incoming messages to this endpoint.
-
The POST inputs are send to DialogFlow and DialogFlow will either find a match for the conversation or not. Either way DialogFlow responds to the API call made by Wappler with the following schema:
{
“responseId”: “db31e6f8-328f-479f-8d80-621585e9a47d-18dedd3b”,
“queryResult”: {
“queryText”: “hola”,
“action”: “input.welcome”,
“parameters”: {},
“allRequiredParamsPresent”: true,
“fulfillmentText”: “¡Hola!”,
“fulfillmentMessages”: [
{
“text”: {
“text”: [
“¡Hola!”
]
}
}
],
“intent”: {
“name”: “projects/telefonia-di9o/agent/intents/9bc3d7b9-bb9e-41eb-a3e6-edb3548251fa”,
“displayName”: “Default Welcome Intent”
},
“intentDetectionConfidence”: 1,
“languageCode”: “es”
}
}
As you can se there is an action
inside the queryResult
object which I will use to determine the next step. Also there is an array called fulfillmentMessages
which contain text
value that I would like to get and use for further steps.
The problem is that I am not able to access those values. The only way I have been able to get info to a next step is by getting the full response (see attachments).
I have read Server Action Unpacking Nested API JSON results , Is this a bug? Api action json data, i cant format correctly the values of an array and of course the API Connector Docs but can’t isolate the values I want