Public Member Functions | Public Attributes | Private Member Functions | List of all members
mycroft.skills.intent_service.IntentService Class Reference

Public Member Functions

def __init__ (self, bus)
 
def add_active_skill (self, skill_id)
 
def do_converse (self, utterances, skill_id, lang)
 
def get_skill_name (self, skill_id)
 
def handle_add_context (self, message)
 
def handle_clear_context (self, message)
 
def handle_converse_error (self, message)
 
def handle_converse_response (self, message)
 
def handle_detach_intent (self, message)
 
def handle_detach_skill (self, message)
 
def handle_register_intent (self, message)
 
def handle_register_vocab (self, message)
 
def handle_remove_context (self, message)
 
def handle_utterance (self, message)
 
def remove_active_skill (self, skill_id)
 
def reset_converse (self, message)
 
def send_metrics (self, intent, context, stopwatch)
 
def update_context (self, intent)
 
def update_skill_name_dict (self, message)
 

Public Attributes

 active_skills
 
 bus
 
 config
 
 context_greedy
 
 context_keywords
 
 context_manager
 
 context_max_frames
 
 context_timeout
 
 converse_result
 
 converse_skill_id
 
 converse_timeout
 
 engine
 
 skill_names
 
 waiting_for_converse
 

Private Member Functions

def _adapt_intent_match (self, raw_utt, norm_utt, lang)
 
def _converse (self, utterances, lang)
 

Detailed Description

Definition at line 153 of file intent_service.py.

Constructor & Destructor Documentation

def mycroft.skills.intent_service.IntentService.__init__ (   self,
  bus 
)

Definition at line 154 of file intent_service.py.

Member Function Documentation

def mycroft.skills.intent_service.IntentService._adapt_intent_match (   self,
  raw_utt,
  norm_utt,
  lang 
)
private
Run the Adapt engine to search for an matching intent

Args:
    raw_utt (list):  list of utterances
    norm_utt (list): same list of utterances, normalized
    lang (string):   language code, e.g "en-us"

Returns:
    Intent structure, or None if no match was found.

Definition at line 413 of file intent_service.py.

def mycroft.skills.intent_service.IntentService._converse (   self,
  utterances,
  lang 
)
private
Give active skills a chance at the utterance

Args:
    utterances (list):  list of utterances
    lang (string):      4 letter ISO language code

Returns:
    bool: True if converse handled it, False if  no skill processes it

Definition at line 388 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.add_active_skill (   self,
  skill_id 
)

Definition at line 250 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.do_converse (   self,
  utterances,
  skill_id,
  lang 
)

Definition at line 216 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.get_skill_name (   self,
  skill_id 
)
Get skill name from skill ID.

Args:
    skill_id: a skill id as encoded in Intent handlers.

Returns:
    (str) Skill name or the skill id if the skill wasn't found

Definition at line 198 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.handle_add_context (   self,
  message 
)
Add context

Args:
    message: data contains the 'context' item to add
     optionally can include 'word' to be injected as
     an alias for the context item.

Definition at line 484 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.handle_clear_context (   self,
  message 
)
Clears all keywords from context 

Definition at line 515 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.handle_converse_error (   self,
  message 
)

Definition at line 231 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.handle_converse_response (   self,
  message 
)

Definition at line 239 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.handle_detach_intent (   self,
  message 
)

Definition at line 471 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.handle_detach_skill (   self,
  message 
)

Definition at line 477 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.handle_register_intent (   self,
  message 
)

Definition at line 467 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.handle_register_vocab (   self,
  message 
)

Definition at line 456 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.handle_remove_context (   self,
  message 
)
Remove specific context

Args:
    message: data contains the 'context' item to remove

Definition at line 505 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.handle_utterance (   self,
  message 
)
Main entrypoint for handling user utterances with Mycroft skills

Monitor the messagebus for 'recognizer_loop:utterance', typically
generated by a spoken interaction but potentially also from a CLI
or other method of injecting a 'user utterance' into the system.

Utterances then work through this sequence to be handled:
1) Active skills attempt to handle using converse()
2) Padatious high match intents (conf > 0.95)
3) Adapt intent handlers
5) Fallbacks:
   - Padatious near match intents (conf > 0.8)
   - General fallbacks
   - Padatious loose match intents (conf > 0.5)
   - Unknown intent handler

Args:
    message (Message): The messagebus data

Definition at line 295 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.remove_active_skill (   self,
  skill_id 
)

Definition at line 245 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.reset_converse (   self,
  message 
)
Let skills know there was a problem with speech recognition

Definition at line 209 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.send_metrics (   self,
  intent,
  context,
  stopwatch 
)
Send timing metrics to the backend.

NOTE: This only applies to those with Opt In.

Definition at line 276 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.update_context (   self,
  intent 
)
Updates context with keyword from the intent.

NOTE: This method currently won't handle one_of intent keywords
      since it's not using quite the same format as other intent
      keywords. This is under investigation in adapt, PR pending.

Args:
    intent: Intent to scan for keywords

Definition at line 257 of file intent_service.py.

def mycroft.skills.intent_service.IntentService.update_skill_name_dict (   self,
  message 
)
    Messagebus handler, updates dictionary of if to skill name
    conversions.

Definition at line 191 of file intent_service.py.

Member Data Documentation

mycroft.skills.intent_service.IntentService.active_skills

Definition at line 185 of file intent_service.py.

mycroft.skills.intent_service.IntentService.bus

Definition at line 166 of file intent_service.py.

mycroft.skills.intent_service.IntentService.config

Definition at line 155 of file intent_service.py.

mycroft.skills.intent_service.IntentService.context_greedy

Definition at line 164 of file intent_service.py.

mycroft.skills.intent_service.IntentService.context_keywords

Definition at line 161 of file intent_service.py.

mycroft.skills.intent_service.IntentService.context_manager

Definition at line 165 of file intent_service.py.

mycroft.skills.intent_service.IntentService.context_max_frames

Definition at line 162 of file intent_service.py.

mycroft.skills.intent_service.IntentService.context_timeout

Definition at line 163 of file intent_service.py.

mycroft.skills.intent_service.IntentService.converse_result

Definition at line 188 of file intent_service.py.

mycroft.skills.intent_service.IntentService.converse_skill_id

Definition at line 189 of file intent_service.py.

mycroft.skills.intent_service.IntentService.converse_timeout

Definition at line 186 of file intent_service.py.

mycroft.skills.intent_service.IntentService.engine

Definition at line 156 of file intent_service.py.

mycroft.skills.intent_service.IntentService.skill_names

Definition at line 159 of file intent_service.py.

mycroft.skills.intent_service.IntentService.waiting_for_converse

Definition at line 187 of file intent_service.py.


The documentation for this class was generated from the following file:


mycroft_ros
Author(s):
autogenerated on Mon Apr 26 2021 02:35:41