feat/transformers
closes https://github.com/JarbasHiveMind/HiveMind-core/issues/82
in the regular mycroft.conf add the transformers configs as usual, but this time under "hivemind" section (config file may be shared with OVOS with different plugins in each)
"hivemind": {
"utterance_transformers": {
"ovos-xxx": {}
},
"metadata_transformers": {
"ovos-xxx": {}
},
"dialog_transformers": {
"ovos-xxx": {}
}
}
relevant plugins:
- https://github.com/JarbasHiveMind/ovos-user-id
- https://github.com/OpenVoiceOS/ovos-bidirectional-translation-plugin
this PR brings transformer functionality directly to hivemind, allowing plugins to also be used with non ovos-core minds
Summary by CodeRabbit
-
New Features
- Enhanced message handling with new transformer services for utterances, dialogs, and metadata.
- Improved transformation capabilities with added methods for handling and managing plugins.
-
Dependencies
- Updated dependencies:
ovos-bus-client(v0.0.6),ovos-plugin-manager, andHiveMind_presence(v0.0.2a3).
- Updated dependencies:
@coderabbitai review
Actions performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
Walkthrough
The recent updates enhance the hivemind-core functionality by integrating transformer plugins for utterances, metadata, and dialogues. These plugins allow the transformation of messages before they are processed further, improving flexibility and user management. The changes include new service classes for handling transformations and modifications to the handle_bus_message method to incorporate these transformations.
Changes
| File | Change Summary |
|---|---|
hivemind_core/protocol.py |
Added methods and attributes to integrate utterance, metadata, and dialog transformer plugins. |
hivemind_core/transformers.py |
Introduced DialogTransformersService, UtteranceTransformersService, and MetadataTransformersService to manage transformations. |
requirements.txt |
Updated to include ovos-bus-client version 0.0.6, ovos-plugin-manager, and HiveMind_presence version 0.0.2a3. |
Sequence Diagram(s)
sequenceDiagram
participant Client
participant HiveMindListenerProtocol
participant UtteranceTransformersService
participant DialogTransformersService
participant MetadataTransformersService
Client->>HiveMindListenerProtocol: Send bus message
HiveMindListenerProtocol->>UtteranceTransformersService: Transform utterance
UtteranceTransformersService-->>HiveMindListenerProtocol: Transformed utterance
HiveMindListenerProtocol->>DialogTransformersService: Transform dialog
DialogTransformersService-->>HiveMindListenerProtocol: Transformed dialog
HiveMindListenerProtocol->>MetadataTransformersService: Transform metadata
MetadataTransformersService-->>HiveMindListenerProtocol: Transformed metadata
HiveMindListenerProtocol-->>Client: Processed message
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Allow the usage of utterance/metadata transformers in hivemind-core before forwarding the utterance | ✅ | |
| Integrate transformer plugins to map users from a chat service to an internal user_id | ✅ |
Poem
In the realm of code so bright,
Transformers join the night,
Utterance, dialog, metadata sway,
Enhancing messages on their way.
Rabbit hops with glee,
For changes bring new harmony. 🌟
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?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai generate interesting stats about this repository and render them as a table.@coderabbitai show all the console.log statements in this repository.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
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 as PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.