Skip to content

Conversation

@sweep-nightly
Copy link
Contributor

@sweep-nightly sweep-nightly bot commented Jun 21, 2024

Purpose

This pull request adds unit tests for the vector database implementation in the sweepai/core/vector_db.py file.

Description

The changes include:

  • Creating a new file sweepai/core/vector_db_test.py to house the unit tests.
  • Adding tests for the following functionality:
    • Embedding text
    • Calculating cosine similarity
    • Caching mechanism
    • Error handling and edge cases
  • Mocking the necessary dependencies, such as the Cache class and the OpenAI client, to isolate the tests.
  • Ensuring the tests cover the key functionalities of the vector database implementation.

Summary

The changes include:

  • New file: sweepai/core/vector_db_test.py
  • Added unit tests for:
    • embed_text_array
    • normalize_l2
    • cosine_similarity
    • openai_with_expo_backoff
    • Error handling for token limits
    • Retry logic for OpenAI errors

Suggested changes from Sweep Chat by @kevinlu1248. Continue chatting at http://localhost:3000/c/56d70f25-e155-4055-8d1f-13af07043cba.

@vercel
Copy link

vercel bot commented Jun 21, 2024

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 11:23pm
sweep-chat-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 11:23pm
sweep-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 11:23pm
sweep-pulley 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 11:23pm

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.

2 participants