Skip to content

Commit

Permalink
Merge pull request #299 from OpenVoiceOS/release-3.1.0a1
Browse files Browse the repository at this point in the history
Release 3.1.0a1
  • Loading branch information
JarbasAl authored Nov 20, 2024
2 parents 592fd43 + b39202e commit 7989b47
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Changelog

## [3.0.1a1](https://github.com/OpenVoiceOS/OVOS-workshop/tree/3.0.1a1) (2024-11-19)
## [3.1.0a1](https://github.com/OpenVoiceOS/OVOS-workshop/tree/3.1.0a1) (2024-11-20)

[Full Changelog](https://github.com/OpenVoiceOS/OVOS-workshop/compare/3.0.0...3.0.1a1)
[Full Changelog](https://github.com/OpenVoiceOS/OVOS-workshop/compare/3.0.1...3.1.0a1)

**Merged pull requests:**

- fix:bundled\_resources [\#297](https://github.com/OpenVoiceOS/OVOS-workshop/pull/297) ([JarbasAl](https://github.com/JarbasAl))
- feat:utterance\_modifiers [\#291](https://github.com/OpenVoiceOS/OVOS-workshop/pull/291) ([JarbasAl](https://github.com/JarbasAl))



Expand Down
22 changes: 20 additions & 2 deletions ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,8 @@ def speak(self, utterance: str, expect_response: bool = False,
SessionManager.wait_while_speaking(timeout, sess)

def speak_dialog(self, key: str, data: Optional[dict] = None,
expect_response: bool = False, wait: Union[bool, int] = False):
expect_response: bool = False, wait: Union[bool, int] = False,
render_callback: Optional[Callable[[str, str], str]] = None):
"""
Speak a random sentence from a dialog file.
Expand All @@ -1678,14 +1679,31 @@ def speak_dialog(self, key: str, data: Optional[dict] = None,
wait (Union[bool, int]): set to True to block while the text
is being spoken for 15 seconds. Alternatively, set
to an integer to specify a timeout in seconds.
render_callback (Optional[Callable[[str, str], str]]): A callable
function that
transforms the
utterance before
it is spoken.
The function
should accept
the utterance
string and the
language as input
and return the
modified string.
Defaults to None.
"""
if self.dialog_renderer:
data = data or {}
utterance = self.dialog_renderer.render(key, data)
if render_callback is not None:
utterance = render_callback(utterance, self.lang)
self.speak(
self.dialog_renderer.render(key, data),
utterance,
expect_response, wait, meta={'dialog': key, 'data': data}
)
else:
# TODO - change this behaviour, speaking the dialog file name isn't that helpful!
self.log.error(
'dialog_render is None, does the locale/dialog folder exist?'
)
Expand Down
6 changes: 3 additions & 3 deletions ovos_workshop/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# START_VERSION_BLOCK
VERSION_MAJOR = 3
VERSION_MINOR = 0
VERSION_BUILD = 1
VERSION_ALPHA = 0
VERSION_MINOR = 1
VERSION_BUILD = 0
VERSION_ALPHA = 1
# END_VERSION_BLOCK

0 comments on commit 7989b47

Please sign in to comment.