-
Notifications
You must be signed in to change notification settings - Fork 11
feat: add document upload and analysis functionality #186
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
base: main
Are you sure you want to change the base?
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 <[email protected]>
@claude add python tests for |
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 <[email protected]>
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