Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

intent api #2468

Merged
merged 9 commits into from
Feb 24, 2020
Merged

intent api #2468

merged 9 commits into from
Feb 24, 2020

Conversation

JarbasAl
Copy link
Contributor

@JarbasAl JarbasAl commented Feb 3, 2020

IntentAPI, rewrite of #859 + #1351

Allows to query intent service from the messagebus

Usage

from pprint import pprint
from mycroft.intent_service import IntentQueryApi

intents = IntentQueryApi()

# loaded skills
pprint(intents.get_skills_manifest())
pprint(intents.get_active_skills())

# intent parsing
pprint(intents.get_adapt_intent("tell me a joke"))
pprint(intents.get_padatious_intent("tell me a joke"))
pprint(intents.get_intent("create a 10 minutes timer"))  # intent that will trigger

# skill from utterance
pprint(intents.get_skill("say a joke"))
pprint(intents.get_skill("do you rhyme"))

# registered intents
pprint(intents.get_adapt_manifest())
pprint(intents.get_padatious_manifest())
pprint(intents.get_intent_manifest())  # all of the above

# registered vocab
pprint(intents.get_entities_manifest()) # padatious entities / .entity files
pprint(intents.get_vocab_manifest()) # adapt vocab / .voc files
pprint(intents.get_regex_manifest()) # adapt regex / .rx files
pprint(intents.get_keywords_manifest())  # all of the above

@JarbasAl JarbasAl added the Type: Enhancement - proposed New proposal for a feature that is not currently a priority on the roadmap. label Feb 3, 2020
@pep8speaks
Copy link

pep8speaks commented Feb 3, 2020

Hello @JarbasAl! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-02-24 07:24:54 UTC

@devs-mycroft devs-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label Feb 3, 2020
@forslund forslund added the 20.02 label Feb 6, 2020
Copy link
Collaborator

@forslund forslund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some initial comments. In summary

  1. it seems like there could be some simplifications by using the wait_for_response() method when sending a query and getting a response back (but I could be misunderstanding something)

  2. maybe giving the new class a less generic name. I'm thinking of renaming the interface that the MycroftSkill class depends on as well now that there is two...

@forslund
Copy link
Collaborator

This looks good, I rebased and squashed a couple of commits. It'd be great if you could do a followup PR with some docstrings. Thanks!

@forslund forslund merged commit 1afedb2 into MycroftAI:dev Feb 24, 2020
@JarbasAl JarbasAl deleted the feat/intent_api branch November 9, 2020 16:29
@JarbasAl JarbasAl restored the feat/intent_api branch November 9, 2020 16:29
@JarbasAl JarbasAl deleted the feat/intent_api branch November 9, 2020 16:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) Type: Enhancement - proposed New proposal for a feature that is not currently a priority on the roadmap.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants