Agent

An agent represent the interface between the user and loaded skills. It maintain the conversation state and use an underlying interpreter to understand the user.

The agent is the entry point which will take raw user inputs with its parse method and call loaded handlers as needed.

Entry point

parse(msg, **meta)

This method will use the agent Interpreter to extract intents and slots from the raw message given by the user.

Note

More information on Meta.

When an intent has been found, it will try to find an handler for this specific intent and call it. It will then manage the conversation, handle cancel and fallback intents and communicate back to the user using its internal Client.

From a skill

From a skill perspective, here are the method you will use.

answer(text, cards=None, **meta)

Answer something to the user.

ask(slot, text, choices=None, **meta)

Ask for a slot value to the user.

done(require_input=False)

Inform the agent that a skill has done its work and it should returns in its asleep state.

context(context_name)

Change the current Context.