* Add check for duplicate adapt intents
There are two cases, duplicated named intent and duplicated anonymous intent.
A named intent will cause a ValueError exception notifying the skill
author that there is a collision.
An anonymous intent will silently derive a new name and use that
instead of the default generated one.
* Add tests for intent collisions
* Make enable/disable intent handle the new exception
The enable/disable intent did not mark an intent as detached, instead it
remained in the list of intents after disabling in the IntentServiceInterface
to be retrieved when the intent should be re-enabled.
This moves detached intents into a list of detached intents to so they
won't cause the double enable exception.
* Add move logic to find if intent is detached
MycroftSkill.enable_intent() will now check if the intent is detached
before trying to re-enable it.
* Lock updates of intents
This should avoid some race conditions that may occur if multiple
threads tries to enable / disable intents
* Separate tests of LocalConf into new test class
* Do not overwrite configs with malformed json
If a config file is loaded and is invalid saves to that file will not be
possible until it's manually restored. The store accepts a force flag to
override this protection.
The method returns True if the store succeeded so call sites can
verbally report the issue as well.
* fix issues when remote excepts out
* Remove explicit clear_cache from MimicTTS
* Updates for using singleton TTS playback thread
- Cache is called on all tts's registered as using the thread
- Begin audio and end audio is handled by the playback thread
- Further changes from self.playback to TTS.playback for consistency
* Remove redundant try/except
* Consolidate general and TTS-specific sentence splitting
This performs all sentence-splitting at the same stage. This fixes a
subtle issue where a TTS splits a sentence into chunks and throws an
error on only one of those chunks. The fallback would generate a
sentence for the original un-chunked sentence. possibly saying the same
parts twice.
This also pre-compiles the regexes used to speed things up a bit.
Co-authored-by: Ken <ken.smith@mycroft.ai>
This uses the existing dialog renderer and the standard format library
to in two steps create a regex where the {elements} in a dialog is
replaced with ".*" to match the given sentence.
* Check if GUI is connected rather than maintain list of platforms
There are already many Mycroft platforms that have GUIs
and this will only grow. We want to know if the device
has a GUI connected rather than if it is in a pre-defined
list of platforms.
* Create a mock GUI with a settable connected attribute
* [log_format] Add an option to change the log format
Hacing an option to change the log format could be useful when logs
are shipped into an aggregator such as Elasticsearch.
The current format is very hard to parse.
* [log_format] Set default Formatter
Because mycroft.configuration.Configuration() class import LOG class,
a default Formatter have to be defined before import the
mycroft.configuration.Configuration() class.
* Upgrade websocket-client to 1.2.1
core equivalent of https://github.com/MycroftAI/mycroft-messagebus-client/pull/21
There was an incompability with the latest websocket-client and the
messagebus which needed fixing for Linux distro compatibility. Since
messagebus-client was going to depend on websocket-client 1.2.1, let's
do the same in core
* Bump message bus client and tornado versions
New version of the messagebus-client released.
Upgraded Tornado to match new function signature.
* Revert removal of websocket-client
It is still used in the `mycroft.client.text.gui_server`
Should investigate removal of this so that websocket client versions do not need to be
kept in sync between mycroft-core and mycroft-messagebus-client.
Co-authored-by: Kris Gesling <kris.gesling@mycroft.ai>
This changes the internally used names for entities and entity values when
sent on the messagebus and used interanally in the intent service from start / end to entity_value and entity_type.
This makes the terminology easier to understand and follow across into Adapt.
The old terms are still included and usable for compatibility but should be
removed in an upcoming major release (22.02).
This handles a scenario that a message arrives between a call to get_messages() and clear_messages(). clear_messages() will only clear the messages that has been evaluated atleast once.
A new method clear_all_messages() has been added to clear the entire message stack and is used between scenarios to reset the list.
This reverts an unintentional breaking change.
A TTS engine may return a different file path than was requested.
This again uses the returned path but adds a deprecation warning
that this behaviour will no longer be supported in an upcoming release.
Fixes#2929