A Streamlit-based chat interface for interacting with the Ejento AI API with real-time streaming responses, thread management, and persistent chat history.
You will receive an email containing:
- 🌐 API Base URL
- 🔑 API Subscription Key
- 📧 Your registered email address
🌐 Note: Your Agent ID is available on the Ejento website after login.
- Look for:
AGENT_ID = "2009"(your number will be different)
pip install -r requirements.txtThis installs Streamlit, requests, and all other required libraries.
Run the authentication script:
python3 get_token.pyFollow the prompts:
- Enter your API base URL (from email)
- Enter your email address (from email)
- Check email for authentication code
- Enter the code
- Copy your ACCESS_TOKEN!
Run the setup script:
python3 setup_secrets.pyThe script will:
- Prompt you for each required value
- Create
.streamlit/secrets.tomlautomatically - Validate your configuration
Create .streamlit/secrets.toml manually:
# From email
API_BASE_URL = "https://your-api.azure-api.net"
API_SUBSCRIPTION_KEY = "your_subscription_key"
# From get_token.py script
ACCESS_TOKEN = "your_access_token_here"
# From Ejento website (after login)
# Look for AGENT_ID on the Ejento dashboard
AGENT_ID = "2009"
# Optional: Customize your app title (uncomment to use)
# APP_TITLE = "🤖 AI Blog Assistant"📍 Notes:
QUERY_SOURCEis not needed (hardcoded to "web")APP_TITLEis optional - uncomment and customize if desired- Cookie encryption uses
ACCESS_TOKENautomatically
- Go to your app settings
- Click "Secrets"
- Add the same TOML format above
- Save and restart
streamlit run app.pyThe application will open at http://localhost:8501
- 💬 Real-time Streaming Responses - See AI responses as they're generated
- 🧵 Thread Management - Automatic chat thread creation and switching
- 📝 Persistent History - Chat history saved and loaded across sessions
- 🔄 New Chat Button - Start fresh conversations anytime
- 📱 Responsive Design - Clean interface with 16px font throughout
- 🔐 Secure Authentication - Passwordless token-based authentication
- 🍪 Cookie Persistence - Remember your active thread across page reloads
ejento_chat_app/
├── app.py # Main Streamlit application
├── config.py # Configuration management
├── get_token.py # Authentication script
├── setup_secrets.py # Interactive setup script
├── requirements.txt # Python dependencies
├── .streamlit/
│ └── secrets.toml # Local secrets (not committed)
└── README.md # This file
| Key | Description | Source | Example |
|---|---|---|---|
API_BASE_URL |
API endpoint URL | https://your-api.azure-api.net |
|
API_SUBSCRIPTION_KEY |
API subscription key | your_subscription_key |
|
ACCESS_TOKEN |
Authentication token | get_token.py script |
eyJhbGci... |
AGENT_ID |
Your agent identifier | Ejento website (dashboard) | "2009" |
Note: QUERY_SOURCE is hardcoded to "web" and not configurable.
| Key | Description | Default |
|---|---|---|
APP_TITLE |
Custom app title | "Ejento AI Chat" |
pip install -r requirements.txtMake sure you've created .streamlit/secrets.toml with all required keys.
Your token may have expired. Run get_token.py again to generate a new one.
Check that your BASE_URL is correct and includes https://
- Check spam folder
- Wait 2-3 minutes
- Verify email address is correct
- Request a new code
This warning comes from the streamlit-cookies-manager library (v0.2.0) and is harmless. The library maintainers are aware and working on an update. You can safely ignore this warning - it doesn't affect functionality.
- Fork this repository
- Connect to Streamlit Cloud
- Go to share.streamlit.io
- Click "New app"
- Select your forked repository
- Add secrets (see Step 3 above)
- Deploy!
⚠️ Never commit secrets to Git⚠️ Never share your tokens publicly⚠️ Use.streamlit/secrets.tomlfor local development⚠️ Use platform secrets management for production⚠️ Tokens may expire - regenerate as needed