Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,155 +1,10 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
-
|
| 11 |
-
- **Export Options**: Download articles as Markdown files
|
| 12 |
-
|
| 13 |
-
## 🚀 Quick Start
|
| 14 |
-
|
| 15 |
-
### Prerequisites
|
| 16 |
-
|
| 17 |
-
- Python 3.11 or higher
|
| 18 |
-
- OpenAI API key ([Get one here](https://platform.openai.com/api-keys))
|
| 19 |
-
- Freepik API key (optional, but recommended for cost savings - [Get one here](https://www.freepik.com/api))
|
| 20 |
-
|
| 21 |
-
### Installation
|
| 22 |
-
|
| 23 |
-
1. **Clone or download this repository**
|
| 24 |
-
|
| 25 |
-
2. **Install dependencies**:
|
| 26 |
-
```bash
|
| 27 |
-
pip install -r requirements.txt
|
| 28 |
-
```
|
| 29 |
-
|
| 30 |
-
3. **Set up environment variables**:
|
| 31 |
-
- Copy `env.example` to `.env`
|
| 32 |
-
- Fill in your API keys:
|
| 33 |
-
```env
|
| 34 |
-
OPENAI_API_KEY=your_openai_api_key_here
|
| 35 |
-
FREEPIK_API_KEY=your_freepik_api_key_here
|
| 36 |
-
```
|
| 37 |
-
|
| 38 |
-
4. **Run the application**:
|
| 39 |
-
```bash
|
| 40 |
-
streamlit run app.py
|
| 41 |
-
```
|
| 42 |
-
|
| 43 |
-
5. **Open your browser** to `http://localhost:8501`
|
| 44 |
-
|
| 45 |
-
## 📖 Usage
|
| 46 |
-
|
| 47 |
-
1. Enter an **Article Title** in the sidebar
|
| 48 |
-
2. Specify a **Word Range** (e.g., "800-1000")
|
| 49 |
-
3. Click **"Generate Article"**
|
| 50 |
-
4. Wait for the AI to generate:
|
| 51 |
-
- Article outline
|
| 52 |
-
- Complete article
|
| 53 |
-
- Header image
|
| 54 |
-
- Related resources
|
| 55 |
-
5. Download the article as Markdown if desired
|
| 56 |
-
|
| 57 |
-
## 💰 Cost Optimization
|
| 58 |
-
|
| 59 |
-
- **Primary cost**: GPT-4 Turbo API calls (~$0.01-0.03 per article)
|
| 60 |
-
- **Image costs**:
|
| 61 |
-
- Freepik API: Free (if you have API access)
|
| 62 |
-
- DALL-E fallback: ~$0.04 per image
|
| 63 |
-
- **Estimated total**: <$0.10 per article
|
| 64 |
-
|
| 65 |
-
The app prioritizes Freepik for images to minimize costs, only using DALL-E when Freepik doesn't return results.
|
| 66 |
-
|
| 67 |
-
## ☁️ Deployment
|
| 68 |
-
|
| 69 |
-
### Option 1: Streamlit Cloud (Recommended - Free)
|
| 70 |
-
|
| 71 |
-
1. Push your code to GitHub
|
| 72 |
-
2. Go to [Streamlit Cloud](https://streamlit.io/cloud)
|
| 73 |
-
3. Connect your GitHub repository
|
| 74 |
-
4. Add environment variables:
|
| 75 |
-
- `OPENAI_API_KEY`
|
| 76 |
-
- `FREEPIK_API_KEY` (optional)
|
| 77 |
-
5. Deploy!
|
| 78 |
-
|
| 79 |
-
### Option 2: Render
|
| 80 |
-
|
| 81 |
-
1. Create a new **Web Service** on [Render](https://render.com)
|
| 82 |
-
2. Connect your GitHub repository
|
| 83 |
-
3. Configure:
|
| 84 |
-
- **Build Command**: `pip install -r requirements.txt`
|
| 85 |
-
- **Start Command**: `streamlit run app.py --server.port=$PORT --server.address=0.0.0.0`
|
| 86 |
-
- **Environment**: Python 3
|
| 87 |
-
4. Add environment variables in the Render dashboard
|
| 88 |
-
5. Deploy!
|
| 89 |
-
|
| 90 |
-
### Option 3: Railway
|
| 91 |
-
|
| 92 |
-
1. Create a new project on [Railway](https://railway.app)
|
| 93 |
-
2. Connect your GitHub repository
|
| 94 |
-
3. Railway will auto-detect Python
|
| 95 |
-
4. Add environment variables in the Railway dashboard
|
| 96 |
-
5. Deploy!
|
| 97 |
-
|
| 98 |
-
### Option 4: Hugging Face Spaces
|
| 99 |
-
|
| 100 |
-
1. Create a new Space on [Hugging Face](https://huggingface.co/spaces)
|
| 101 |
-
2. Select **Streamlit** as the SDK
|
| 102 |
-
3. Upload your files
|
| 103 |
-
4. Add secrets (environment variables) in Space settings
|
| 104 |
-
5. Deploy!
|
| 105 |
-
|
| 106 |
-
## 📁 Project Structure
|
| 107 |
-
|
| 108 |
-
```
|
| 109 |
-
.
|
| 110 |
-
├── app.py # Main Streamlit application
|
| 111 |
-
├── requirements.txt # Python dependencies
|
| 112 |
-
├── .env.example # Environment variables template
|
| 113 |
-
└── README.md # This file
|
| 114 |
-
```
|
| 115 |
-
|
| 116 |
-
## 🔧 Configuration
|
| 117 |
-
|
| 118 |
-
### Environment Variables
|
| 119 |
-
|
| 120 |
-
- `OPENAI_API_KEY` (Required): Your OpenAI API key for GPT-4 Turbo and DALL-E
|
| 121 |
-
- `FREEPIK_API_KEY` (Optional): Your Freepik API key for cost-efficient image sourcing
|
| 122 |
-
|
| 123 |
-
### Model Settings
|
| 124 |
-
|
| 125 |
-
The app uses:
|
| 126 |
-
- **GPT-4 Turbo** (`gpt-3.5-turbo`) for text generation
|
| 127 |
-
- **DALL-E 3** (`dall-e-3`) for image generation fallback
|
| 128 |
-
|
| 129 |
-
You can modify these in `app.py` if needed.
|
| 130 |
-
|
| 131 |
-
## 🎯 Future Enhancements
|
| 132 |
-
|
| 133 |
-
- [ ] PDF export functionality
|
| 134 |
-
- [ ] Adjustable tone/voice selection
|
| 135 |
-
- [ ] Batch article generation
|
| 136 |
-
- [ ] Article editing capabilities
|
| 137 |
-
- [ ] Custom image prompts
|
| 138 |
-
- [ ] Multiple language support
|
| 139 |
-
|
| 140 |
-
## 📝 License
|
| 141 |
-
|
| 142 |
-
This project is open source and available for personal and commercial use.
|
| 143 |
-
|
| 144 |
-
## 🤝 Contributing
|
| 145 |
-
|
| 146 |
-
Contributions are welcome! Feel free to submit issues or pull requests.
|
| 147 |
-
|
| 148 |
-
## ⚠️ Disclaimer
|
| 149 |
-
|
| 150 |
-
This tool generates AI content. Always review and fact-check generated articles before publishing. The AI may occasionally produce inaccurate or biased content.
|
| 151 |
-
|
| 152 |
-
---
|
| 153 |
-
|
| 154 |
-
**Built with ❤️ by Caveman Productions**
|
| 155 |
-
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Caveman Article Agent
|
| 3 |
+
emoji: 🧠
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: "1.39.0"
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|