Commit Graph

4385 Commits

Author SHA1 Message Date
Fabio Manganiello ed697c0ad2
🐛 [CI/CD] Fixed build-ui.sh script.
continuous-integration/drone/push Build is passing Details
After doing "cd $SRCDIR", it should reference the `dist` directory in
the webapp by full relative path.
2024-06-06 22:46:37 +02:00
Fabio Manganiello 22cfe777fa
Merge pull request #428 from blacklight/snyk-upgrade-2f9bcb05344a53203d1db8700a74298c
continuous-integration/drone/push Build is failing Details
[Snyk] Upgrade core-js from 3.37.0 to 3.37.1
2024-06-06 22:32:31 +02:00
Fabio Manganiello 3f2832a077
Merge branch 'master' into snyk-upgrade-2f9bcb05344a53203d1db8700a74298c 2024-06-06 22:32:04 +02:00
Fabio Manganiello 6f8eb397d2
Merge pull request #427 from blacklight/snyk-upgrade-97c24303ee224553f29b460d83c6c780
[Snyk] Upgrade cronstrue from 2.49.0 to 2.50.0
2024-06-06 22:30:59 +02:00
Fabio Manganiello 3163721bf3
Merge pull request #426 from blacklight/snyk-upgrade-26bc4dca62d58f39bfb77f2e69121708
[Snyk] Upgrade sass from 1.75.0 to 1.76.0
2024-06-06 22:30:43 +02:00
Fabio Manganiello d79b8a1de5
Merge pull request #425 from blacklight/snyk-upgrade-a75151e7066361ecbf2a647d6e707a32
[Snyk] Upgrade vue from 3.4.23 to 3.4.24
2024-06-06 22:30:20 +02:00
Fabio Manganiello 3afc6b2271
[Automatic] Updated components cache
continuous-integration/drone/push Build is passing Details
2024-06-06 20:29:13 +00:00
Fabio Manganiello 17b6b02986 Replaced `warnings.warn` with `logging.warnings`.
I couldn't find an easy and reliable way of routing `warnings.warn` to
`logging`.

Closes: #281
2024-06-06 20:28:23 +00:00
Fabio Manganiello 87a902bfa3
[Automatic] Updated components cache
continuous-integration/drone/push Build is passing Details
2024-06-06 01:28:13 +00:00
Fabio Manganiello 421feffd3e
Bump version: 1.0.7 → 1.1.0
continuous-integration/drone/push Build is passing Details
2024-06-06 03:27:04 +02:00
Fabio Manganiello 518dc146d6
Bumped version in CHANGELOG. 2024-06-06 03:27:04 +02:00
Fabio Manganiello 6b11db7afb
[docs] Added `inherited-members`.
Closes: #403
2024-06-06 03:27:03 +02:00
Fabio Manganiello 8814859abc
[zwave.mqtt] Fixed typo in documentation. 2024-06-06 03:27:03 +02:00
Fabio Manganiello 0ccd029ff1
[Automatic] Updated components cache
continuous-integration/drone/push Build is passing Details
2024-06-06 00:25:21 +00:00
Fabio Manganiello e52f5e06f4 [calendar.ical] Fixed timezone/datetime parsing issues.
Closes: #405
2024-06-06 00:24:31 +00:00
snyk-bot 066d71faa3
fix: upgrade core-js from 3.37.0 to 3.37.1
Snyk has created this PR to upgrade core-js from 3.37.0 to 3.37.1.

See this package in npm:
core-js

See this project in Snyk:
https://app.snyk.io/org/blacklight/project/96bfd125-5816-4d9e-83c6-94d1569ab0f1?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-06-04 18:18:54 +00:00
Fabio Manganiello 4f19b45975 Bump version: 1.0.6 → 1.0.7 2024-06-02 15:49:59 +00:00
Fabio Manganiello 7d6ffc76fb [CI/CD] The build-ui script should go back to the source root after running the UI build commands from the UI folder 2024-06-02 15:46:18 +00:00
Fabio Manganiello 7a8f30e5e0 [#384] Added `assistant.openai` and `tts.openai` plugins.
Closes: #384
2024-06-02 15:31:11 +00:00
Fabio Manganiello 3528b3646f [openai] Update documentation to include `assistant` and `tts`. 2024-06-02 15:31:11 +00:00
Fabio Manganiello 9cca928d4b [#348] Added `openai.transcribe` action.
This API is the foundation for the `assistant.openai` plugin.
2024-06-02 15:31:11 +00:00
Fabio Manganiello f356fcd844 Added `tts.stop` method. 2024-06-02 15:31:11 +00:00
Fabio Manganiello fcae7aa3ad Several improvements for `assistant` plugins.
- `stop_conversation_on_speech_match` should default to True.

- `render_response` should also handle conversation follow-ups, set the
  follow-up to True if the response ends with a question mark and the
  value of `with_follow_on_turn` is not set,

- Don't render responses if a `tts_plugin` is not set.
2024-06-02 15:31:11 +00:00
Fabio Manganiello c7d640a1d2 `IntentRecognizedEvent` should stop the current assistant conversation when matched by a hook. 2024-06-02 15:31:11 +00:00
Fabio Manganiello 1cc2aaf5a4 [assistant.picovoice] `_on_response_*` methods should have varargs. 2024-06-02 15:31:11 +00:00
Fabio Manganiello 2acf6ef3e9 Bump version: 1.0.5 → 1.0.6 2024-06-01 09:01:07 +00:00
Fabio Manganiello 1107e526f7 Updated CHANGELOG 2024-06-01 09:01:07 +00:00
Fabio Manganiello 5fc9c1199b Fixed the root cause of the failure on the `time` module.
The previous commit prompted a new error:

```
2024-06-01 10:54:08,310|ERROR|platypush:plugin:bluetooth|module 'platypush.entities.time' has no attribute 'time'
Traceback (most recent call last):
  File "/usr/lib/python3.9/dist-packages/platypush/plugins/__init__.py", line 247, in _runner
    self.main()
  File "/usr/lib/python3.9/dist-packages/platypush/plugins/bluetooth/__init__.py", line 590, in main
    self._refresh_cache()
  File "/usr/lib/python3.9/dist-packages/platypush/plugins/bluetooth/__init__.py", line 146, in _refresh_cache
    get_entities_engine().wait_start()
  File "/usr/lib/python3.9/dist-packages/platypush/entities/__init__.py", line 48, in get_entities_engine
    time_start = time.time()
AttributeError: module 'platypush.entities.time' has no attribute 'time'
```

Which explains even the previous error: `import time` in that module
won't use the `time` module from the Python library, but the `.time`
module within the same directory.

This error only happens when the current directory is part of PYTHONPATH
(and usually it shouldn't), but for sake of keeping things safe I've
replaced `time()` with `utcnow().timestamp()`, with `utcnow` imported
from `platypush.utils`.
2024-06-01 09:01:07 +00:00
Fabio Manganiello b067430cd5 Weird fix for a weird error that suddenly started on one of my machines.
```
Traceback (most recent call last):
  File "/usr/lib/python3.9/dist-packages/platypush/plugins/__init__.py", line 247, in _runner
    self.main()
  File "/usr/lib/python3.9/dist-packages/platypush/plugins/bluetooth/__init__.py", line 590, in main
    self._refresh_cache()
  File "/usr/lib/python3.9/dist-packages/platypush/plugins/bluetooth/__init__.py", line 146, in _refresh_cache
    get_entities_engine().wait_start()
  File "/usr/lib/python3.9/dist-packages/platypush/entities/__init__.py", line 48, in get_entities_engine
    time_start = time()
TypeError: 'module' object is not callable
```

There isn't a single reason in this world for this error to happen.

If I do `from time import time`, then `t = time()` is 100% valid Python.

I have no clue of what may be causing it, but I hope that this will fix
it.
2024-06-01 08:50:30 +00:00
Fabio Manganiello ff60896625
[Automatic] Updated components cache
continuous-integration/drone/push Build is passing Details
2024-05-31 23:55:27 +00:00
Fabio Manganiello 67b6e3a608
Bump version: 1.0.4 → 1.0.5
continuous-integration/drone/push Build is passing Details
2024-06-01 01:43:12 +02:00
Fabio Manganiello c61a1b89d6
Updated CHANGELOG 2024-06-01 01:42:21 +02:00
Fabio Manganiello c9a5c29a4a
🐛 A proper cross-version solution for the `utcnow()` issue.
No need to maintain two different pieces of logic - a `utcnow()` for
Python < 3.11 and `now(datetime.UTC)` for Python >= 3.11.

`datetime.timezone.utc` existed long before datetime.UTC and that's what
the `utcnow` facade should use.

This means that all the `utcnow()` will always have `tzinfo=UTC`
regardless of the Python version.

There's still a problem with the `utcnow()`-generated timestamps that
have been generated by previous versions of Python and stored on the db.

Therefore, when the code performs comparisons with timestamps fetched
from the db, it should always explicitly do a `.replace(tzinfo=utc)` to
ensure that we always compare offset-aware datetime representations.

See blog post for technical details:
https://manganiello.blog/wheres-my-time-again
2024-06-01 01:34:47 +02:00
Fabio Manganiello 1067ab04d9
[tts.picovoice] Adapted to the new `orca.synthesize` API.
The new API no longer returns a list of numeric values alone. Instead,
it returns a tuple where the first element is the raw audio, and the
second element contains extra info on the rendered phonemes.
2024-05-31 21:10:48 +02:00
Fabio Manganiello 709b90fa4b
Merge branch 'master' into 384/assistant-openai 2024-05-31 21:07:06 +02:00
Fabio Manganiello 06f0ac4545
[Automatic] Updated components cache
continuous-integration/drone/push Build is passing Details
2024-05-31 17:59:06 +00:00
Fabio Manganiello 944fd45f9f
Bump version: 1.0.3 → 1.0.4
continuous-integration/drone/push Build is passing Details
2024-05-31 19:57:51 +02:00
Fabio Manganiello 6acdde6164
Updated CHANGELOG 2024-05-31 19:57:43 +02:00
Fabio Manganiello 3583dafbc3
🐛 Partial revert of c18768e61f
`datetime.utcnow` may be deprecated on Python >= 3.12, but
`datetime.UTC` isn't present on older Python versions.

Added a `platypush.utils.utcnow()` method as a workaround compatible
with both.
2024-05-31 19:55:19 +02:00
Fabio Manganiello 4513bb9569
Set a `plugin` argument on `AssistantEvent`s besides `assistant`.
`assistant` contains the assistant plugin object that triggered the
event, but you can't create event hook conditions on attributes that are
plugins.

The event should also store a `plugin` attribute which contains the
unique plugin name, so hooks like these can be built:

```
from platypush import hook
from platypush.events.assistant import ConversationStartEvent

@when(ConversationStartEvent, plugin="assistant.google")
def on_google_conversation_start():
  ...
```

It wouldn't be possible to construct a hook condition like the one above
on the plugin object reported on the `assistant` attribute.
2024-05-31 19:55:19 +02:00
Fabio Manganiello 4e82dd17bb
🐛 Partial revert of c18768e61f
`datetime.utcnow` may be deprecated on Python >= 3.12, but
`datetime.UTC` isn't present on older Python versions.

Added a `platypush.utils.utcnow()` method as a workaround compatible
with both.
2024-05-31 19:52:32 +02:00
Fabio Manganiello e982c02524
Set a `plugin` argument on `AssistantEvent`s besides `assistant`.
`assistant` contains the assistant plugin object that triggered the
event, but you can't create event hook conditions on attributes that are
plugins.

The event should also store a `plugin` attribute which contains the
unique plugin name, so hooks like these can be built:

```
from platypush import hook
from platypush.events.assistant import ConversationStartEvent

@when(ConversationStartEvent, plugin="assistant.google")
def on_google_conversation_start():
  ...
```

It wouldn't be possible to construct a hook condition like the one above
on the plugin object reported on the `assistant` attribute.
2024-05-31 19:29:50 +02:00
Fabio Manganiello d9a5ea1e53
Merge branch 'master' into 384/assistant-openai 2024-05-31 02:58:08 +02:00
Fabio Manganiello 23e02de1d7
Bump version: 1.0.2 → 1.0.3
continuous-integration/drone/push Build is passing Details
2024-05-31 02:57:08 +02:00
Fabio Manganiello 4d0b63a155
Updated CHANGELOG 2024-05-31 02:57:08 +02:00
Fabio Manganiello ce1525e786
[Automatic] Updated components cache
continuous-integration/drone/push Build is passing Details
2024-05-31 00:53:37 +00:00
Fabio Manganiello 67478e7ca1 🐛 Fixed proper support for event package alias `platypush.events`.
Even though `platypush.events` is just a symlink to
`platypush.message.event`, imports from those two modules will be
treated as different imports, thus hook conditions build on
`platypush.events` imports will never match.
2024-05-31 00:52:48 +00:00
Fabio Manganiello c18768e61f Replaced deprecated usages of `datetime.utcnow()` with `datetime.now(UTC)`. 2024-05-31 00:52:48 +00:00
Fabio Manganiello 30362b89e3 [assistant] `tts_plugin_args` should include `join=True` by default.
The assistant by default should be configured to wait for response audio
to be fully rendered before proceeding.
2024-05-31 00:52:48 +00:00
Fabio Manganiello 826a3fa55c CHANGELOG update 2024-05-31 00:52:48 +00:00