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(agents-api): Added mmr search and get history system tool + configurable doc search params in chat.py #940

Merged
merged 11 commits into from
Dec 12, 2024

Conversation

Vedantsahai18
Copy link
Member

@Vedantsahai18 Vedantsahai18 commented Dec 8, 2024

Important

Adds MMR search with configurable parameters, updates documentation, and introduces changelog generation workflow.

  • Search Features:
    • Added MMR search in gather_messages.py with configurable mmr_strength.
    • Introduced get_search_fn_and_params() to select search function based on RecallOptions.
    • Configurable search parameters: limit, lang, metadata_filter, alpha, confidence.
  • Documentation:
    • Added docstrings for BaseDocSearchRequest and RecallOptions in Docs.py and Sessions.py.
    • Updated OpenAPI spec with new search parameters.
  • Cleanup:
    • Removed unused imports and variables from multiple files.
    • Added changelog generation workflow in .github/workflows/generate-changelog.yml.

This description was created by Ellipsis for d43cc8b. It will automatically update as commits are pushed.

@Vedantsahai18 Vedantsahai18 marked this pull request as ready for review December 8, 2024 23:14
Copy link
Contributor

@standard-input standard-input bot left a comment

Choose a reason for hiding this comment

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

No issues flagged.
Standard Input can make mistakes. Check important info.

@Vedantsahai18 Vedantsahai18 changed the title feat(agetns-api): Added mmr search + configurable doc search params in chat.py feat(agents-api): Added mmr search + configurable doc search params in chat.py Dec 8, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 79ab127 in 1 minute and 23 seconds

More details
  • Looked at 617 lines of code in 13 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. agents-api/agents_api/activities/execute_system.py:6
  • Draft comment:
    The removal of the HTTPException import might cause issues if it's used elsewhere in the file. Please ensure it's not needed before removing.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The removal of the import statement for HTTPException in execute_system.py seems unnecessary unless it's confirmed that HTTPException is not used anywhere in the file. This could lead to runtime errors if HTTPException is used but not imported.
2. agents-api/agents_api/workflows/task_execution/transition.py:17
  • Draft comment:
    The removal of temporal_activity_after_retry_timeout import might cause issues if it's used elsewhere in the file. Please ensure it's not needed before removing.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The removal of temporal_activity_after_retry_timeout import in transition.py should be verified to ensure it's not used elsewhere in the file. This could lead to runtime errors if it's used but not imported.
3. agents-api/tests/test_execution_workflow.py:17
  • Draft comment:
    The removal of async_cozo_client import might cause issues if it's used elsewhere in the file. Please ensure it's not needed before removing.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The removal of async_cozo_client import in test_execution_workflow.py should be verified to ensure it's not used elsewhere in the file. This could lead to runtime errors if it's used but not imported.

Workflow ID: wflow_sDQMpi5ThgRD1FVQ


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 8f38603 in 19 seconds

More details
  • Looked at 617 lines of code in 13 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. agents-api/agents_api/models/chat/gather_messages.py:30
  • Draft comment:
    The use of match requires Python 3.10 or later. Ensure the project supports this version or handle this with if-elif statements for compatibility with older versions.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The get_search_fn_and_params function uses a match-case statement, which is only available in Python 3.10 and later. This could cause compatibility issues if the project supports older Python versions.
2. agents-api/agents_api/models/chat/gather_messages.py:147
  • Draft comment:
    Ensure query_embedding is not None before using it, especially when recall_options.mode is text. This could lead to issues if not handled properly.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The gather_messages function uses query_embedding without checking if it is None. This could lead to issues if recall_options.mode is set to text, where query_embedding is not set.

Workflow ID: wflow_O0AjUzsUlOZbMoQc


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on e2ea7f3 in 21 seconds

More details
  • Looked at 36 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/activities/utils.py:311
  • Draft comment:
    Unused import get_history_query. Consider removing it to clean up the code.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The import of get_history in utils.py is not used anywhere in the file. This is unnecessary and should be removed to keep the code clean.

Workflow ID: wflow_r915ItKBShuYc4Td


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@Vedantsahai18
Copy link
Member Author

Vedantsahai18 commented Dec 11, 2024

@ellipsis-dev review this

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 5ce27f5 in 1 minute and 27 seconds

More details
  • Looked at 633 lines of code in 13 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. agents-api/agents_api/activities/execute_system.py:6
  • Draft comment:
    The HTTPException import was removed, but it is still used in the file. This will cause a NameError. Please re-add the import.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. agents-api/agents_api/models/chat/gather_messages.py:153
  • Draft comment:
    Ensure search_fn is not None before calling it to prevent a potential TypeError.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_ulhXqtedQJgO4LN6


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@Vedantsahai18
Copy link
Member Author

@ellipsis-dev generate a summary for this PR

Copy link
Contributor

ellipsis-dev bot commented Dec 11, 2024

Pull Request Summary

This pull request introduces several key updates:

  • Features: Added MMR search functionality with configurable parameters in gather_messages.py.
  • Refactoring: Removed unused imports and variables across multiple files.
  • Documentation: Enhanced docstrings and updated documentation files to reflect new search parameters.
  • Testing: Updated test cases in test_chat_routes.py to accommodate the new search parameters.
  • Miscellaneous: Updated Rust version in the Dockerfile to 1.81.0.

@Vedantsahai18 Vedantsahai18 changed the title feat(agents-api): Added mmr search + configurable doc search params in chat.py feat(agents-api): Added mmr search and get history system tol + configurable doc search params in chat.py Dec 11, 2024
@Vedantsahai18 Vedantsahai18 changed the title feat(agents-api): Added mmr search and get history system tol + configurable doc search params in chat.py feat(agents-api): Added mmr search and get history system tool + configurable doc search params in chat.py Dec 11, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on 11a98f9 in 92 minutes and 20 seconds

More details
  • Looked at 470 lines of code in 6 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. memory-store/Dockerfile:20
  • Draft comment:
    Remove the commented-out RUN command if it's no longer needed:
# RUN cargo install --git https://github.com/cozo-community/cozo.git --branch f/publish-crate --rev 592f49b --profile release -F graph-algo -F  jemalloc -F io-uring -F storage-new-rocksdb -F malloc-usable-size --target x86_64-unknown-linux-gnu cozo-ce-bin
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In the Dockerfile, the commented-out RUN command should be removed if it's no longer needed. Additionally, the Dockerfile should specify the version of the base image to ensure reproducibility.
2. scripts/generate_changelog.py:174
  • Draft comment:
    Wrap os.remove('pr_data.json') in a try-except block to handle potential file not found errors:
        try:
            os.remove('pr_data.json')
            logging.info("Deleted pr_data.json file")
        except FileNotFoundError:
            logging.warning("pr_data.json file not found")
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In the Python script, the use of os.remove('pr_data.json') should be wrapped in a try-except block to handle potential file not found errors gracefully.

Workflow ID: wflow_YAReB9rKwXX3bN8v


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

.github/workflows/generate-changelog.yml Show resolved Hide resolved
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 5829b6e in 14 seconds

More details
  • Looked at 11 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_QO6FPjZSZIl3kpyi


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 84a1a95 in 9 seconds

More details
  • Looked at 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. .github/workflows/generate-changelog.yml:1
  • Draft comment:
    The PR description mentions removing unused imports and variables, but this is not reflected in the diff provided. Please ensure that all changes are included in the PR.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions removing unused imports and variables, but this is not reflected in the diff provided. I will need to explore the codebase to verify this claim.

Workflow ID: wflow_sZRDG4gvedxEiTWg


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on d43cc8b in 10 seconds

More details
  • Looked at 68 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. .github/workflows/generate-changelog.yml:2
  • Draft comment:
    Consider re-adding the run-name key for better logging and tracking of workflow runs.
  • Reason this comment was not posted:
    Confidence changes required: 33%
    The run-name key was removed, but it might be useful for logging and tracking purposes.

Workflow ID: wflow_ft73rBGvygzhVeGy


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@creatorrr creatorrr merged commit 537a134 into dev Dec 12, 2024
16 of 17 checks passed
@creatorrr creatorrr deleted the f/chat-mmr branch December 12, 2024 17:00
@Vedantsahai18 Vedantsahai18 linked an issue Dec 16, 2024 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Add option for search type in chat endpoint
2 participants