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 #4089

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 of the embed_text_array function
  • Error handling: Testing the error handling in the openai_call_embedding function

Summary

The changes in this pull request include:

  • Added a new file sweepai/core/vector_db_test.py for the unit tests
  • Implemented test cases for the key functions in the vector database
  • Utilized pytest and unittest.mock to set up the test environment and mock dependencies

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

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.

None yet

1 participant