Skip to content

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.

Notifications You must be signed in to change notification settings

siddheshsonawane07/mimic_user_persona_using_whatsapp_messages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp Persona Mirror

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.

Features

  • 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.

Installation

  1. Clone the repository:
    (https://github.com/siddheshsonawane07/mimic_user_persona_using_mistral)
            
  2. Set up a virtual environment:
    python3 -m venv env
    source env/bin/activate  # On Windows, use `env\Scripts\activate`
            
  3. Install dependencies:
    pip install -r requirements.txt
            
  4. Environment Variables:
    Create a .env file in the project root with your API key:
    MISTRAL_API_KEY=your_mistral_api_key
            
  5. Run the Streamlit app:
    streamlit run app.py
            

Usage

  1. 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/.
  2. Select Role and Tone:
    • Choose a participant's role from the dropdown list.
    • Pick a conversation tone (Charming and Fun, Sarcastic, Professional).
  3. 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.

Project Structure


├── app.py                    # Main Streamlit application
├── README.md                 # Project documentation
└── .env.example              # Sample environment file
└── requirements.txt          # Requirements.txt file for downloading accurate dependencies

Dependencies

Troubleshooting

  • 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.

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages