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 plugin factory #12

Merged
merged 4 commits into from
Oct 16, 2024
Merged

feat:pipeline plugin factory #12

merged 4 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

    • Enhanced the AdaptPipeline class for improved messaging system integration.
    • Updated method signatures for greater input flexibility.
  • Deprecations

    • Deprecated several properties and methods, guiding users to new configuration methods.

Copy link

coderabbitai bot commented Oct 16, 2024

Walkthrough

The changes in this pull request involve significant modifications to the AdaptPipeline class within the ovos_adapt/opm.py file. The class now inherits from ConfidenceMatcherPipeline instead of PipelinePlugin, and its constructor has been updated to accept a bus parameter. Several method signatures have been altered to enforce stricter type requirements, and multiple properties have been marked as deprecated, with warnings directing users to alternative methods.

Changes

File Change Summary
ovos_adapt/opm.py - Inheritance changed from PipelinePlugin to ConfidenceMatcherPipeline.
- Constructor updated to accept bus (either MessageBusClient or FakeBus) and an optional config dictionary.
- Method signatures for match_high, match_medium, and match_low updated to require lang as str and message as Message.
- match_intent method's utterances parameter changed from Tuple[str] to Iterable[str].
- Multiple properties marked as deprecated with warnings, including context_keywords, context_max_frames, context_timeout, context_greedy, and context_manager.
- update_context method deprecated with a warning to use Session.context.update_context instead.

Possibly related PRs

  • fix:standardize_lang #10: The changes in this PR also modify the AdaptPipeline class in ovos_adapt/opm.py, specifically updating method signatures and marking several context management properties as deprecated, which aligns with the deprecation and signature changes in the main PR.

Suggested labels

enhancement

Poem

🐇 In the code where bunnies play,
AdaptPipeline found a new way.
With messages now clear and bright,
Old paths fade, new ones in sight.
Hop along, let’s code and cheer,
For changes made, we hold so dear! 🌟


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 marked this pull request as draft October 16, 2024 06:20
@github-actions github-actions bot added feature and removed feature labels 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: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 18c5911 and a6481b7.

📒 Files selected for processing (1)
  • ovos_adapt/opm.py (7 hunks)
🧰 Additional context used
🔇 Additional comments (8)
ovos_adapt/opm.py (8)

18-19: Imports updated to include typing hints

The necessary typing modules List, Optional, Iterable, Union, and Dict have been imported to support the type annotations added throughout the code.


20-21: Added imports for messaging support

Imports for MessageBusClient and FakeBus have been added from ovos_bus_client.client and ovos_utils.fakebus respectively. This change indicates that the pipeline can now handle different types of message buses.


28-28: Imported required classes for pipeline functionality

The classes IntentMatch and ConfidenceMatcherPipeline have been imported from ovos_plugin_manager.templates.pipeline to support the new class inheritance and intent matching functionality.


51-51: Updated base class to ConfidenceMatcherPipeline

The AdaptPipeline class now inherits from ConfidenceMatcherPipeline instead of PipelinePlugin. This change may affect inherited methods and attributes. Please verify that all necessary functionalities from the previous base class are available or have been appropriately adapted.


54-55: Constructor updated to accept bus parameter

The __init__ method has been updated to include a bus parameter of type Optional[Union[MessageBusClient, FakeBus]]. This allows the class to handle messaging more flexibly. Ensure that the bus parameter is utilized correctly within the class and that this change aligns with the base class's constructor expectations.


58-58: Ensured proper initialization of the base class

The call to super().__init__(bus, config) passes the new parameters to the base class. Verify that ConfidenceMatcherPipeline accepts these parameters and initializes as intended.


183-183: Changed utterances parameter type in match_intent

The utterances parameter in the match_intent method has been changed from Tuple[str] to Iterable[str]. This allows for more flexibility in the types of iterables that can be passed to the method.


254-256: Constructing IntentMatch with updated parameters

The IntentMatch object is now constructed with match_type, match_data, skill_id, and utterance. Ensure that these parameters align with the expected signature of IntentMatch and contain all necessary information.

ovos_adapt/opm.py Outdated Show resolved Hide resolved
ovos_adapt/opm.py Outdated Show resolved Hide resolved
ovos_adapt/opm.py Outdated Show resolved Hide resolved
@JarbasAl JarbasAl marked this pull request as ready for review October 16, 2024 09:01
@JarbasAl JarbasAl merged commit 0859c2a into dev Oct 16, 2024
6 checks passed
@JarbasAl JarbasAl deleted the feat/plugs branch October 16, 2024 09:12
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