keiffster / program-y

Python 3.x based AIML 2.0 Chatbot interpreter, framework, related programs and knowledge files
https://keiffster.github.io/program-y/
Other
348 stars 138 forks source link

postprocess after default response #226

Closed ksenia1997 closed 4 years ago

ksenia1997 commented 5 years ago

Is it possible to start a postprocess if the answer is default response?

In your code I found that postprocesses would start only if the answer was matched. But may be smth exists, how to do it. I would like to do a syntax analysis for getting an answer if nothing was matched. So, after default answer was gotten, I would like to start another processes.

Thanks

keiffster commented 5 years ago

I’ve had a look at the code and there is nothing functionally calling post process in default response

I would need to move the call to after checking if response is empty, then post process and the. Do a final check if the post process was empty and re-assign a default response.

However I think you question could be solved with a new feature that provides ability to call out to an optional extension to handle empty response.

Left me have a more detailed think about his this could work

keiffster commented 4 years ago

This is now in master and will be released in 3.10. I've added unit tests around the processing and storage code. Had to do a minor modification to the brain processing to handle null responses