Mycroft Simple¶
Mycroft, made simple
This repository contains experimental code restructing with things like Padatious integration.
Subpackages¶
mycroft.clients package¶
mycroft.clients.mycroft_client module¶
-
class
mycroft.clients.mycroft_client.
MycroftClient
(query_manager)[source]¶ Bases:
object
Provides common behavior like sending and receiving queries Examples clients include the voice client and text client
mycroft.engines package¶
mycroft.engines.intent_engine module¶
-
class
mycroft.engines.intent_engine.
IntentEngine
(path_manager)[source]¶ Bases:
object
Interface for intent engines
-
calc_intents
(query)[source]¶ Run the intent engine to determine the probability of each intent against the query :param query: input sentence as a single string :return: dict of intent: intent_data where
Example return data: { ‘name’: ‘TimeSkill:time.ask’, ‘confidence’: ‘0.65’, ‘matches’: {‘location’: ‘new york’} }
-
-
mycroft.engines.intent_engine.
extract_intent_name
(namespaced_name)[source]¶ Ex. TimeSkill:time.ask -> time.ask
mycroft.engines.padatious_engine module¶
-
class
mycroft.engines.padatious_engine.
PadatiousEngine
(path_manager)[source]¶ Bases:
mycroft.engines.intent_engine.IntentEngine
Interface for Padatious intent engine
-
GIT_BRANCH
= 'feature/mycroft-simple'¶
-
GIT_URL
= 'https://github.com/MatthewScholefield/padatious-mycroft.git'¶
-
HOST
= '127.0.0.1'¶
-
PORT
= 8014¶
-
mycroft.formats package¶
mycroft.formats.dialog_format module¶
-
class
mycroft.formats.dialog_format.
DialogFormat
(path_manager)[source]¶ Bases:
mycroft.formats.mycroft_format.MycroftFormat
Format data into sentences
mycroft.formats.mycroft_format module¶
-
class
mycroft.formats.mycroft_format.
MycroftFormat
(path_manager)[source]¶ Bases:
object
Base class to provide an interface for different types of “formats”
Formats are modes to display key-value data. For instance, the DialogFormat puts data into sentences The EnclosureFormat could put data into visual faceplate animations
mycroft.managers package¶
mycroft.managers.client_manager module¶
mycroft.managers.format_manager module¶
mycroft.managers.intent_manager module¶
-
class
mycroft.managers.intent_manager.
IntentManager
(path_manager)[source]¶ Bases:
object
Used to handle creating both intents and intent engines
-
calc_results
(query)[source]¶ Find the best intent and run the handler to find the results
Parameters: query – input sentence Returns: name, results Rtype name: string (namespaced intent) Rtype results: dict
-
register_fallback
(handler)[source]¶ Register a function to be called as a general knowledge fallback
Parameters: handler – function that receives query and returns a dict of results, one of which is ‘confidence’ note: register_fallback in the MycroftSkill base class automatically manages results
-
register_intent
(skill_name, intent, handler)[source]¶ Register an intent via the corresponding intent engine It tries passing the arguments to each engine until one can interpret it correctly
Parameters: - skill_name –
- intent – argument used to build intent; can be anything
- handler – function that receives intent_data and returns a dict of results note: register_intent in the MycroftSkill base class automatically manages results
Returns: nothing
-
mycroft.managers.path_manager module¶
mycroft.managers.query_manager module¶
mycroft.skills package¶
Subpackages¶
mycroft.skills.mycroft_skill module¶
-
class
mycroft.skills.mycroft_skill.
MycroftSkill
(intent_manager)[source]¶ Bases:
object
Base class for all Mycroft skills
-
add_result
(key, value)[source]¶ - Adds a result from the skill. For example:
- self.add_result(‘time’, ‘11:45 PM’)
- Except, of course, ‘11:45 PM’ would be something generated from an API
- Results can be both general and granular. Another example:
- self.add_result(‘time_seconds’, 23)
-