A modern SwiftUI application that leverages Google's Gemini AI to analyze images and engage in natural conversations.
This app creates an interactive AI assistant that can analyze images and respond to text inputs. Simply take a photo or select an image from your photo library, and ask Gemini questions about what it sees.
- 📱 Clean, modern SwiftUI interface
- 📸 Integrated camera for taking photos
- 🖼️ Photo library integration for selecting images
- 🧠 Gemini AI for intelligent image analysis
- 💬 Persistent chat history
- 🔄 Robust error handling with automatic retries
- Xcode 14 or later
- iOS 16 or later
- A Gemini API key from Google AI Studio
- Clone the repository:
git clone https://github.com/SohanRaidev/Gemini-Vision-SwiftUI.git
cd Gemini-Vision-SwiftUI
- Open the project in Xcode:
open SwiftUI-AI-Wrapper.xcodeproj
-
Add your Gemini API key:
- Open
SwiftUI-AI-Wrapper/Models/ChatModel.swift
- Replace
<YOUR_API_KEY>
with your actual Gemini API key
- Open
-
Build and run the app on your device or simulator
- Launch the app
- Take a photo with the camera or select an image from your photo library
- Gemini will automatically analyze what's in the image
- Continue the conversation by asking follow-up questions
- Access your chat history through the history button
The app requires the following permissions:
- Camera access (for taking photos)
- Photo Library access (for selecting images)
You can customize various aspects of the application:
- Adjust the
geminiModel
property inChatModel.swift
to use different Gemini models - Modify UI appearance in the view files
- Adjust image compression settings for different performance profiles
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.