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

Add unit tests for vector database implementation #4091

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

Conversation

sweep-nightly[bot]
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 unit tests cover the following key functionalities of the vector database:

  • Embedding functions: embed_text_array and openai_call_embedding
  • Similarity search: cosine_similarity and multi_get_query_texts_similarity
  • Caching: Verifying the caching behavior
  • Error handling: Testing the error handling for various exceptions

The tests use the pytest framework and mock the necessary dependencies, such as the OpenAI client and the cache.

Summary

The changes in this pull request include:

  • Added sweepai/core/vector_db_test.py file with unit tests for the vector database implementation
  • Mocked the necessary dependencies (OpenAI client, cache) using pytest fixtures
  • Wrote test cases for embedding, similarity search, caching, and error handling

Suggested changes from Sweep Chat by @kevinlu1248. Continue chatting at http://localhost:3000/c/b10a6c05-ad37-45e2-9d69-5626f19279c6.

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

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.

1 participant