A virtual pet application powered by Google's Gemini AI that creates an interactive, intelligent pet companion.
- AI-Powered Interactions: Uses Gemini AI model for natural and contextual responses
- Real-time Status: Monitors pet's hunger, energy, and happiness levels
- Interactive Web Interface: Simple web UI for interacting with your pet
- Multiple Actions:
- Feed your pet
- Play games with your pet
- Let your pet sleep
- Chat with your pet
- Backend: Go (Golang)
- Fiber web framework for API endpoints
- Google Generative AI SDK for Gemini
- Frontend: HTML/JavaScript
- Single-page application
- Real-time status updates
- Interactive UI elements
-
Clone the repository
-
Create a
.envfile with:GEMINI_API_KEY=your_api_key_here
-
Run the application:
go run main.go
-
Access the web interface at
http://localhost:3000
ai/: Contains AI-related functionalityclient.go: Gemini API client setuppet.go: Pet logic and state management
api/: HTTP server and route handlerspublic/: Frontend assetsindex.html: Web interface
The pet responds to various actions through the web interface:
- Feed: Decreases hunger and increases energy
- Play: Increases happiness but consumes energy
- Sleep: Restores energy but increases hunger
- Chat: Free-form interaction with your pet
The pet's responses are context-aware and take into account its current state.