Commit Graph

29 Commits (c68ad44b1c64b4a81c75053706cb9dcb6026b0fa)

Author SHA1 Message Date
penrods c68ad44b1c Internal documentation, typos, remove misleading message
* Made MycroftSkill.remove_event() return a bool, preventing unnecessary/misleading message from being posted by MycroftSkill.cancel_scheduled_event()
* More doc and several minor renames around intent processing
* Several minor typo and doc corrections
2018-02-13 02:54:12 -06:00
Åke Forslund f88acdb60f Fix converse handling
Fallbacks were triggered even if utterance had been handled by converse.
This checks if converse handled the utterance as well.
2018-01-08 18:01:03 -06:00
Åke Forslund 936bd54180 Add a function to build the standard timing report 2018-01-08 18:01:03 -06:00
Åke Forslund baa15b98aa Send timing metrics for various subsystems
====  Tech Notes ====
STT, intent handling, intent fallbacks, skill handlers are now timed and
tied together with a ident (consistent through the chain so the flow from
STT until completion of the skill handler can be follewed.

TTS execution time is also measured, right now this is not tied into the
ident due to the nature of the speech.

The report is always called "timing" and always contain the following
fields:

- id: Identifier grouping the metrics into interactions
- system: Which part (STT, intent service, skill handler, etc)
- start_time: timestamp for when the action started
- time: how long it took to execute the action

The different system adds their own specific information, for example
the intent_service adds the intent_type, i.e. which handler was matched.

==== Protocol Notes ====
mycroft.skills.loaded is sent togheter with skill id and skill name
whenever a skill is loaded. This is used in the intent_service to
convert from id to skill name when reporting
2018-01-08 18:01:03 -06:00
Åke 742558046d Python 2/3 compatibility (#1259)
Add Python 2/3 compatibility

====  Tech Notes ====
This allows the main bus, skills and cli to be run in both python 2.7 and
3.5+.

Mainly trivial changes
- syntax for exceptions
- logic for importing correct Queue module
- .iteritems -> future.utils.iteritems when accessing dicts key value
pairs

* Allow audio service to be run in python 3
* Make speech client work with python 3
* Importing of Queue version dependent
* Exception syntax corrected
* Creating sound buffer is version dependant
- Adapt context use range from builtins
- Use compatible next() instead of .next() when walking the skill
directory

* Make CLI Python 3 Compatible
- Use compatible BytesIO instead of StringsIO
- Open files as text instead of binary
- Make sure integer divisions are used

* Make messagebus send compatible
* Fix failing travis

Re-add future 0.16.0

* Make string checks compatible
* basestring doesn't exist in python 3 so it's imported from the "past"
* Fix latest compatibility issues in speech client
- handle urllib
- handle encoding before calling md5

* Make Api.build_json() python 2/3 compatible
2017-12-18 17:24:21 -06:00
Matthew D. Scholefield 35d057ff9b Add get_response method as a synchronous alternative to converse 2017-12-07 16:11:35 -06:00
gaurav 3a40014122 Issue-1227 Fix arg =[] and ={}
Issue-1227 fixed line length

Issue-1227 fixed pep 8 E124

Issue-1227 fixed formatting
2017-11-22 23:17:16 -06:00
penrods bf61cae4de Add optional skill announcement message
A Skill can now implement the get_intro_message() method, which can return a
string to be spoken the very first time a skill is run.  This is intended to
be an announcement, such as further steps necessary to setup the skill.

Also stopped generation of the Error message when the expected StopIteration
occurs on a intent failure.  This confused new developers and poluted the logs.

Finally, corrected some documentation typos.
2017-11-09 04:34:00 -06:00
Åke Forslund 92f25f2922 Remove Location as a default context word
====  Tech Notes ====
Location was added as a default context keyword when the context manager
was added as an example of how the context feature could be used.
However in the current greedy implementation in can cause some confusion
with lingering context providing incorrect Location.

The feature can still be turned on in configuration if someone wants to
experiment with it.
2017-10-28 03:21:02 -05:00
Åke Forslund 3e878bd59f Replace ConfigurationManger with Configuration 2017-10-26 19:02:32 -04:00
penrods 8f2e5d9498 Change to Apache 2.0 license from GPLv3.0
This commit officially switches the mycroft-core repository from
GPLv3.0 licensing to Apache 2.0.  All dependencies on GPL'ed code
have been removed and we have contacted all previous contributors
with still-existing code in the repository to agree to this change.

Going forward, all contributors will sign a Contributor License
Agreement (CLA) by visiting https://mycroft.ai/cla, then they will
be included in the Mycroft Project's overall Contributor list,
found at: https://github.com/MycroftAI/contributors.  This cleanly
protects the project, the contributor and all who use the technology
to build upon.

Futher discussion can be found at this blog post:
https://mycroft.ai/blog/right-license/

This commit also removes all __author__="" from the code.  These
lines are painful to maintain and the etiquette surrounding their
maintainence is unclear.  Do you remove a name from the list if the
last line of code the wrote gets replaced?  Etc.  Now all
contributors are publicly acknowledged in the aforementioned repo,
and actual authorship is maintained by Github in a much more
effective and elegant way!

Finally, a few references to "Mycroft AI" were changed to the correct
legal entity name "Mycroft AI Inc."

==== Fixed Issues ====
#403 Update License.md and file headers to Apache 2.0
#400 Update LICENSE.md

====  Documentation Notes ====
Deprecated the ScheduledSkill and ScheduledCRUDSkill classes.
These capabilities have been superceded by the more flexible MycroftSkill
class methods schedule_event(), schedule_repeating_event(), update_event(),
and cancel_event().
2017-10-04 01:28:44 -05:00
Matthew D. Scholefield 5e392f34aa Optimize imports
Remove unused imports and group local vs external alphabetically
2017-09-18 16:07:50 -05:00
Matthew D. Scholefield cfdc405da5 Add new LOG class 2017-09-18 13:56:06 -05:00
Åke Forslund 31701fc05d Add more safety around the context manager
====  Tech Notes ====
- Sanity check Message in handle_add_context(), 'word' needs to be a
string before calling into the context manager.
- Sanity check Message in handle_remove_context(), make sure a context
keyword was received before trying to remove.
- Docstrings
- Suppress exceptions while injecting context
2017-09-13 12:44:35 -05:00
Åke Forslund d746a87e34 Added docstring for update_context
Including note about not working on one_of keywords.
2017-08-31 21:34:30 +02:00
Åke Forslund 7022239456 Fix failure when using one_of in intents
==== Fixed Issues ====
#1022

====  Tech Notes ====
When a one_of intent is hit the intent returned by adapt doesn't look like normal require/optional intent parameters. This PR adds a check for entities before trying to accessing them when trying to update context.

This is a temporary workaround while it's determined if the adapt behaviour is correct or should be modified to conform to the normal format. (See issue 66 in the adapt repo), but in any case it's a good sanity check
2017-08-29 09:05:29 +02:00
Jarbas f04f5107e7 small fix (#1005) Rebase issues with converse method
====  Tech Notes  ====
- Use skill id instead of name
- use time() function correctly
2017-08-21 09:18:01 +02:00
Jarbas d661b8d2e7 Add conversational support to skill system
The most recently used skills now have an opportunity to preview all
utterances before they hit the intent system.

==== Tech Notes ====
Skills get a preview in the order of activation -- most recent first --
and if they can consume the utterance or ignore it. If consumed,
processing stops. If ignored, the next most recent skill gets a shot
at it. Finally, if no skill consumes it the intent system takes over,
running as it always has.

Skills remain "active" for 5 minutes after last use.

A skill achieves this by implementing the converse() method, e.g.

def def converse(self, utterances, lang="en-us"):
    if .... :
        return True  # handled, consume utterance
    else:
        return False  # not for this skill, pass it along
2017-08-17 12:09:17 -05:00
Åke Forslund f19ac28a5c Add some safety to the add/remove context methods
====  Tech Notes ====
Invalid context or word arguments will now raise ValueError
2017-08-15 21:27:19 -05:00
Åke Forslund b1082d4b27 Only use latest meaning of each keyword 2017-08-15 21:27:19 -05:00
Åke Forslund 242770aa94 Update context config options
- options grouped under "context"
- added option to activate "greedy" context gathering
2017-08-15 21:27:19 -05:00
Åke Forslund c9b19cb97e Fix remove_context
Also remove debug prints
2017-08-15 21:27:19 -05:00
Åke Forslund 471a8d8360 Add configuration settings for using adapt's context 2017-08-15 21:27:19 -05:00
Åke Forslund b9a054e669 Manual context injection
A skill can inject context to enable and disable intent handlers
automatically depending on previous conversation.
2017-08-15 21:27:19 -05:00
Matthew D. Scholefield a86f0478a4 Add intent fallback system
Also removes multi utterence intent fail. Only makes sense to emit an intent_failure regardless of the amount of intents
2017-08-03 13:49:02 -05:00
Matthew D. Scholefield 90aff68034 Reverting "Add intent fallback system (#899)"
This is because this will break wolfra alpha skill unless they update
skills, but if they update before getting the new version, it will also
break wolfram

This reverts commit 6ca4161335.
2017-07-14 17:53:42 -05:00
Matthew D. Scholefield 6ca4161335 Add intent fallback system (#899)
* Create new FallbackSkill base class for implementing fallback behavior
Also removes multi utterance intent fail. Only makes sense to emit an intent_failure regardless of the amount of intents
2017-07-14 17:27:26 -05:00
Augusto Monteiro 'Sparky 237827a099 #671 - fixing auto load 2017-04-17 10:26:34 -07:00
Steve Penrod 60abb41fc6 Fix for issue #659, broken git install after recent changes
There are several issues with the changes recently made to break out
Skills from mycroft-core.
* The subdirectory mycroft/skills/intent/ is left behind when you do
  a pull, so the change to core.py that tries to
  "import mycroft.skills.intent" gets confused.  I renamed the file
  intent.py to intent_service.py
* Added a bunch of comments
* Made a bunch of functions "private", using the leading _
* The MSM install was failing.  Still working on that, but we should
  probably make msm.sh a part of mycroft-core instead of its own
  repo.
* Restored some mycroft.conf values that I noticed got lost during
  an automatic merge.
2017-04-14 01:53:29 -07:00