Skip to content
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!:pipeline factory #15

Merged
merged 11 commits into from
Oct 16, 2024
Merged

feat!:pipeline factory #15

merged 11 commits into from
Oct 16, 2024

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Oct 16, 2024

companion to OpenVoiceOS/ovos-plugin-manager#270

Summary by CodeRabbit

  • New Features
    • Introduced new message handlers for improved intent and entity management.
  • Improvements
    • Enhanced the intent matching process with updated class structures and configuration handling.
    • Deprecated properties now provide warnings for smoother transitions.
  • Dependency Updates
    • Updated the version specification for the ovos-plugin-manager dependency.

@github-actions github-actions bot added the fix label Oct 16, 2024
@JarbasAl JarbasAl marked this pull request as draft October 16, 2024 06:20
@JarbasAl JarbasAl changed the title fix:standardize_lang feat:pipeline factory Oct 16, 2024
@github-actions github-actions bot added feature and removed fix labels Oct 16, 2024
@JarbasAl JarbasAl marked this pull request as ready for review October 16, 2024 09:01
@JarbasAl
Copy link
Member Author

@coderabbitai review

Copy link

coderabbitai bot commented Oct 16, 2024

✅ 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.

Copy link

coderabbitai bot commented Oct 16, 2024

Walkthrough

The pull request introduces significant changes to the ovos_padatious/opm.py file, including the deprecation of the PadatiousMatcher class and updates to the PadatiousPipeline class, which now inherits from ConfidenceMatcherPipeline. The constructor of PadatiousPipeline has been modified to accept new parameters, and several methods have been refactored for improved functionality and clarity. Additionally, the requirements.txt file has been updated to change the version constraint for the ovos-plugin-manager dependency.

Changes

File Change Summary
ovos_padatious/opm.py - Deprecated PadatiousMatcher class.
- Updated PadatiousPipeline to inherit from ConfidenceMatcherPipeline.
- Modified constructors and methods for improved configuration and functionality.
- Added new message handlers: handle_get_padatious, handle_padatious_manifest, handle_entity_manifest.
- Refactored _match_level and calc_intent methods.
- Added type hints for better readability.
requirements.txt - Updated ovos-plugin-manager version constraint from >=0.0.26 to >=0.5.0,<1.0.0.

Possibly related PRs

  • feat/opm_pipeline #2: The changes in ovos_padatious/opm.py regarding the PadatiousMatcher and PadatiousPipeline classes are directly related to the modifications made in the same file in PR feat/opm_pipeline #2, which also involves these classes and their methods for intent matching.

Suggested labels

refactor, packaging

Poem

🐰 In the code where bunnies play,
The Padatious found a new way.
With pipelines sleek and matches bright,
Our intents now take flight!
Hopping through the lines with glee,
A better world for you and me! 🌼


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?

❤️ Share
🪧 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>, please review it.
    • 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 @coderabbitai in 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 @coderabbitai in 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file 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.

@JarbasAl JarbasAl changed the title feat:pipeline factory feat!:pipeline factory Oct 16, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Outside diff range and nitpick comments (2)
ovos_padatious/opm.py (2)

103-105: Use os.path.join for Path Construction

In line 103, the intent_cache path is constructed using string concatenation and f-strings. Using os.path.join would improve cross-platform compatibility.

Suggested fix:

intent_cache = self.config.get('intent_cache') or os.path.join(xdg_data_home(), get_xdg_base(), 'intent_cache')
intent_cache = expanduser(intent_cache)

Line range hint 276-277: Handling of Long Utterances in calc_intent

In the calc_intent method, utterances longer than self.max_words are skipped, and an error is logged. This could potentially ignore valid user inputs.

Consider handling long utterances differently, such as summarizing the utterance or splitting it into manageable parts, to improve user experience.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c751fe6 and 344ba8b.

📒 Files selected for processing (2)
  • ovos_padatious/opm.py (7 hunks)
  • requirements.txt (1 hunks)
🧰 Additional context used
🔇 Additional comments (5)
requirements.txt (1)

3-3: Approve the version constraint update for ovos-plugin-manager.

The update to ovos-plugin-manager>=0.5.0,<1.0.0 is a good practice. It ensures compatibility with newer features while preventing potential breaking changes from future major versions.

To ensure this change doesn't introduce compatibility issues, please verify:

  1. The minimum required features from ovos-plugin-manager are available in version 0.5.0.
  2. Your code is compatible with the changes introduced in ovos-plugin-manager 0.5.0.

You can use the following script to check the changelog of ovos-plugin-manager:

ovos_padatious/opm.py (4)

135-155: Type Hint Consistency in _match_level Method

The _match_level method in lines 135-155 now includes type hints, enhancing code readability and type safety. Ensure that these type hints accurately reflect the expected parameter types and are consistent with the rest of the codebase.


156-181: Updated Method Signatures with Type Hints

The methods match_high, match_medium, and match_low have updated signatures with type hints in lines 156-181. This improves clarity but ensure that these methods remain compatible with any overridden methods from the base class ConfidenceMatcherPipeline.


84-90: Ensure Compatibility with Base Class After Inheritance Change

In line 84, PadatiousPipeline now inherits from ConfidenceMatcherPipeline. Verify that all necessary methods are correctly overridden, and that the base class's __init__ method is properly called with the required parameters.


41-42: Deprecation of PadatiousMatcher Class

The PadatiousMatcher class is marked as deprecated in lines 41-42 with a deprecation warning for version 2.0.0. Ensure that any dependencies on this class are updated before removing it in future releases.

ovos_padatious/opm.py Show resolved Hide resolved
ovos_padatious/opm.py Show resolved Hide resolved
ovos_padatious/opm.py Outdated Show resolved Hide resolved
ovos_padatious/opm.py Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@JarbasAl JarbasAl merged commit 227aaf5 into dev Oct 16, 2024
4 checks passed
@JarbasAl JarbasAl deleted the feat/plugs branch October 16, 2024 09:32
@coderabbitai coderabbitai bot mentioned this pull request Oct 16, 2024
This was referenced Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant