feat: add document upload and analysis functionality#186
Draft
feat: add document upload and analysis functionality#186
Conversation
This PR adds the ability for users to upload pictures of documents (like eviction notices) and uses Google Gemini's Vision API to analyze them. ## Features - Users can upload images (png, jpg, jpeg) or PDF documents - Google Gemini Vision API analyzes the documents for eviction notice details - Analysis focuses on identifying deficiencies and issues with notices - Results are seamlessly integrated into the chat history - Files are securely stored temporarily and cleaned up after analysis ## Implementation - Added frontend file upload component in DocumentUpload.tsx - Created backend upload.py module for handling file uploads - Added API route for file upload endpoint in app.py - Added auto-creation of uploads directory in persistent storage - Integrated with existing Google Gemini infrastructure Closes #39 Co-authored-by: yangm2 <yangm2@users.noreply.github.com>
Contributor
Author
|
@claude add python tests for |
Contributor
|
Claude finished @yangm2's task —— View job Adding Python tests for upload.py ✅Todo List:
Comprehensive test suite created for upload.py 🎯Test Coverage:
Key Features Tested:
Files Created:
The test suite follows the existing project patterns and includes proper mocking for external dependencies like Google Cloud services. All tests are designed to run in isolation without requiring actual API keys or external services. |
- Test file validation and allowed extensions - Test DocumentAnalyzer initialization and document analysis - Test UploadView request handling, validation, and streaming responses - Test session management and error handling scenarios - Test file cleanup and security measures - Mock Google Cloud dependencies for isolated testing Co-authored-by: yangm2 <yangm2@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the ability for users to upload pictures of documents (like eviction notices) and uses Google Gemini's Vision API to analyze them.
Features
Implementation
Closes #39
🤖 Generated with Claude Code