Amazebot / bbot

An adaptable conversation engine for building bespoke bots.
MIT License
55 stars 2 forks source link

Thought process updates for alpha #68

Closed timkinnane closed 6 years ago

timkinnane commented 6 years ago

Remember process remember checks for prior remembering, as it is used by the final callback on both listen and respond, as respond might be called without a listen.

There could be a more graceful way of handling the thought process completion, like possible using a single interface for all processes. e.g. thought('hear', args)

Then it can add the final piece only once, when used either as thought('hear') or thought('respond'). Could still retain bot.hear and bot.respond as proxies.

Should that also revert usage of bot.listen in place of bot.listenText. Maybe all thought stages should only be called internally and bot accessors are bot.receive and bot.send - for hubot compatibility and since when bot.respond is called directly, its actually unprompted, therefore not a response.

Consider renaming thought-process.ts as just thought.ts too. Move adapter storage check into brain, remember should just call keep.

Consider use of thought for custom contained sets of listeners (e.g. within a scene), might make sense to accept the listeners as arg, but use the 'global' listeners as default. Scenes shouldn't reproduce thought process the way it is in current Playbook.

see https://github.com/Amazebot/bbot/blob/master/src/lib/thought-process.ts#L94