-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:utterance_modifiers #291
Conversation
allow skills to access the utterance choosen by self.speak_dialog either to modify it (eg, pronounce numbers) or just to passively monitor it
allow skills to access the utterance choosen by self.speak_dialog either to modify it (eg, pronounce numbers) or just to passively monitor it
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #291 +/- ##
==========================================
- Coverage 53.41% 51.52% -1.89%
==========================================
Files 37 36 -1
Lines 4362 4316 -46
==========================================
- Hits 2330 2224 -106
- Misses 2032 2092 +60 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
ovos_workshop/skills/ovos.py (1)
1730-1734
: Consider adding return value validation for render_callback.While the implementation is correct, it might be good to add validation to ensure the callback returns a string. This would help catch potential errors early.
utterance = self.dialog_renderer.render(key, data) if render_callback is not None: - utterance = render_callback(utterance, self.lang) + modified = render_callback(utterance, self.lang) + if not isinstance(modified, str): + self.log.warning(f"render_callback returned {type(modified)}, expected str. Using original utterance.") + else: + utterance = modified self.speak(
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
ovos_workshop/skills/ovos.py
(2 hunks)
🔇 Additional comments (1)
ovos_workshop/skills/ovos.py (1)
Line range hint 1699-1726
: LGTM! Well-documented signature change.
The new render_callback
parameter is properly type-hinted and well-documented. The docstring clearly explains the parameter's purpose and expected behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a nice addition
Codecov is complaining due to lack of tests |
* fix: pronounce year needs OpenVoiceOS/OVOS-workshop#291 * Update requirements.txt * Update __init__.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update __init__.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update __init__.py * Update __init__.py --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
allow skills to access the utterance choosen by self.speak_dialog
either to modify it (eg, pronounce numbers) or just to passively monitor it
example usage OpenVoiceOS/ovos-skill-days-in-history#18
Summary by CodeRabbit
New Features
speak_dialog
method to allow custom transformations of spoken utterances through an optionalrender_callback
parameter.Documentation
speak_dialog
method to reflect the new parameter and its functionality.