This application allows users to chat with inanimate objects as if they have their own personalities and characteristics. The chatbot dynamically creates personas for objects and responds in character using Google's Vertex AI with the Gemini model.
- Dynamic Object Personas: Chat with any inanimate object and experience a unique personality
- Conversational Interface: Simple and intuitive UI for engaging with object personas
- Uncensored Responses: Uses Google's powerful Gemini model for creative, free-flowing conversations
- Persona Consistency: Objects maintain consistent personalities throughout conversations
- Enterprise-Grade AI: Uses Google Vertex AI for reliable, high-quality responses
- Fallback Mechanism: Includes template responses as backup
- Python 3.7 or higher
- Google Cloud account with Vertex AI API enabled
- Internet connection for API access
- Clone this repository or download the files
- Install the required dependencies:
pip install -r requirements.txt
- Configure your Google Cloud credentials:
- Set up a Google Cloud project with Vertex AI API enabled
- Open the
.env
file and update the following values:GCP_PROJECT_ID=your-project-id GCP_LOCATION=us-central1 # or your preferred region
- Authentication options:
- Option 1: Use Application Default Credentials
- Option 2: Create a service account key and set the path in
.env
:GOOGLE_APPLICATION_CREDENTIALS=path/to/your/service-account-key.json
- Start the Flask server:
python app.py
- Open your web browser and navigate to:
http://127.0.0.1:5000
- Start a conversation with an object by typing:
Chat with [object name]
- For example: "Chat with a book" or "Chat with a lamp"
- Continue the conversation by asking questions or making statements
- Switch to a different object at any time by typing:
Chat with [new object name]
You can extend the application by:
- Adding predefined personas in the
object_personas
dictionary inapp.py
- Modifying the UI in
templates/index.html
- Implementing additional content filtering if needed
- Frontend: HTML, CSS, JavaScript
- Backend: Flask (Python)
- LLM Integration: Hugging Face Inference API
- Models Used:
- Persona Generation:
mistralai/Mistral-7B-Instruct-v0.2
- Chat Responses:
NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO
(uncensored model)
- Persona Generation:
- Fallback System: Pre-written templates when API is unavailable
- The application requires an internet connection to communicate with the Hugging Face API
- Response quality is excellent due to the use of large language models
- The application includes fallback template responses if the API is unavailable
- Using your own Hugging Face API key is recommended for higher rate limits