A fun Flutter app where you can have real-time, voice-to-voice chats with a Large Language Model (LLM).
|
|
1 месяц назад | |
|---|---|---|
| android | 1 месяц назад | |
| assets | 1 месяц назад | |
| ios | 1 месяц назад | |
| lib | 1 месяц назад | |
| linux | 1 месяц назад | |
| macos | 1 месяц назад | |
| media | 1 месяц назад | |
| test | 1 месяц назад | |
| web | 1 месяц назад | |
| windows | 1 месяц назад | |
| .gitignore | 1 месяц назад | |
| .metadata | 1 месяц назад | |
| README.md | 1 месяц назад | |
| analysis_options.yaml | 1 месяц назад | |
| pubspec.lock | 1 месяц назад | |
| pubspec.yaml | 1 месяц назад |
Hey there! 👋 Welcome to Gemini Live, a fun Flutter app where you can have real-time, voice-to-voice chats with a Large Language Model (LLM).
git clone http://106.51.72.251:3000/Terra/gemini-live-proto.git
cd gemini-live
This app uses Firebase for its backend magic. Here's how to get it set up:
google-services.json file and drop it into android/app/ directory.GoogleService-Info.plist file and drop it into ios/Runner/ directory..env right in the root of your project.# Android
ANDROID_API_KEY="your_android_api_key"
ANDROID_APP_ID="your_android_app_id"
ANDROID_MESSAGING_SENDER_ID="your_messaging_sender_id"
ANDROID_PROJECT_ID="your_project_id"
ANDROID_STORAGE_BUCKET="your_storage_bucket"
# iOS
IOS_API_KEY="your_ios_api_key"
IOS_APP_ID="your_ios_app_id"
IOS_MESSAGING_SENDER_ID="your_messaging_sender_id"
IOS_PROJECT_ID="your_project_id"
IOS_STORAGE_BUCKET="your_storage_bucket"
IOS_BUNDLE_ID="your_ios_bundle_id"
Probably I have added APIs that are not necessarily needed, but who am I to judge - Thanks to unhelpful firebase guides, I decided to throwup everything in there and figure out a cleanup much later - since getting it working was and is the highest priority.
Once Firebase is sorted, let's get all the necessary packages:
flutter pub get
And just like that, you're ready to roll! Run the application using:
flutter run
Home Screen: Landing screen of app, where the next page is disabled until the right permissions is provided.
Live Screen: The AI conversational screen.
Inspired from a .NET ecosystem, the folder structure is little unconventional to a flutter dev. But I think clarity will be established once you understand the contents - Trust me it takes little to no time to get used to it.
lib/
├── application/ # Contains the screens of the app
├── infrastructure/ # Implementations that screen depend on - these are absolute implementations that application depends on.
├── services/ # The blueprint for our services - application uses as proxy, so that infrastructure can be swapped out anytime.
└── widgets/ # Handy-dandy reusable UI bits
As the goal of the app is definitely the lively chats that you can have with the AI, we setup the character and scenario in "system_prompt" under assets folder. This contains the details about scenario and persona of LLM to respond with.
Right now, this system prompt lives in a local text file: assets/hostage_system_instruction.txt. In this example, it makes the AI play along with a serious hostage negotiation scenario. There are couple of other examples as well, some that work really well, others which I don't want to talk about.
Fortunately after spending 2 weeks of RDR 2 in-game hours in real life, found the documentation of the gemini live API that google wants us to use. Most of the other documents which I tried guiding through had either not worked or marked as deprecated or will be deprecated soon enough: Live API Documentation
The application has been tested on the following platforms:
| Platform | Status |
|---|---|
| Android | ❌ Untested |
| iOS | ✅ Tested |
| Windows | ❌ Untested |
| Web | ❌ Untested |
This project is still a work in progress and a playground for new ideas! Here's a sneak peek at what I might be taking it from here: