A Flask web application that fetches and displays personalized messages based on user personality data retrieved from external APIs. Users can view and accept messages.
- Fetch Personality: Retrieves user personality data using a customer number.
- Fetch Messages: Displays customized messages tailored to the user’s personality.
- Accept Messages: Allows users to accept messages, with acceptance data sent to an external API.
- Python: Version 3.7 or higher
- Flask and Requests: Python libraries for web handling and HTTP requests
-
Clone this repository:
git clone https://github.com/yourusername/python-message-app.git
-
Navigate to the project directory:
cd python-message-app
-
Install dependencies:
pip install Flask requests
Update API URLs in app.py
if different from the defaults:
MESSAGES_API_URL = 'http://localhost:8098/invocations'
PERSONALITY_API_URL = 'http://localhost:8092/invocations'
ACCEPTANCE_API_URL = 'http://localhost:8098/response'
-
Run the App:
python app.py
Visit
http://localhost:5000
in a web browser. -
Fetch Messages:
- Enter a customer number and click Fetch Messages to load messages.
-
Accept Messages:
- Click Accept on a message to send acceptance data to the API.
- API Issues: Ensure the API servers are running and accessible.
- Error Logs: Run Flask in debug mode (
app.run(debug=True)
) to view detailed logs.
This project is licensed under the MIT License.
For questions or issues, please contact amy@ecosystem.ai.