sweepai / sweep

Sweep: open-source AI-powered Software Developer for small features and bug fixes.
https://sweep.dev
Other
7.4k stars 419 forks source link

Write unit tests for vector_db.py #4088

Closed sweep-nightly[bot] closed 3 months ago

sweep-nightly[bot] commented 3 months ago

Purpose

This pull request adds unit tests for the vector_db.py module to ensure the reliability and correctness of the vector database implementation.

Description

The changes in this pull request include:

  1. Creation of a new file test_vector_db.py in the same directory as vector_db.py to house the unit tests.
  2. Setup of test fixtures for mocking the Redis and OpenAI clients, as well as providing sample test data.
  3. Implementation of the following test cases:
    • Test for embed_text_array function
    • Test for openai_call_embedding function, including error handling
    • Test for apply_adjustment_score function with parametrized inputs
    • Test for get_pointwise_reranked_snippet_scores function

Summary

Suggested changes from Sweep Chat by @kevinlu1248. Continue chatting at http://localhost:3000/c/73163217-5887-4be9-85b4-cbf80a72ef33.

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
sweep-chat πŸ”„ Building (Inspect) Visit Preview πŸ’¬ Add feedback Jun 21, 2024 9:31pm
sweep-chat-demo βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jun 21, 2024 9:31pm
sweep-docs βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jun 21, 2024 9:31pm
sweep-pulley πŸ”„ Building (Inspect) Visit Preview πŸ’¬ Add feedback Jun 21, 2024 9:31pm