This project is a Streamlit-based application that utilizes Anthropic's Claude 3.5 model to create an interactive chatbot for interviewing sales professionals. The chatbot conducts in-depth interviews, gathers insights, and stores conversation data for future analysis. It also includes functionality to send interview transcripts via email.
- Interactive chatbot for interviewing sales professionals
- Natural language processing using Anthropic's Claude 3.5 model
- Conversation history management using Streamlit session state
- Permanent storage of conversations using MongoDB Atlas
- Email functionality to send interview transcripts
- Logging for error tracking and debugging
- Python 3.7 or higher
- Streamlit
- Anthropic API client
- PyMongo (with srv extras for MongoDB Atlas support)
- SMTP library for email functionality
-
Clone the repository:
git clone https://github.com/yourusername/sales-interviewer-chatbot.git cd sales-interviewer-chatbot -
Install the required packages:
pip install -r requirements.txt
-
Set up Streamlit secrets: Create a file named
.streamlit/secrets.tomlin the root directory of your project with the following content:[secrets] ANTHROPIC_API_KEY = "your_anthropic_api_key" EMAIL_USER = "your_email@example.com" EMAIL_PASSWORD = "your_email_password" EMAIL_SERVER = "smtp.your_email_provider.com" EMAIL_PORT = 587 [mongo] uri = "your_mongodb_atlas_connection_string"
-
Run the Streamlit app:
streamlit run main.py
- Open the Streamlit app in your browser.
- The chatbot will start the interview with introductory questions.
- Respond to the chatbot's questions about your sales experiences.
- The conversation will flow naturally, with the chatbot asking follow-up questions based on your responses.
- At any point, you can click the "End Conversation" button to finish the interview.
- The app will send an email with the interview transcript to the specified recipients.
- Conversation data is stored in MongoDB Atlas for future analysis.
- Streamlit Interface: The main.py file sets up the Streamlit app, manages the conversation flow, and handles user input.
- Anthropic API Integration: The app uses the Anthropic API client to generate responses using the Claude 3.5 model.
- Conversation Management: Conversation history is managed using Streamlit's session state and permanently stored in MongoDB Atlas.
- Email Functionality: The
send_emailfunction is responsible for sending the interview transcript via email. - Error Handling and Logging: The app includes comprehensive error handling and logging for debugging and monitoring.
- Data Processing: Functions for cleaning and processing chatbot responses, including stripping XML tags.
Ensure the following configurations are set correctly in the secrets.toml file:
ANTHROPIC_API_KEY: Your Anthropic API keyEMAIL_USER: Your email address used for sending emailsEMAIL_PASSWORD: Your email password or app-specific passwordEMAIL_SERVER: The SMTP server of your email providerEMAIL_PORT: The SMTP port of your email provider (commonly 587 for TLS)mongo.uri: Your MongoDB Atlas connection string
- Ensure all required packages are installed using the
requirements.txtfile. - Verify that the Anthropic API key, email credentials, and MongoDB URI are correctly set in the
secrets.tomlfile. - Check your internet connection and make sure the Anthropic API, SMTP server, and MongoDB Atlas are accessible.
- If you encounter any issues, check the
chatbot.logfile for error messages and debugging information. - For persistent problems, try clearing your browser cache or restarting the Streamlit app.
This project is licensed under the MIT License. See the LICENSE file for more details.
- Streamlit for the interactive web app framework
- Anthropic for the Claude 3.5 language model
- MongoDB Atlas for cloud-based data storage
This project follows these conventions:
- Programming Language: Python
- Code Style: PEP 8
- Version Control: GitHub Flow
- Testing: Unit Testing with pytest
- Documentation: Inline comments and docstrings
- Dependency Management: requirements.txt with pip
For detailed conventions, please refer to the full conventions document in the project repository.