Skip to content

merge changes - #6

Open
ji-berti wants to merge 26 commits into
luisfrom
main
Open

merge changes#6
ji-berti wants to merge 26 commits into
luisfrom
main

Conversation

@ji-berti

Copy link
Copy Markdown
Owner

No description provided.

ji-berti and others added 26 commits June 3, 2025 18:12
Creation of the folder "tests"
to create the folder
to test the script "ai_response.py"
created for testing purposes
to test the pdf process utils
I updated commands to run the tests.
To test the services
Key Features:

Complete Function Coverage:

get_embeddings() - Tests model loading with different devices and error handling
create_vector_store() - Tests vector store creation, directory handling, and edge cases
load_vector_store() - Tests loading existing vector stores and error scenarios
similarity_search() - Tests search functionality with various parameters


Comprehensive Test Scenarios:

Success cases: Normal operation with valid inputs
Error handling: Exception handling, missing files, invalid inputs
Edge cases: Empty chunks, missing embeddings, non-existent paths
Integration tests: Full workflow from embeddings to search


Advanced Testing Features:

Mocking: Extensive use of mocks to avoid dependencies on actual ML models
Parametrized tests: Tests different model names, devices, and k values
Fixtures: Reusable test data for consistent testing
Temporary directories: Safe file system testing


Test Categories:

TestGetEmbeddings: Model loading and device configuration
TestCreateVectorStore: Vector store creation and persistence
TestLoadVectorStore: Loading saved vector stores
TestSimilaritySearch: Search functionality and result handling
TestIntegration: End-to-end workflow testing
Added instructions
Key Testing Benefits:

No ML Dependencies: Tests run without requiring actual HuggingFace models or FAISS installations
Fast Execution: Mocked dependencies ensure quick test runs
Error Simulation: Tests various failure scenarios your code might encounter
Workflow Validation: Integration tests ensure functions work together correctly

The test suite will help verify that embedding and vector store services work correctly across different scenarios and handle errors gracefully.
Chat History and Basic UI
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.

3 participants