Commit Graph

13 Commits (dev)

Author SHA1 Message Date
Åke ab242a2c82
Handle multiple intents with the same name (#2921)
* 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
2022-11-23 15:52:56 +09:30
Åke Forslund 693100e8c6 Match keyword entity terms in Mycroft with Adapt
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).
2021-09-26 19:15:17 +02:00
Kris Gesling e75a05557b docstring cleanup 2021-05-11 15:10:32 +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
jarbasal 09cc3f6294 cleanup 2020-02-24 08:23:35 +01:00
jarbasal 74d07f0fdc Fix lang parameter 2020-02-24 08:23:26 +01:00
jarbasal 1e00347834 message fix 2020-02-24 07:46:46 +01:00
jarbasal befab62a58 get_skill from utterance 2020-02-24 07:46:46 +01:00
jarbasal d3037f2ba1 move to intent_service_interface 2020-02-24 07:46:46 +01:00
Åke Forslund 32cfe0d5c4 Fix error enabling/disabling padatious intents
Padatious is still not the greatest at enabling / disabling intents but
it's slightly better.
2019-09-02 18:49:55 +02:00
Åke Forslund c1d07bbe23 Add comments and clean up IntentServiceInterface 2019-08-30 13:00:26 +02:00
Åke Forslund 2d95ed9e35 Move complexity to IntentServiceInterface
Move much of the complex methods for registering intents to the
IntentServiceInterface to reduce bloat of MycroftSkill
2019-08-30 13:00:26 +02:00
Åke Forslund 245a4cb698 Refactor adapt intent data loading routines
- The data loading no longer require the bus
- Add an intent service interface class for better testing
- Update test cases
2019-08-30 13:00:26 +02:00