Commit Graph

1183 Commits (mark-ii/ignore-build-files)

Author SHA1 Message Date
Kris Gesling e75a05557b docstring cleanup 2021-05-11 15:10:32 +09:30
Kris Gesling 27cf725411 Merge branch 'dev' into feature/mark-2 2021-05-10 07:22:45 +09:30
Kris Gesling 6327ac5dbb
Upgrade Lingua Franca to v0.4.1 (#2890)
**Update Lingua Franca to v0.4.1**

The update from Lingua Franca v0.2.x to v0.4.x includes few
breaking changes.
- Some API methods have been updated.
- Mycroft-core tests have been updated to reflect improvements in
  Lingua Franca's formatting and parsing.
- add LF default lang setting method to config.locale 
  including warning that this method will change in the future
- Add TODO's for 21.08 - moving more methods to LF
- simplify loading and setting default of languages in Skills service
- Remove unneeded wrappers for Lingua Franca functions
- Fix documentation of format and parse utils
- Fix test warnings
2021-05-08 08:34:02 +09:30
Kris Gesling 088f563ad9
Merge pull request #2892 from MycroftAI/bugfix/consistent-temp-dir
Replace hardcoded use of /tmp directory
2021-05-08 07:28:27 +09:30
Ken Smith 249e352f65 Add Common Play to active Skills when invoked 2021-05-07 14:25:28 +09:30
Kris Gesling dc4c146f69 Fix assigning of queue without existing loader 2021-05-06 10:11:39 +09:30
Ken Smith 3e6a2a4aa4 companion to news skill branch fix_no_stop 2021-05-04 07:32:08 -04:00
Kris Gesling 0fb90edd28 Rename to get_temp_path and add docstring 2021-04-30 16:49:59 +09:30
dzekem christa 7765d11224 ran autopep8 2021-04-30 14:48:15 +09:30
dzekem christa 3f745c52ad created temp path function 2021-04-30 14:47:49 +09:30
dzekem christa 621b4ab650 spaces added and uniformity in code 2021-04-30 14:46:36 +09:30
dzekem christa 9252158829 rectified pep8 issues 2021-04-30 14:46:36 +09:30
dzekem christa 32f666edd4 Issue-2727 - fixing hard coded /tmp 2021-04-30 14:46:36 +09:30
dzekem christa a174c3c822 replaced hard coded /tmp 2021-04-30 14:46:36 +09:30
Kris Gesling 6f1e708f34 Merge branch 'dev' into feature/mark-2 2021-03-31 21:38:16 +09:30
Kris Gesling 356288a38f
Merge pull request #2863 from forslund/feature/mycroft-bus-client
Utilize the mycroft-messagebus-client module
2021-03-31 21:22:31 +09:30
Åke Forslund 9acf5b7592 Utilize the mycroft-messagebus-client module
This utilizes the shared messagebus client implemented in the
mycroft-messagebus-client.
2021-03-22 06:31:50 +01:00
Kris Gesling cee879e7a4 Add exact optional param to voc_match
This adds the option to require an exact match of vocab. It sourced
from the Playback Control Skill.
2021-03-16 16:05:06 +09:30
Chris Veilleux 8453e79900 Merge remote-tracking branch 'origin/dev' into feature/mark-2
# Conflicts:
#	mycroft/tts/tts.py
2021-03-15 18:47:32 -05:00
Kris Gesling 0587c5d75e
Merge pull request #2856 from forslund/bugfix/stray-print
Remove stray print
2021-03-15 12:24:28 +09:30
Åke Forslund 29fd50324b Remove stray print 2021-03-14 09:32:45 +01:00
Kris Gesling a399b19fd6
Merge pull request #2849 from forslund/refactor/clean-intent-service
Remove intent-service backwards compatibilities
2021-03-11 15:26:26 +09:30
Kris Gesling ec00631c4b
Merge pull request #2813 from NeonAndrii/feature/issue-2812
Issue-2812 - Allow overridden converse methods to accept messages
2021-03-11 15:25:24 +09:30
Kris Gesling 3679eb1355
Merge pull request #2838 from forslund/test/get_response-tests
get response tests
2021-03-10 23:44:48 +09:30
Kris Gesling db79748faa
Merge pull request #2827 from MycroftAI/feature/converse-error-skill
add skill_id to converse error msg
2021-03-10 23:39:29 +09:30
Åke Forslund 203e1fc740 Remove intent-service backwards compatibility
- Remove unused ContextManager import from mycroft.skills.intent_service
- Remove Old 'intent_failure' -> fallback handler
- Remove handling of fallback messages without the fallback_range
parameter
2021-03-07 12:59:59 +01:00
Kris Gesling 17dbaa2b38
Merge pull request #2840 from DiegoAsterio/bugfix/issue-2750
Issue-2750 - Remove log pollution
2021-03-03 15:25:21 +09:30
Åke 492bd22179
Merge pull request #2843 from OpenVoiceOS/fix/padatious_mess
Remove old Padatious class
2021-03-02 11:38:46 +01:00
Chris Veilleux d4d7340f3a changed the list of Raspberry Pi platforms to replace "mycroft_mark_2pi" with "mycroft_mark_2" 2021-03-01 18:20:19 -06:00
Chris Veilleux 6ed674bd3e Merge remote-tracking branch 'origin/dev' into feature/mark-2
# Conflicts:
#	mycroft/audio/__main__.py
#	mycroft/client/speech/__main__.py
#	mycroft/skills/__main__.py
#	mycroft/util/process_utils.py
2021-02-26 11:49:30 -06:00
neonandrii d69b61afb6 Issue-2812 - Allow overridden converse methods to accept messages - FIX: PEP8-line-too-long issue in MycroftSkill.converse - change required signature in MycroftSkill.converse(). 2021-02-23 14:44:12 +02:00
jarbasal 4200a38496 remove old padatious file 2021-02-18 17:19:28 +00:00
Diego Asterio 130d517f30 Issue-2750 - Remove log pollution
Add empty skill directories to a set and remove them whenever they are
no longer empty. Empty skill directories only appear once in the log.

==== Fixed Issues ====
log polution - #2750
2021-02-15 13:38:38 +01:00
Åke Forslund 3a6ca30b33 Fix selecting last opt by number in ask_selection()
Fix off by one issue preventing the last option to be selected by
number.
2021-02-14 17:19:31 +01:00
Kris Gesling 5ca342621d add skill_id to error msg 2021-02-08 16:57:07 +09:30
Åke Forslund 7f3b4e1795 Add skill_api_method decorator
The api methods are now much easier to use, almost transparent. The
current caveat is that only "standarad" python types are acceptable
(int, float, str, list, bool, None) due to the json serialization.

- api methods are now created with the skill_api_method decorator
- both arguments and keyword arguments are sent to the api method
instead of the message object
- api methods now uses a normal return statement instead of having to
handle creating response messages on the bus.

For example if the datetime skill wants to make the datetime string
fetchable simply add the skill_api_method decorator to the
get_display_date method.

    @skill_api_method
    def get_display_date(self, day=None, location=None):
        """Returns the date and time as a string."""
        [...]

The methods return value will be sent back to the caller and can be used
from a skill through

        datetime = SkillApi.get('mycroft-date-time.mycroftai')
        self.log.info(datetime.get_display_date())
2021-02-06 17:57:19 +01:00
Åke Forslund df02bf22b4 Add skill api.
The skill api allows skills to define a public api which can easily be
accessed by other skills over the message bus just as easy as working
with a normal object.

The skill api object is generated from the skill's public_api property. It's a dict where each key is turned into a method on the api object. The method is defined as
  "api_method": {
    "type": message type string
    "func": handler method
    "help": help string for cli
  }

Example skill:

class Test2(MycroftSkill):
    def __init__(self):
        MycroftSkill.__init__(self)
        self.public_api = {
            'speak': {
                'type': 't2.speak',
                'func': self.handle_speak,
                'help': 'speak the test sentence\nand another line\n\nlast'
            },
            'speak2': {
                'type': 't2.speak2',
                'func': self.handle_speak2,
                'help': 'speak the other sentence'
            }
        }

    def handle_speak(self, message):
        self.speak('This is a test')
        self.bus.emit(message.response(data=None))

    def handle_speak2(self, message):
        self.speak('This is another test')
        self.bus.emit(message.response(data=None))
2021-02-06 17:55:34 +01:00
Kris Gesling 688d1fe438 Reorder operations to ensure removed Skills are first unloaded.
Prevents SkillManager from attempting to reload a Skill that has
just been removed from the system which results in a
FileNotFoundError

Fixes #2822
2021-02-04 11:56:29 +09:30
Åke Forslund b595f6cdad Always use the plural "Skills" for the service
Change all strings referring to the service to use "Skills service"
2021-01-28 17:24:21 +01:00
Åke Forslund 94d5e34fd0 Add started and alive hooks to skills process 2021-01-28 17:24:21 +01:00
Kris Gesling 8a1ee0e106 Move ready check to enclosure; use ProcessStatus
Previously Mycroft reported mycroft.ready when Padatious had
finished it's first training run. This check has been shifted
to the enclosure service, and starts checking once the Padatious
training is complete.

Currently checks on readiness of audio, speech and skills services.
2021-01-28 17:24:21 +01:00
Kris Gesling 1273425799 add ProcessStatus to key services 2021-01-28 17:24:21 +01:00
Kris Gesling cc3bf5b45a Change names for consistency 2021-01-28 17:21:33 +01:00
Åke Forslund bea1f008c6 Add ProcessStatus class
ProcessStatus tracks the process status and allows callbacks on changes
and status queries over the messagebus.

StatusCallbackMap is used to setup the callbacks

ProcessState is an enum tracking the different states.
2021-01-28 17:21:33 +01:00
neonandrii fb84658e5d Issue-2812 - Allow overridden converse methods to accept messages - FIX: PEP8-line-too-long issue in MycroftSkill.converse 2021-01-26 19:27:33 +02:00
neonandrii 171b266ec1 Issue-2812 - Allow overridden converse methods to accept messages - modified the signature check in SkillManager.handle_converse_request and MycroftSkill.converse, and resolving PEP8 issues 2021-01-25 21:00:06 +02:00
neonandrii aca69203e6 Issue-2812 - Allow overridden converse methods to accept messages - modified the signature check in SkillManager.handle_converse_request and MycroftSkill.converse, and resolving PEP8 issues 2021-01-25 20:59:30 +02:00
neonandrii ba7b2795ec Issue-2812 - Allow overridden converse methods to accept messages - adding default message=None to MycroftSkill.converse and changing the signature check in the skill manager. 2021-01-22 17:20:48 +02:00
neonandrii 416eebfee7 Issue-2812 - Allow overridden converse methods to accept messages - adding default message=None to MycroftSkill.converse and changing the signature check in the skill manager. 2021-01-22 17:16:22 +02:00
neonandrii 3dca3a488a Issue-2812 - Allow overridden converse methods to accept messages 2021-01-21 11:26:46 +02:00
Kris Gesling ad32a7a873 move bus connect method to process_utils 2021-01-11 16:57:25 +09:30
Kris Gesling 960f650c88 Skills service to use common bus client method 2021-01-11 16:57:25 +09:30
Kris Gesling 54eac52b11 merge dev into mark-2 branch 2021-01-06 22:17:25 +09:30
Kris Gesling 013726e5bc
Merge pull request #2785 from timgates42/bugfix_typo_returns
docs: fix simple typo, retruns -> returns
2021-01-05 12:07:15 +09:30
Kris Gesling 81bd4f3468
Merge pull request #2707 from forslund/feature/remote-startup-on-change
Fix remote settings overwrite at startup
2021-01-05 10:10:40 +09:30
JarbasAI f1d7141bf2
fix/intent_api (#2786)
* fix/fix/intent_api

* get active skills

* fix/intent_api

* fix/intent_api

* typos

Co-authored-by: jarbasal <jarbasai@mailfence.com>
2020-12-31 12:56:44 +09:30
Åke Forslund bd19d1673c Fix remote settings overwrite at startup
Mycroft always mangeled any local settings changes at startup.

This caches the last settings from home on disk and only updates skills
_if_ there is a change.

This means that as if a member is changed locally (manually edited or
changed by the skill itself) it will be kept until another change is made
to the skill on Home.
2020-12-29 23:03:21 +01:00
Kris Gesling fd5c8bb5e3 Merge branch 'dev' into feature/mark-2 2020-12-29 14:31:09 +09:30
Tim Gates 66270c3cd7
docs: fix simple typo, retruns -> returns
There is a small typo in mycroft/skills/skill_data.py.

Should read `returns` rather than `retruns`.
2020-12-24 08:18:14 +11:00
Kris Gesling b0884301a3
Merge pull request #2734 from MycroftAI/feat/skill_settings_sync
skill settings sync flag
2020-12-02 10:45:45 +09:30
jarbasal 4c84f66e15 skill settings sync flag 2020-12-01 23:56:15 +11:00
Åke Forslund eb78d67ff7 Fix AdaptIntent without name. 2020-11-24 10:49:04 +01:00
Kris Gesling 12401b8b59
Merge pull request #2666 from MycroftAI/feat/extend_timeout
cps extend timeout
2020-11-15 10:52:16 +09:30
Kris Gesling f2b7b0251b
Merge pull request #2757 from forslund/feature/ready-check
Feature: add Process Status and ensure all services ready
2020-11-12 09:16:43 +09:30
Åke Forslund 731de16d1f Properly fix readthedocs issue with yaml 2020-11-06 07:29:12 +01:00
Kris Gesling 0258009857
Merge pull request #2737 from MycroftAI/feat/appstore_warning
msm appstore warning
2020-10-28 16:13:18 +09:30
jarbasal 8b7a45d02f msm appstore warning 2020-10-26 16:44:52 +00:00
Kris Gesling 3ca15e9bb7 ensure load_status is initialized on load failure 2020-10-26 16:18:20 +09:30
Åke Forslund 6eeeefb0ac Always use the plural "Skills" for the service
Change all strings referring to the service to use "Skills service"
2020-09-27 09:58:08 +02:00
Åke Forslund 225ece7737 Add started and alive hooks to skills process 2020-09-27 09:58:08 +02:00
Kris Gesling 582faab843 Move ready check to enclosure; use ProcessStatus
Previously Mycroft reported mycroft.ready when Padatious had
finished it's first training run. This check has been shifted
to the enclosure service, and starts checking once the Padatious
training is complete.

Currently checks on readiness of audio, speech and skills services.
2020-09-27 09:58:02 +02:00
Kris Gesling 5e8474cd72 Add optional message argument
When called over the messagebus the message is passed to the handler,
thereby throwing a TypeError as it wasn't expecting 2 positional args.
2020-09-25 15:55:42 +09:30
Kris Gesling e9add604fd add ProcessStatus to key services 2020-09-25 06:52:27 +02:00
Kris Gesling fa0b0dbd41 Change names for consistency 2020-09-25 06:52:25 +02:00
Åke Forslund 633dea1ac5 Add ProcessStatus class
ProcessStatus tracks the process status and allows callbacks on changes
and status queries over the messagebus.

StatusCallbackMap is used to setup the callbacks

ProcessState is an enum tracking the different states.
2020-09-25 06:51:20 +02:00
Kris Gesling ae72ebd247
Merge pull request #2599 from forslund/refactor/intent-service
Refactor intent service
2020-09-23 10:24:16 +09:30
Kris Gesling 571e6d3e61
Merge pull request #2659 from forslund/feature/detect-bad-modification-times
Don't reload skill if a mod time is in the future
2020-09-22 20:55:35 +09:30
jarbasal 7e1e3e4bc2 extend timeout 2020-09-20 21:38:33 +01:00
katridi a185a9a4bf
Issue-2567 - Fixing not initialized dialog_render (#2685)
Fixes #2567
2020-09-15 22:10:39 +09:30
Åke Forslund b71bedd471 initialize status members before bus handlers
self._loaded_status was accessed from a message handler, if a message is
received at the precisely wrong time an exception may occur. This fixes
the init order.

Also moves the skill_updater creation to be fore the handlers are
registered.
2020-09-07 06:34:07 +02:00
Åke Forslund 70d9868f84 Don't update if autoupdate is disabled 2020-08-21 14:43:41 +02:00
Kris Gesling 1b64285bd0
Merge pull request #2669 from MycroftAI/remove/converse-error
remove previously deprecated error message
2020-08-21 00:31:17 +00:00
Kris Gesling 519f7e19cd
Merge pull request #2674 from MycroftAI/feat/gui_cps_status
add GUI + PAUSED to track status
2020-08-20 21:28:14 +00:00
Åke Forslund 988b99b7fe Add missing watchdog argument
Fix retry call to _initialize_skill_manager() when Msm cache doesn't exist locally.
2020-08-20 21:22:55 +02:00
jarbasal a8e9af8505 add GUI, skill and enclosure to track status 2020-08-20 17:44:48 +09:30
Åke Forslund fe4daa2565 Update Query api methods 2020-08-19 18:24:59 +02:00
Kris Gesling 58a5cddbd6 remove previously deprecated error msg 2020-08-18 22:14:32 +09:30
Åke Forslund 10092c3a9e Don't reload skill if a mod time is in the future
This stops a skill from being reloaded repeatedly if a file gets a bad
modification time.

It also logs the offending files in the error message.
2020-08-18 09:52:59 +02:00
Åke Forslund 81570f14e9 WIP fix pylint warnings in context manager 2020-08-14 13:40:16 +02:00
Kris Gesling 8065f5cbee do not call max if files list is empty 2020-08-14 21:05:32 +09:30
Åke Forslund 8089411d93 Fix warnings from pylint in intent_service.py
- Add missing docstrings
- fix short variable names
- restructure return code
2020-08-13 09:28:23 +02:00
Åke Forslund d9281d7795 Handle pylint warnings for padatious_service 2020-08-13 09:28:23 +02:00
Åke Forslund 841ed2dcfc Update for pylint conformity for adapt module
- imports
- All docstring
- AdaptService method warnings
2020-08-13 09:28:23 +02:00
Åke Forslund 618daac9a4 Pair utterances with normalized versions
- Move setting original utterance to the respective intent service
- Remove botch limiting the intent service to a single STT hypothesis
2020-08-13 09:28:18 +02:00
Åke Forslund 917127638b Remove workaround for adapt one_of intents
This issue was properly fixed in Adapt 0.3.5.
2020-08-13 08:18:55 +02:00
Åke Forslund 008ab372fd FallbackService encapsulating fallback calls 2020-08-13 08:18:51 +02:00
Åke Forslund bb8d4e3c1f Generalization of intent service Episode IV
Simplify the handle_utterance into a list of intent matching functions
run in order until a match is found.

The resolution order is

- Converse
- Padatious High Confidence
- Adapt
- Fallback High priority
- Padatious Medium Confidence
- Fallback Medium priority
- Padatious Last ditch effore
- Fallback Low priority

This collects the many parts of where intent is handled into a single
location handling the entire flow.

The idea is that, in the end, all the skill calling should be done from
this method. The main intent parsers does this but the converse and
fallback still calls directly.
2020-08-13 08:12:53 +02:00
Åke Forslund b52cc55f25 Add support for ranges of fallbacks
If no range is provided it defaults to 0-100 to be backwards compatible
2020-08-13 08:12:53 +02:00
Åke Forslund 4c87bc23d4 Move padatious service to within the IntentService 2020-08-13 08:12:53 +02:00
Åke Forslund e93d23f0df Split out adapt from the intent_service. 2020-08-13 08:12:53 +02:00