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: Update utterances in indexes and in Routes via RouteLayer Method #437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Siraj-Aizlewood
Copy link
Contributor

@Siraj-Aizlewood Siraj-Aizlewood commented Oct 1, 2024

User description

Need to be able to update Route utterances via the update() method in the RouteLayer. Also need to update in local/remote indexes if we do this. E.g. see Pinecone index.


PR Type

enhancement


Description

  • Added a TODO comment in the update method of RouteLayer to indicate the need for updating utterances in both the index and the routes.
  • The update method is currently not implemented and raises a NotImplementedError.

Changes walkthrough 📝

Relevant files
Enhancement
layer.py
Add TODO for updating utterances in `update` method           

semantic_router/layer.py

  • Added a TODO comment for updating utterances in the index and routes.
  • The update method is marked for future implementation.
  • +1/-0     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    @github-actions github-actions bot added enhancement Enhancement to existing features Review effort [1-5]: 1 labels Oct 1, 2024
    Copy link

    github-actions bot commented Oct 1, 2024

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Unreachable Code
    The TODO comment is placed after a raise statement, making it unreachable. This should be moved above the raise statement or included in the documentation or a ticket.

    Copy link

    github-actions bot commented Oct 1, 2024

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Remove unreachable code to avoid confusion and maintain clean code

    Remove the unreachable code after the raise NotImplementedError statement. Code
    after this statement will never execute, which could lead to confusion about the
    implementation.

    semantic_router/layer.py [439-440]

     raise NotImplementedError("This method has not yet been implemented.")
    -# TODO: update utterances in the index and in the routes
    Suggestion importance[1-10]: 7

    Why: The suggestion correctly identifies that the comment after the raise NotImplementedError statement is unreachable and could cause confusion. Removing it helps maintain clean and understandable code, although it is a minor improvement.

    7

    @Siraj-Aizlewood Siraj-Aizlewood self-assigned this Oct 1, 2024
    Copy link

    codecov bot commented Oct 1, 2024

    Codecov Report

    All modified and coverable lines are covered by tests ✅

    Project coverage is 67.99%. Comparing base (8600d9b) to head (d2d750a).

    Additional details and impacted files
    @@           Coverage Diff           @@
    ##             main     #437   +/-   ##
    =======================================
      Coverage   67.99%   67.99%           
    =======================================
      Files          46       46           
      Lines        3465     3465           
    =======================================
      Hits         2356     2356           
      Misses       1109     1109           
    Flag Coverage Δ
    67.99% <ø> (ø)

    Flags with carried forward coverage won't be shown. Click here to find out more.

    ☔ View full report in Codecov by Sentry.
    📢 Have feedback on the report? Share it here.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    enhancement Enhancement to existing features Review effort [1-5]: 1
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant