Skip to content
This repository was archived by the owner on Jun 7, 2025. It is now read-only.

Conversation

@Whyle
Copy link
Contributor

@Whyle Whyle commented May 9, 2025

close #18
close #21

Whyle added 4 commits May 6, 2025 22:02
…ocument deletion

- Introduced DocumentDelete schema in schemas.py to handle document deletion requests.
- Refactored get_full_path method in FileManager to be public.
- Updated delete_document method in FileManager to accept file_id and current_password.
- Enhanced error handling and logging during document deletion.
- Modified requirements.txt to include bson library.
- Expanded test coverage for document upload and deletion functionalities, including various edge cases and error scenarios.
- Improved LLMResponseService tests to validate response generation with messages.
@Whyle Whyle requested a review from Copilot May 9, 2025 02:08
@Whyle Whyle self-assigned this May 9, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a comprehensive suite of tests and improves error handling and configuration across core services, routes, and CI workflows. Key changes include:

  • New test cases for vector database, LLM service, embeddings, file management, and documents routes.
  • Updates to error handling using match-case defaults and modifications to endpoint signatures.
  • Addition of a CI workflow and an updated README with a coverage badge.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_main.py Added basic test for the health-check endpoint.
tests/services/test_vector_database_service.py Added tests covering document addition, deletion, and error scenarios in the vector database service.
tests/services/test_llm_service.py Introduced tests verifying environment checks and model initialization error handling for both OpenAI and Ollama providers.
tests/services/test_llm_response_services.py Expanded tests for context retrieval, chat name generation, streaming response and error handling.
tests/services/test_file_manager_service.py Augmented tests for file saving, deletion, and error conditions in file manager service.
tests/services/test_embeddings_service.py Implemented tests for the OpenAI embedding provider and consistency of the embedding function.
tests/routes/test_documents.py Updated tests for file upload and delete endpoints handling various error and success scenarios.
app/services/vector_database_service.py, llm_service.py, file_manager_service.py, embeddings_service.py Minor modifications for improved test coverage and error handling (using “pragma: no cover” markers).
app/routes/documents.py Updated endpoint signature to leverage FastAPI’s dependency injection for file uploads.
README.md Added a coverage status badge.
.github/workflows/ci.yml Introduced a CI workflow to run tests and collect coverage data.
Comments suppressed due to low confidence (1)

.github/workflows/ci.yml:45

  • [nitpick] Ensure that the secret name 'COVERALLS_SUPPLAI_LLM_API_TOKEN' matches your intended configuration for Coveralls coverage reporting.
COVERALLS_TOKEN: ${{ secrets.COVERALLS_SUPPLAI_LLM_API_TOKEN }}

@Whyle Whyle requested a review from lucaribon May 9, 2025 20:22
bazz333
bazz333 previously approved these changes May 9, 2025
@bazz333 bazz333 self-requested a review May 9, 2025 20:49
@bazz333 bazz333 merged commit 8ee0391 into main May 9, 2025
1 check passed
@lucaribon lucaribon removed their request for review May 9, 2025 23:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unit test parte di implementazione dei codice Report testing con coverage, unita di test, impostazione con coveralls.io

3 participants