-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Proposal for functional logic adapter design
Gunther Cox edited this page Oct 2, 2016
·
2 revisions
This is a proposal for the design of a new logic adapter that will make it easier for developers using ChatterBot to add functions that the bot runs when a particular condition is met.
Example
- User: Turn on the lights
- Bot: Sure
def turn_light_on(self):
requests.post('http://localhost:5050/api/lights/', data={'on': True})
class CallbackAdapter(LogicAdapter):
callback_adapter_config=[
'trigger': {
'contains': 'lights',
'commands': ['on', 'off'],
'callable': turn_lights_on
}
]