The process is as follows:
- Send a request using the chatbot.
- Trigger the filter.
- Ask the Google API for a result.
- Modify the chatbot context based on the received result.
- Return the context to the chatbot.
- Display a response in the chatbot.
After step 3, you can use the error_log
function to ensure that you are receiving the data you are waiting for. If it’s empty, this means you didn’t receive anything, which will then not impact your context.
If you did receive something, you can add it to the chatbot context so it can use this data when formulating a response.
In the GitHub code, at multiple places, a null value is returned if an error is encountered. If you encounter one of these errors, your context will be null anyway. Make sure this isn’t stemming from here first also.
Hope this helps! ??