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

F/dsearch queries: Add doc search sql queries #985

Merged
merged 4 commits into from
Dec 24, 2024

Conversation

Vedantsahai18
Copy link
Member

@Vedantsahai18 Vedantsahai18 commented Dec 24, 2024

PR Type

Enhancement


Description

  • Implemented hybrid document search combining text and vector search capabilities
  • Added proper error handling for database exceptions across docs and tools modules
  • Improved SQL query formatting and documentation using sqlglot
  • Enhanced tools module with better error messages and input validation
  • Optimized hybrid search SQL implementation with improved join conditions
  • Added comprehensive test coverage for new search functionality

Changes walkthrough 📝

Relevant files
Enhancement
__init__.py
Add hybrid search capabilities to docs module                       

agents-api/agents_api/queries/docs/init.py

  • Added search_docs_by_embedding and search_docs_hybrid to __all__
    exports
  • Updated module docstring to include hybrid search capabilities
  • +6/-3     
    search_docs_by_embedding.py
    Add vector search implementation and error handling           

    agents-api/agents_api/queries/docs/search_docs_by_embedding.py

  • Added error handling for database exceptions
  • Added raw query for vector search
  • Improved code documentation
  • +12/-1   
    search_docs_hybrid.py
    Implement hybrid search functionality                                       

    agents-api/agents_api/queries/docs/search_docs_hybrid.py

  • Implemented hybrid search combining text and vector search
  • Added error handling and input validation
  • Simplified implementation using SQL function
  • +96/-143
    *
    Enhance tools module with error handling and formatting   

    agents-api/agents_api/queries/tools/*

  • Added proper error handling for database exceptions
  • Improved SQL query formatting using sqlglot
  • Added documentation and type hints
  • 000018_doc_search.up.sql
    Optimize hybrid search SQL implementation                               

    memory-store/migrations/000018_doc_search.up.sql

  • Modified hybrid search query to improve join conditions
  • Removed unnecessary developer_id from results
  • +3/-3     

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


    Important

    Add hybrid document search with improved error handling and SQL optimization, and enhance tools module with better validation.

    • Behavior:
      • Implemented hybrid document search combining text and vector search in search_docs_hybrid.py.
      • Added error handling for database exceptions in search_docs_by_embedding.py, search_docs_by_text.py, and search_docs_hybrid.py.
      • Optimized SQL queries using sqlglot in create_tools.py, delete_tool.py, and get_tool.py.
    • SQL:
      • Modified hybrid search SQL in 000018_doc_search.up.sql to improve join conditions and remove developer_id from results.
      • Added functions for vector and text search with configurable parameters.
    • Testing:
      • Added test coverage for hybrid search in test_docs_queries.py.
      • Skipped tests for text and embedding search due to container issues.
    • Misc:
      • Enhanced tools module with better error messages and input validation in tools/* files.

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

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
    🧪 PR contains tests
    🔒 Security concerns

    SQL injection:
    The query construction using string concatenation for owner_ids_pg_str could be vulnerable to SQL injection. Consider using parameterized queries or proper escaping for the UUID array.

    ⚡ Recommended focus areas for review

    Input Validation

    The empty embedding check happens after the empty text check, which could allow invalid requests through. Consider consolidating input validation at the start of the function.

        if not text_query and not embedding:
            raise HTTPException(status_code=400, detail="Empty query provided")
    
        if not embedding:
            raise HTTPException(status_code=400, detail="Empty embedding provided")
    Query Performance

    The LEFT JOIN operations in the hybrid search query could impact performance with large result sets. Consider adding appropriate indexes on doc_id columns.

            LEFT JOIN text_results t ON r.doc_id = t.doc_id
            LEFT JOIN embedding_results e ON r.doc_id = e.doc_id
    Error Handling

    The error handling for invalid alpha values (weight parameter) is missing. Consider adding validation to ensure alpha is between 0 and 1.

    async def search_docs_hybrid(
        developer_id: UUID,
        owners: list[tuple[Literal["user", "agent"], UUID]],
        text_query: str = "",
        embedding: List[float] = None,
        k: int = 10,
        alpha: float = 0.5,
        metadata_filter: dict[str, Any] = {},
        search_language: str = "english",
        confidence: float = 0.5,
    ) -> tuple[str, list]:

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Validate vector dimensions to prevent database errors from mismatched embedding sizes

    Add input validation for the embedding size to ensure it matches the expected
    dimension (1024). This prevents potential database errors from mismatched vector
    dimensions.

    agents-api/agents_api/queries/docs/search_docs_hybrid.py [84-85]

     if not embedding:
         raise HTTPException(status_code=400, detail="Empty embedding provided")
    +if len(embedding) != 1024:
    +    raise HTTPException(status_code=400, detail="Embedding must be 1024-dimensional")
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    Why: Critical validation to prevent database errors from mismatched vector dimensions. The code assumes 1024 dimensions but doesn't validate it, which could cause runtime failures.

    9
    General
    Validate weight parameter bounds to ensure proper result combination

    Add validation for alpha parameter to ensure it's between 0 and 1, as it represents
    a weight factor for combining search results.

    agents-api/agents_api/queries/docs/search_docs_hybrid.py [56]

    -alpha: float = 0.5,
    +if not 0 <= alpha <= 1:
    +    raise HTTPException(status_code=400, detail="Alpha must be between 0 and 1")
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Important validation to ensure the alpha weight parameter is valid (between 0-1), preventing incorrect search result combinations that could silently produce wrong rankings.

    8
    Validate confidence threshold to ensure proper result filtering

    Add validation for the confidence parameter to ensure it's between 0 and 1, as it
    represents a threshold for filtering results.

    agents-api/agents_api/queries/docs/search_docs_hybrid.py [59]

    -confidence: float = 0.5,
    +if not 0 <= confidence <= 1:
    +    raise HTTPException(status_code=400, detail="Confidence must be between 0 and 1")
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Essential validation to ensure the confidence threshold is valid (between 0-1), preventing incorrect filtering of search results that could silently drop valid matches.

    8

    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 5f4aebc in 1 minute and 13 seconds

    More details
    • Looked at 987 lines of code in 15 files
    • Skipped 0 files when reviewing.
    • Skipped posting 4 drafted comments based on config settings.
    1. agents-api/agents_api/queries/docs/search_docs_hybrid.py:24
    • Draft comment:
      The SQL query is missing a closing parenthesis. Add a closing parenthesis at the end of the query to fix the syntax error.
    • Reason this comment was not posted:
      Comment looked like it was already resolved.
    2. agents-api/agents_api/queries/tools/delete_tool.py:28
    • Draft comment:
      The ForeignKeyViolationError might not accurately represent a missing developer or agent. Consider using a more appropriate exception or adding additional checks to verify the existence of the developer or agent before attempting deletion.
    • Reason this comment was not posted:
      Decided after close inspection that this draft comment was likely wrong and/or not actionable:
      The comment is speculative - it says "might not accurately represent" without strong evidence. In a properly designed database, foreign key constraints are the correct way to ensure referential integrity. If the developer or agent doesn't exist, the foreign key constraint will fail, which is exactly what we want. The current error handling is following standard REST API practices by returning 404 for not found resources.
      Maybe there are edge cases where a foreign key violation could occur for reasons other than missing developer/agent? Maybe additional checks could improve the user experience?
      While additional checks are possible, they would add complexity without clear benefit. The foreign key constraint is the authoritative source of truth, and the current error handling follows REST best practices.
      Delete this comment. The current error handling is appropriate and follows good practices. The suggestion is speculative and would add unnecessary complexity.
    3. agents-api/agents_api/queries/tools/get_tool.py:25
    • Draft comment:
      The ForeignKeyViolationError might not accurately represent a missing developer or agent. Consider using a more appropriate exception or adding additional checks to verify the existence of the developer or agent before attempting to get the tool.
    • Reason this comment was not posted:
      Marked as duplicate.
    4. agents-api/agents_api/queries/tools/list_tools.py:29
    • Draft comment:
      The ForeignKeyViolationError might not accurately represent a missing developer or agent. Consider using a more appropriate exception or adding additional checks to verify the existence of the developer or agent before attempting to list the tools.
    • Reason this comment was not posted:
      Marked as duplicate.

    Workflow ID: wflow_9IqGyywJgBjz67jv


    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.

    metadata_filter: dict[str, Any] = {},
    search_language: str = "english",
    confidence: float = 0.5,
    ) -> tuple[str, list]:
    """
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    The docstring mentions owner_type and owner_id, but the function uses owners. Update the docstring to reflect the correct parameter owners which is a list of tuples containing owner type and ID.

    Copy link

    qodo-merge-pro-for-open-source bot commented Dec 24, 2024

    CI Failure Feedback 🧐

    (Checks updated until commit 23235f4)

    Action: Lint-And-Format

    Failed stage: Run stefanzweifel/git-auto-commit-action@v4 [❌]

    Failure summary:

    The action failed because there were uncommitted local changes in two files:

  • agents-api/tests/fixtures.py
  • agents-api/tests/test_docs_queries.py

    The git auto-commit action was unable to switch branches because these files had local modifications
    that would be overwritten. The changes need to be committed or stashed first.

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    1234:  �[36;1muv run poe lint�[0m
    1235:  shell: /usr/bin/bash -e {0}
    1236:  env:
    1237:  UV_CACHE_DIR: /home/runner/work/_temp/setup-uv-cache
    1238:  ##[endgroup]
    1239:  �[37mPoe =>�[0m �[94mruff format�[0m
    1240:  1 file reformatted, 353 files left unchanged
    1241:  �[37mPoe =>�[0m �[94mruff check --select I --fix --unsafe-fixes /home/runner/work/julep/julep/agents-api/agents_api/exceptions.py /home/runner/work/julep/julep/agents-api/agents_api/app.py /home/runner/work/julep/julep/agents-api/agents_api/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/model_registry.py /home/runner/work/julep/julep/agents-api/agents_api/env.py /home/runner/work/julep/julep/agents-api/agents_api/web.py /home/runner/work/julep/julep/agents-api/agents_api/common/nlp.py /home/runner/work/julep/julep/agents-api/agents_api/common/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/common/interceptors.py /home/runner/work/julep/julep/agents-api/agents_api/common/retry_policies.py /home/runner/work/julep/julep/agents-api/agents_api/models/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/models/utils.py /home/runner/work/julep/julep/agents-api/agents_api/metrics/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/metrics/counters.py /home/runner/work/julep/julep/agents-api/agents_api/activities/types.py /home/runner/work/julep/julep/agents-api/agents_api/activities/embed_docs.py /home/runner/work/julep/julep/agents-api/agents_api/activities/demo.py /home/runner/work/julep/julep/agents-api/agents_api/activities/excecute_api_call.py /home/runner/work/julep/julep/agents-api/agents_api/activities/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/activities/execute_integration.py /home/runner/work/julep/julep/agents-api/agents_api/activities/logger.py /home/runner/work/julep/julep/agents-api/agents_api/activities/mem_mgmt.py /home/runner/work/julep/julep/agents-api/agents_api/activities/execute_system.py /home/runner/work/julep/julep/agents-api/agents_api/activities/utils.py /home/runner/work/julep/julep/agents-api/agents_api/activities/truncation.py /home/runner/work/julep/julep/agents-api/agents_api/activities/mem_rating.py /home/runner/work/julep/julep/agents-api/agents_api/activities/summarization.py /home/runner/work/julep/julep/agents-api/agents_api/activities/sync_items_remote.py /home/runner/work/julep/julep/agents-api/agents_api/routers/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/dependencies/exceptions.py /home/runner/work/julep/julep/agents-api/agents_api/dependencies/developer_id.py /home/runner/work/julep/julep/agents-api/agents_api/dependencies/auth.py /home/runner/work/julep/julep/agents-api/agents_api/dependencies/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/dependencies/query_filter.py /home/runner/work/julep/julep/agents-api/agents_api/worker/worker.py /home/runner/work/julep/julep/agents-api/agents_api/worker/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/worker/__main__.py /home/runner/work/julep/julep/agents-api/agents_api/worker/codec.py /home/runner/work/julep/julep/agents-api/agents_api/rec_sum/summarize.py /home/runner/work/julep/julep/agents-api/agents_api/rec_sum/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/rec_sum/trim.py /home/runner/work/julep/julep/agents-api/agents_api/rec_sum/utils.py /home/runner/work/julep/julep/agents-api/agents_api/rec_sum/data.py /home/runner/work/julep/julep/agents-api/agents_api/rec_sum/generate.py /home/runner/work/julep/julep/agents-api/agents_api/rec_sum/entities.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/Tasks.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/Files.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/Jobs.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/Entries.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/Docs.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/Sessions.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/Users.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/Executions.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/Tools.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/Agents.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/Chat.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/Common.py /home/runner/work/julep/julep/agents-api/agents_api/autogen/openapi_model.py /home/runner/work/julep/julep/agents-api/agents_api/queries/utils.py /home/runner/work/julep/julep/agents-api/agents_api/workflows/embed_docs.py /home/runner/work/julep/julep/agents-api/agents_api/workflows/demo.py /home/runner/work/julep/julep/agents-api/agents_api/workflows/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/workflows/mem_mgmt.py /home/runner/work/julep/julep/agents-api/agents_api/workflows/truncation.py /home/runner/work/julep/julep/agents-api/agents_api/workflows/mem_rating.py /home/runner/work/julep/julep/agents-api/agents_api/workflows/summarization.py /home/runner/work/julep/julep/agents-api/agents_api/clients/pg.py /home/runner/work/julep/julep/agents-api/agents_api/clients/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/clients/async_s3.py /home/runner/work/julep/julep/agents-api/agents_api/clients/temporal.py /home/runner/work/julep/julep/agents-api/agents_api/clients/litellm.py /home/runner/work/julep/julep/agents-api/agents_api/clients/integrations.py /home/runner/work/julep/julep/agents-api/agents_api/common/protocol/agents.py /home/runner/work/julep/julep/agents-api/agents_api/common/protocol/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/common/protocol/sessions.py /home/runner/work/julep/julep/agents-api/agents_api/common/protocol/remote.py /home/runner/work/julep/julep/agents-api/agents_api/common/protocol/tasks.py /home/runner/work/julep/julep/agents-api/agents_api/common/protocol/developers.py /home/runner/work/julep/julep/agents-api/agents_api/common/utils/cozo.py /home/runner/work/julep/julep/agents-api/agents_api/common/utils/yaml.py /home/runner/work/julep/julep/agents-api/agents_api/common/utils/types.py /home/runner/work/julep/julep/agents-api/agents_api/common/utils/messages.py /home/runner/work/julep/julep/agents-api/agents_api/common/utils/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/common/utils/datetime.py /home/runner/work/julep/julep/agents-api/agents_api/common/utils/json.py /home/runner/work/julep/julep/agents-api/agents_api/common/utils/template.py /home/runner/work/julep/julep/agents-api/agents_api/common/utils/debug.py /home/runner/work/julep/julep/agents-api/agents_api/common/exceptions/agents.py /home/runner/work/julep/julep/agents-api/agents_api/common/exceptions/tools.py /home/runner/work/julep/julep/agents-api/agents_api/common/exceptions/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/common/exceptions/sessions.py /home/runner/work/julep/julep/agents-api/agents_api/common/exceptions/tasks.py /home/runner/work/julep/julep/agents-api/agents_api/common/exceptions/users.py /home/runner/work/julep/julep/agents-api/agents_api/models/entry/get_history.py /home/runner/work/julep/julep/agents-api/agents_api/models/entry/delete_entries.py /home/runner/work/julep/julep/agents-api/agents_api/models/entry/create_entries.py /home/runner/work/julep/julep/agents-api/agents_api/models/entry/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/models/entry/list_entries.py /home/runner/work/julep/julep/agents-api/agents_api/models/session/list_sessions.py /home/runner/work/julep/julep/agents-api/agents_api/models/session/get_session.py /home/runner/work/julep/julep/agents-api/agents_api/models/session/update_session.py /home/runner/work/julep/julep/agents-api/agents_api/models/session/delete_session.py /home/runner/work/julep/julep/agents-api/agents_api/models/session/patch_session.py /home/runner/work/julep/julep/agents-api/agents_api/models/session/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/models/session/count_sessions.py /home/runner/work/julep/julep/agents-api/agents_api/models/session/create_or_update_session.py /home/runner/work/julep/julep/agents-api/agents_api/models/session/create_session.py /home/runner/work/julep/julep/agents-api/agents_api/models/session/prepare_session_data.py /home/runner/work/julep/julep/agents-api/agents_api/models/agent/patch_agent.py /home/runner/work/julep/julep/agents-api/agents_api/models/agent/list_agents.py /home/runner/work/julep/julep/agents-api/agents_api/models/agent/create_or_update_agent.py /home/runner/work/julep/julep/agents-api/agents_api/models/agent/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/models/agent/delete_agent.py /home/runner/work/julep/julep/agents-api/agents_api/models/agent/update_agent.py /home/runner/work/julep/julep/agents-api/agents_api/models/agent/create_agent.py /home/runner/work/julep/julep/agents-api/agents_api/models/agent/get_agent.py /home/runner/work/julep/julep/agents-api/agents_api/models/docs/search_docs_hybrid.py /home/runner/work/julep/julep/agents-api/agents_api/models/docs/embed_snippets.py /home/runner/work/julep/julep/agents-api/agents_api/models/docs/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/models/docs/create_doc.py /home/runner/work/julep/julep/agents-api/agents_api/models/docs/search_docs_by_embedding.py /home/runner/work/julep/julep/agents-api/agents_api/models/docs/search_docs_by_text.py /home/runner/work/julep/julep/agents-api/agents_api/models/docs/get_doc.py /home/runner/work/julep/julep/agents-api/agents_api/models/docs/mmr.py /home/runner/work/julep/julep/agents-api/agents_api/models/docs/delete_doc.py /home/runner/work/julep/julep/agents-api/agents_api/models/docs/list_docs.py /home/runner/work/julep/julep/agents-api/agents_api/models/user/update_user.py /home/runner/work/julep/julep/agents-api/agents_api/models/user/get_user.py /home/runner/work/julep/julep/agents-api/agents_api/models/user/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/models/user/list_users.py /home/runner/work/julep/julep/agents-api/agents_api/models/user/patch_user.py /home/runner/work/julep/julep/agents-api/agents_api/models/user/create_or_update_user.py /home/runner/work/julep/julep/agents-api/agents_api/models/user/create_user.py /home/runner/work/julep/julep/agents-api/agents_api/models/user/delete_user.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/create_temporal_lookup.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/prepare_execution_input.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/count_executions.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/get_execution.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/list_executions.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/constants.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/lookup_temporal_data.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/update_execution.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/get_execution_transition.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/list_execution_transitions.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/get_paused_execution_token.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/get_temporal_workflow_data.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/create_execution.py /home/runner/work/julep/julep/agents-api/agents_api/models/execution/create_execution_transition.py /home/runner/work/julep/julep/agents-api/agents_api/models/task/create_task.py /home/runner/work/julep/julep/agents-api/agents_api/models/task/get_task.py /home/runner/work/julep/julep/agents-api/agents_api/models/task/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/models/task/create_or_update_task.py /home/runner/work/julep/julep/agents-api/agents_api/models/task/delete_task.py /home/runner/work/julep/julep/agents-api/agents_api/models/task/list_tasks.py /home/runner/work/julep/julep/agents-api/agents_api/models/task/update_task.py /home/runner/work/julep/julep/agents-api/agents_api/models/task/patch_task.py /home/runner/work/julep/julep/agents-api/agents_api/models/files/create_file.py /home/runner/work/julep/julep/agents-api/agents_api/models/files/get_file.py /home/runner/work/julep/julep/agents-api/agents_api/models/files/delete_file.py /home/runner/work/julep/julep/agents-api/agents_api/models/files/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/prompt_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/log_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/switch_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/raise_complete_async.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/for_each_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/transition_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/yield_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/wait_for_input_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/get_value_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/tool_call_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/map_reduce_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/cozo_query_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/return_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/base_evaluate.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/evaluate_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/set_value_step.py /home/runner/work/julep/julep/agents-api/agents_api/activities/task_steps/if_else_step.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/router.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/patch_execution.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/create_task.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/stream_transitions_events.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/get_execution_details.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/get_task_details.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/create_task_execution.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/list_task_executions.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/create_or_update_task.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/update_execution.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/list_execution_transitions.py /home/runner/work/julep/julep/agents-api/agents_api/routers/tasks/list_tasks.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/router.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/patch_agent_tool.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/patch_agent.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/create_agent_tool.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/list_agents.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/create_or_update_agent.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/delete_agent_tool.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/update_agent_tool.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/delete_agent.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/list_agent_tools.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/update_agent.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/create_agent.py /home/runner/work/julep/julep/agents-api/agents_api/routers/agents/get_agent_details.py /home/runner/work/julep/julep/agents-api/agents_api/routers/docs/router.py /home/runner/work/julep/julep/agents-api/agents_api/routers/docs/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/routers/docs/create_doc.py /home/runner/work/julep/julep/agents-api/agents_api/routers/docs/embed.py /home/runner/work/julep/julep/agents-api/agents_api/routers/docs/search_docs.py /home/runner/work/julep/julep/agents-api/agents_api/routers/docs/get_doc.py /home/runner/work/julep/julep/agents-api/agents_api/routers/docs/delete_doc.py /home/runner/work/julep/julep/agents-api/agents_api/routers/docs/list_docs.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/exceptions.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/router.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/list_sessions.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/get_session.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/update_session.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/metrics.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/get_session_history.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/delete_session.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/patch_session.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/create_or_update_session.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/create_session.py /home/runner/work/julep/julep/agents-api/agents_api/routers/sessions/chat.py /home/runner/work/julep/julep/agents-api/agents_api/routers/jobs/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/routers/jobs/routers.py /home/runner/work/julep/julep/agents-api/agents_api/routers/healthz/check_health.py /home/runner/work/julep/julep/agents-api/agents_api/routers/internal/router.py /home/runner/work/julep/julep/agents-api/agents_api/routers/internal/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/routers/files/router.py /home/runner/work/julep/julep/agents-api/agents_api/routers/files/create_file.py /home/runner/work/julep/julep/agents-api/agents_api/routers/files/get_file.py /home/runner/work/julep/julep/agents-api/agents_api/routers/files/delete_file.py /home/runner/work/julep/julep/agents-api/agents_api/routers/files/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/routers/users/router.py /home/runner/work/julep/julep/agents-api/agents_api/routers/users/update_user.py /home/runner/work/julep/julep/agents-api/agents_api/routers/users/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/routers/users/list_users.py /home/runner/work/julep/julep/agents-api/agents_api/routers/users/get_user_details.py /home/runner/work/julep/julep/agents-api/agents_api/routers/users/patch_user.py /home/runner/work/julep/julep/agents-api/agents_api/routers/users/create_or_update_user.py /home/runner/work/julep/julep/agents-api/agents_api/routers/users/create_user.py /home/runner/work/julep/julep/agents-api/agents_api/routers/users/delete_user.py /home/runner/work/julep/julep/agents-api/agents_api/queries/developers/create_developer.py /home/runner/work/julep/julep/agents-api/agents_api/queries/developers/get_developer.py /home/runner/work/julep/julep/agents-api/agents_api/queries/developers/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/queries/developers/update_developer.py /home/runner/work/julep/julep/agents-api/agents_api/queries/developers/patch_developer.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tasks/create_task.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tasks/get_task.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tasks/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tasks/create_or_update_task.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tasks/delete_task.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tasks/list_tasks.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tasks/update_task.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tasks/patch_task.py /home/runner/work/julep/julep/agents-api/agents_api/queries/agents/patch_agent.py /home/runner/work/julep/julep/agents-api/agents_api/queries/agents/list_agents.py /home/runner/work/julep/julep/agents-api/agents_api/queries/agents/create_or_update_agent.py /home/runner/work/julep/julep/agents-api/agents_api/queries/agents/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/queries/agents/delete_agent.py /home/runner/work/julep/julep/agents-api/agents_api/queries/agents/update_agent.py /home/runner/work/julep/julep/agents-api/agents_api/queries/agents/create_agent.py /home/runner/work/julep/julep/agents-api/agents_api/queries/agents/get_agent.py /home/runner/work/julep/julep/agents-api/agents_api/queries/docs/search_docs_hybrid.py /home/runner/work/julep/julep/agents-api/agents_api/queries/docs/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/queries/docs/create_doc.py /home/runner/work/julep/julep/agents-api/agents_api/queries/docs/search_docs_by_embedding.py /home/runner/work/julep/julep/agents-api/agents_api/queries/docs/search_docs_by_text.py /home/runner/work/julep/julep/agents-api/agents_api/queries/docs/get_doc.py /home/runner/work/julep/julep/agents-api/agents_api/queries/docs/mmr.py /home/runner/work/julep/julep/agents-api/agents_api/queries/docs/delete_doc.py /home/runner/work/julep/julep/agents-api/agents_api/queries/docs/list_docs.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tools/get_tool_args_from_metadata.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tools/patch_tool.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tools/delete_tool.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tools/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tools/get_tool.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tools/update_tool.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tools/create_tools.py /home/runner/work/julep/julep/agents-api/agents_api/queries/tools/list_tools.py /home/runner/work/julep/julep/agents-api/agents_api/queries/sessions/list_sessions.py /home/runner/work/julep/julep/agents-api/agents_api/queries/sessions/get_session.py /home/runner/work/julep/julep/agents-api/agents_api/queries/sessions/update_session.py /home/runner/work/julep/julep/agents-api/agents_api/queries/sessions/delete_session.py /home/runner/work/julep/julep/agents-api/agents_api/queries/sessions/patch_session.py /home/runner/work/julep/julep/agents-api/agents_api/queries/sessions/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/queries/sessions/count_sessions.py /home/runner/work/julep/julep/agents-api/agents_api/queries/sessions/create_or_update_session.py /home/runner/work/julep/julep/agents-api/agents_api/queries/sessions/create_session.py /home/runner/work/julep/julep/agents-api/agents_api/queries/entries/get_history.py /home/runner/work/julep/julep/agents-api/agents_api/queries/entries/delete_entries.py /home/runner/work/julep/julep/agents-api/agents_api/queries/entries/create_entries.py /home/runner/work/julep/julep/agents-api/agents_api/queries/entries/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/queries/entries/list_entries.py /home/runner/work/julep/julep/agents-api/agents_api/queries/files/create_file.py /home/runner/work/julep/julep/agents-api/agents_api/queries/files/get_file.py /home/runner/work/julep/julep/agents-api/agents_api/queries/files/list_files.py /home/runner/work/julep/julep/agents-api/agents_api/queries/files/delete_file.py /home/runner/work/julep/julep/agents-api/agents_api/queries/files/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/queries/chat/prepare_chat_context.py /home/runner/work/julep/julep/agents-api/agents_api/queries/chat/gather_messages.py /home/runner/work/julep/julep/agents-api/agents_api/queries/chat/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/queries/users/update_user.py /home/runner/work/julep/julep/agents-api/agents_api/queries/users/get_user.py /home/runner/work/julep/julep/agents-api/agents_api/queries/users/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/queries/users/list_users.py /home/runner/work/julep/julep/agents-api/agents_api/queries/users/patch_user.py /home/runner/work/julep/julep/agents-api/agents_api/queries/users/create_or_update_user.py /home/runner/work/julep/julep/agents-api/agents_api/queries/users/create_user.py /home/runner/work/julep/julep/agents-api/agents_api/queries/users/delete_user.py /home/runner/work/julep/julep/agents-api/agents_api/workflows/task_execution/__init__.py /home/runner/work/julep/julep/agents-api/agents_api/workflows/task_execution/transition.py /home/runner/work/julep/julep/agents-api/agents_api/workflows/task_execution/helpers.py /home/runner/work/julep/julep/agents-api/agents_api/clients/worker/types.py /home/runner/work/julep/julep/agents-api/agents_api/clients/worker/worker.py /home/runner/work/julep/julep/agents-api/agents_api/clients/worker/__init__.py /home/runner/work/julep/julep/agents-api/tests/test_execution_workflow.py /home/runner/work/julep/julep/agents-api/tests/test_task_queries.py /home/runner/work/julep/julep/agents-api/tests/test_sessions.py /home/runner/work/julep/julep/agents-api/tests/test_developer_queries.py /home/runner/work/julep/julep/agents-api/tests/test_user_routes.py /home/runner/work/julep/julep/agents-api/tests/test_entry_queries.py /home/runner/work/julep/julep/agents-api/tests/test_activities.py /home/runner/work/julep/julep/agents-api/tests/test_files_queries.py /home/runner/work/julep/julep/agents-api/tests/__init__.py /home/runner/work/julep/julep/agents-api/tests/test_docs_queries.py /home/runner/work/julep/julep/agents-api/tests/test_agent_routes.py /home/runner/work/julep/julep/agents-api/tests/test_task_routes.py /home/runner/work/julep/julep/agents-api/tests/utils.py /home/runner/work/julep/julep/agents-api/tests/test_chat_routes.py /home/runner/work/julep/julep/agents-api/tests/test_tool_queries.py /home/runner/work/julep/julep/agents-api/tests/test_execution_queries.py /home/runner/work/julep/julep/agents-api/tests/test_agent_queries.py /home/runner/work/julep/julep/agents-api/tests/test_user_queries.py /home/runner/work/julep/julep/agents-api/tests/fixtures.py /home/runner/work/julep/julep/agents-api/tests/test_workflow_routes.py /home/runner/work/julep/julep/agents-api/tests/test_files_routes.py /home/runner/work/julep/julep/agents-api/tests/test_session_queries.py /home/runner/work/julep/julep/agents-api/tests/test_messages_truncation.py /home/runner/work/julep/julep/agents-api/tests/test_docs_routes.py /home/runner/work/julep/julep/agents-api/tests/sample_tasks/__init__.py /home/runner/work/julep/julep/agents-api/tests/sample_tasks/test_find_selector.py�[0m
    1242:  Found 2 errors (2 fixed, 0 remaining).
    ...
    
    1276:  * [new branch]      f/entries-summarization -> origin/f/entries-summarization
    1277:  * [new branch]      f/executions-queries    -> origin/f/executions-queries
    1278:  * [new branch]      f/grafana-traefik       -> origin/f/grafana-traefik
    1279:  * [new branch]      f/integrations-sentry   -> origin/f/integrations-sentry
    1280:  * [new branch]      f/prompt-step-run-tools -> origin/f/prompt-step-run-tools
    1281:  * [new branch]      f/remote-browser-args-connect-url -> origin/f/remote-browser-args-connect-url
    1282:  * [new branch]      f/scispace-poc          -> origin/f/scispace-poc
    1283:  * [new branch]      f/switch-to-pg          -> origin/f/switch-to-pg
    1284:  * [new branch]      f/tasks-validation-errors-enhancement -> origin/f/tasks-validation-errors-enhancement
    1285:  * [new branch]      main                    -> origin/main
    1286:  * [new branch]      mintlify-docs           -> origin/mintlify-docs
    1287:  * [new branch]      v0.3                    -> origin/v0.3
    1288:  * [new tag]         v0.3.4                  -> v0.3.4
    1289:  error: Your local changes to the following files would be overwritten by checkout:
    1290:  agents-api/tests/fixtures.py
    1291:  agents-api/tests/test_docs_queries.py
    1292:  Please commit your changes or stash them before you switch branches.
    1293:  Aborting
    1294:  Error: Invalid status code: 1
    1295:  at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v4/index.js:17:19)
    1296:  at ChildProcess.emit (node:events:519:28)
    1297:  at maybeClose (node:internal/child_process:1105:16)
    1298:  at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
    1299:  code: 1
    1300:  }
    1301:  Error: Invalid status code: 1
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    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 d16a693 in 31 seconds

    More details
    • Looked at 231 lines of code in 5 files
    • Skipped 0 files when reviewing.
    • Skipped posting 3 drafted comments based on config settings.
    1. agents-api/agents_api/queries/docs/search_docs_by_embedding.py:21
    • Draft comment:
      The SQL query string is missing a closing parenthesis. This will cause a syntax error when executing the query. Please add a closing parenthesis at the end of the query.
    • Reason this comment was not posted:
      Comment was on unchanged code.
    2. agents-api/agents_api/queries/docs/search_docs_by_text.py:21
    • Draft comment:
      The SQL query string is missing a closing parenthesis. This will cause a syntax error when executing the query. Please add a closing parenthesis at the end of the query.
    • Reason this comment was not posted:
      Marked as duplicate.
    3. agents-api/agents_api/queries/docs/search_docs_hybrid.py:25
    • Draft comment:
      The SQL query string is missing a closing parenthesis. This will cause a syntax error when executing the query. Please add a closing parenthesis at the end of the query.
    • Reason this comment was not posted:
      Marked as duplicate.

    Workflow ID: wflow_6XzwZVAhfWnVrSGa


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

    @Vedantsahai18 Vedantsahai18 merged commit 34586d2 into f/switch-to-pg Dec 24, 2024
    1 check passed
    @Vedantsahai18 Vedantsahai18 deleted the f/dsearch-queries branch December 24, 2024 05:04
    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