Add Image Upload Support to AI Chat for Enhanced Skincare Analysis#9
Draft
Add Image Upload Support to AI Chat for Enhanced Skincare Analysis#9
Conversation
Co-authored-by: devAmaresh <141488853+devAmaresh@users.noreply.github.com>
Co-authored-by: devAmaresh <141488853+devAmaresh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add image uploads feature in AI chat
Add Image Upload Support to AI Chat for Enhanced Skincare Analysis
Oct 9, 2025
devAmaresh
approved these changes
Feb 17, 2026
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.
Overview
This PR implements image upload functionality in the AI chat feature, enabling users to share product photos, skin selfies, or any skincare-related images for contextual AI analysis. The AI can now provide visual-based recommendations alongside text conversations, significantly enhancing the skincare consultation experience.
Problem Statement
Previously, the AI chat only supported text-based interactions. Users wanting to get advice about specific products or skin conditions had to describe them in words, which often led to:
Solution
This implementation adds comprehensive image upload support with multi-modal AI analysis:
Backend Changes
Database Schema:
image_urlcolumn tochat_messagestable (nullable, VARCHAR(500))API Enhancement:
/chat/sessions/{session_id}/messagesendpoint to acceptmultipart/form-dataimage: UploadFileparameter using FastAPI's File uploadAI Integration:
GeminiChatServiceto support multi-modal analysisFrontend Changes
Image Selection:
expo-image-pickerfor photo library accessUser Interface:
API Communication:
Technical Details
Image Processing Flow:
AI Capabilities:
The Gemini AI can now:
Example Usage
Files Changed
fastapi-backend/app/models/chat.py- Added image_url field to ChatMessagefastapi-backend/app/schemas/chat.py- Updated schemas with image_url supportfastapi-backend/app/routers/chat.py- Multipart/form-data endpoint supportfastapi-backend/app/crud/chat.py- Image URL parameter in CRUD operationsfastapi-backend/app/services/gemini_chat.py- Multi-modal AI integrationfastapi-backend/alembic/versions/b1c2d3e4f5a6_*.py- Database migrationSkinSenseAI/src/screens/ChatScreen.js- Image picker UI and functionalitySkinSenseAI/src/services/api.js- FormData upload supportreadme.md- Updated feature documentationMigration Required
cd fastapi-backend alembic upgrade headBackward Compatibility
✅ Fully backward compatible:
image_urlis optional in all schemas and databasePerformance Considerations
Testing
✅ Python syntax validation passed
✅ JavaScript syntax validation passed
✅ Database migration tested
✅ Backward compatibility verified
Manual testing checklist provided in implementation docs.
Future Enhancements
Potential improvements for future iterations:
Screenshots
The implementation includes:
Closes #[issue-number] - Allow Image Uploads in AI Chat
Original prompt
Fixes #2
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.