WhatsApp Persona Mirror is a Streamlit application that analyzes WhatsApp chat history from JSON exports, generating personalized responses that imitate a selected participant's communication style and tone. Users can interact with the app to explore different conversational styles based on previous chats.
- Role-Based Imitation: Select a chat participant’s role from the WhatsApp JSON file to generate responses in their unique style.
- Tone Customization: Choose from multiple conversation tones—Charming and Fun, Sarcastic, or Professional—to add personality to responses.
- Context-Aware Responses: Integrates relevant chat context using FAISS vector stores for more accurate, contextual replies.
- Streamlined Interface: Upload chat files, select parameters, and receive style-adapted responses on the go.
- Clone the repository:
(https://github.com/siddheshsonawane07/mimic_user_persona_using_mistral)
- Set up a virtual environment:
python3 -m venv env source env/bin/activate # On Windows, use `env\Scripts\activate`
- Install dependencies:
pip install -r requirements.txt
- Environment Variables:
Create a.env
file in the project root with your API key:MISTRAL_API_KEY=your_mistral_api_key
- Run the Streamlit app:
streamlit run app.py
- Upload a WhatsApp Chat JSON File:
- Export your chat from WhatsApp.
- Upload this file on to this website to get the required format
https://sidjsonifywhatsapptext.streamlit.app/
.
- Select Role and Tone:
- Choose a participant's role from the dropdown list.
- Pick a conversation tone (Charming and Fun, Sarcastic, Professional).
- Start Chatting:
- Type a message and observe responses tailored to your chosen style and tone.
- Clear the chat history anytime using the Clear Chat button.
├── app.py # Main Streamlit application
├── README.md # Project documentation
└── .env.example # Sample environment file
└── requirements.txt # Requirements.txt file for downloading accurate dependencies
- Streamlit for app interface
- FAISS for vector-based similarity search
- Mistral AI for embedding and chat models
- tiktoken for token estimation
- Environment Variable Errors: Ensure
MISTRAL_API_KEY
is correctly set in your.env
file. - JSON Upload Errors: Only valid JSON files exported from WhatsApp are supported. If there’s an error, try re-exporting the JSON file.