Natural Language Understanding (NLU) library for MK Bot
from mkbot_nlu.utils import Intent, register_intent
@register_intent("command::music::play", "play")
def cmd_play(intent: Intent):
if query := intent.get_an_entity("music_query"):
return f"play {query}"
else:
return "play"
To install dependencies, execute:
poetry install -E full
poetry run pytest