Commit Graph

33 Commits

Author SHA1 Message Date
Fabio Manganiello 699f92e42b
[assistant] Added `ResponseEndEvent` and `IntentMatchedEvent` 2024-04-14 23:26:59 +02:00
Fabio Manganiello 8082123c58
[assistant.picovoice] Implemented mic mute/unmute handling.
continuous-integration/drone/push Build is passing Details
2024-04-13 20:51:34 +02:00
Fabio Manganiello 6feb824c04
Refactored `AssistantEvent`.
`AssistantEvent.assistant` is now modelled as an opaque object that
behaves the following way:

- The underlying plugin name is saved under `event.args['_assistant']`.

- `event.assistant` is a property that returns the assistant instance
  via `get_plugin`.

- `event.assistant` is reported as a string (plugin qualified name) upon
  event dump.

This allows event hooks to easily use `event.assistant` to interact with
the underlying assistant and easily modify the conversation flow, while
event hook conditions can still be easily modelled as equality
operations between strings.
2024-04-09 00:15:51 +02:00
Fabio Manganiello 0de322fb95
[assistant.google] Propagate plugin name as a string to events.
continuous-integration/drone/push Build is passing Details
This also makes it easier to programmatically stop conversations on
`SpeechRecognizedEvent` with a matched phrase.
2023-12-21 00:28:27 +01:00
Fabio Manganiello cce6c4c5ad
[#284] Merged `assistant.google` plugin and backend.
This removes the deprecated `assistant.google` backend and also adds a
new `conversation_start_sound` parameter.
2023-10-22 19:55:11 +02:00
Fabio Manganiello 3e8d6bb01e Removed `typing-extensions` dependency.
continuous-integration/drone/push Build is failing Details
The package isn't present on older versions of Debian.
2023-09-18 14:05:39 +02:00
Fabio Manganiello c690230930
An `AssistantEvent` should not fail initialization if the assistant integration isn't found. 2023-05-04 00:28:50 +02:00
Fabio Manganiello ff9b76477d
Fixed arguments naming. 2023-04-28 11:04:33 +02:00
Fabio Manganiello 245472a4c5
Better event hooks filters.
- Support for nested attributes on event hook conditions. Things like
  these are now possible:

```
from platypush.event.hook import hook
from platypush.message.event.entities import EntityUpdateEvent

@hook(EntityUpdateEvent, entity={"external_id": "system:cpu"})
def on_cpu_update_event(event: EntityUpdateEvent, **_):
    print(event.args["entity"]["percent"])
```

- The scoring/regex extraction/partial string match logic in
  `_matches_argument` is actually only needed for
  `SpeechRecognizedEvent`. Other events don't need these features, and
  event hooks may be actually triggered unexpectedly in case of partial
  matches. Therefore, the "complex" `_matches_argument` has been moved
  as an override only for `SpeechRecognizedEvent`, and all the other
  events will perform simple key-value matching.
2023-04-26 01:45:58 +02:00
Fabio Manganiello c269c62fe6 Refactored logging names 2020-09-27 01:33:38 +02:00
Fabio Manganiello 124d2e356d Support for mic muted/unmuted event in Google assistant 2020-03-05 18:03:05 +01:00
Fabio Manganiello abbfe517de Don't override matches_condition in ResponseEvent to run stop_conversation. Use the flag play_response=False on plugin level to bypass the response instead 2019-11-26 15:52:30 +01:00
Fabio Manganiello 9b04570e49 Assistant event refactor: always explicitly pass the assistant object.
Also added match_condition override for ResponseEvent to capture the
assistant response text, when available, and prevent the default
response - it should solve #86.
2019-11-26 00:16:32 +01:00
Fabio Manganiello 0ddfce3dce PEP fixes 2019-11-26 00:04:17 +01:00
Fabio Manganiello bb3a39acb9 Better synchronization mechanism between push-to-talk and platypush when an event is matched and no assistant playback should follow up 2019-07-12 18:11:14 +02:00
Fabio Manganiello 6769707580 Stop assistant interaction if a phrase match is found 2019-07-12 09:37:37 +02:00
Fabio Manganiello b63843a130 Fixed assistant event constructor with new Google plugins structure 2019-07-12 01:45:27 +02:00
Fabio Manganiello 5766367402 Rewritten snowboy and Google push-to-talk plugins to make them a better replacement for the deprecated google-assistant-library 2019-07-11 22:54:33 +02:00
Fabio Manganiello 2b38f1b03f Added alarm, timer and error event handlers on assistant backend 2019-01-19 01:55:32 +01:00
Fabio Manganiello b94ec36d0f Added documentation to events 2018-07-09 22:38:08 +02:00
Fabio Manganiello f73adc83bc - Support for assistant response text as a ResponseEvent
- Don't trigger a ConversationEndEvent if the assistant needs to follow up on the previous interaction
2018-06-20 19:21:32 +02:00
Fabio Manganiello 4da74b1096 Refactored logging submodule 2018-06-06 20:09:23 +02:00
Fabio Manganiello c1caa182be Handling assistant no_response events 2018-05-25 18:26:02 +02:00
Fabio Manganiello 4f75b765b1 Added assistant conversation timeout event 2018-05-25 18:18:16 +02:00
Fabio Manganiello a14d6fe652 - Stop assistant playback only if there was a user request. This
prevents a PortAudio write on input-only stream error in the Assistant
SDK, see https://github.com/googlesamples/assistant-sdk-python/issues/185

- Make sure that user_request is always defined before returning it

- Use assistant.google.pushtotalk as a fallback if assistant.google is
not configured/available
2018-03-21 23:21:41 +01:00
Fabio Manganiello d5f73023ea Support for custom hotword detection through Snowboy 2018-03-20 23:34:36 +01:00
Fabio Manganiello f6d16366eb Changed assistant stop_conv logic on match 2018-01-15 13:37:48 +01:00
Fabio Manganiello 109805fd8d Don't stop the conversation on hook match if the hook match was a priority one 2018-01-05 10:09:02 +01:00
Fabio Manganiello f2e5ba1eef Fixed corner case on event match in case the named argument is the last token 2018-01-02 01:37:30 +01:00
Fabio Manganiello 5a92c0ac3b - Proper support for event arguments
- Better algorithm for event matching
- Added send_event support to pusher
2018-01-02 00:35:55 +01:00
Fabio Manganiello 6928e440bc Support for Flic button events 2017-12-24 13:15:37 +01:00
Fabio Manganiello 18830232a4 Don't trigger the default Assistant response if the phrase matched an internal rule. Also, backends should be easily accessible through a context module (more context variables will be added there) 2017-12-24 02:35:49 +01:00
Fabio Manganiello 7b97a5b229 - #30 Implemented Google Assistant backend
- #21 Implemented events management
2017-12-24 01:10:48 +01:00