|
| 1 | +# WordFlow Configuration Guide |
| 2 | + |
| 3 | +This guide provides detailed information on how to configure and customize WordFlow to suit your specific needs. Proper configuration ensures optimal performance and functionality of the WordFlow application. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [WordFlow Configuration Guide](#wordflow-configuration-guide) |
| 8 | + - [Table of Contents](#table-of-contents) |
| 9 | + - [Environment Variables](#environment-variables) |
| 10 | + - [WordPress Site Configuration](#wordpress-site-configuration) |
| 11 | + - [AI Model Settings](#ai-model-settings) |
| 12 | + - [Content Generation Settings](#content-generation-settings) |
| 13 | + - [SEO Settings](#seo-settings) |
| 14 | + - [Image Generation Settings](#image-generation-settings) |
| 15 | + - [Scheduling Options](#scheduling-options) |
| 16 | + - [Performance Tuning](#performance-tuning) |
| 17 | + |
| 18 | +## Environment Variables |
| 19 | + |
| 20 | +WordFlow uses environment variables for sensitive information and global settings. Create a `.env` file in the root directory of the project and add the following variables: |
| 21 | + |
| 22 | +``` |
| 23 | +# API Keys |
| 24 | +OPENAI_API_KEY=your_openai_api_key_here |
| 25 | +REPLICATE_API_TOKEN=your_replicate_api_token_here |
| 26 | +SERPER_API_KEY=your_serper_api_key_here |
| 27 | +
|
| 28 | +# Default Settings |
| 29 | +DEFAULT_LANGUAGE=English |
| 30 | +DEFAULT_OPENAI_MODEL=gpt-3.5-turbo |
| 31 | +DEFAULT_IMAGE_MODEL=stability-ai/stable-diffusion |
| 32 | +DEFAULT_COUNTRY=us |
| 33 | +
|
| 34 | +# Performance Settings |
| 35 | +BATCH_SIZE=5 |
| 36 | +MAX_CONCURRENT_REQUESTS=20 |
| 37 | +``` |
| 38 | + |
| 39 | +Replace the placeholder values with your actual API keys and preferred default settings. |
| 40 | + |
| 41 | +## WordPress Site Configuration |
| 42 | + |
| 43 | +WordPress sites are configured in the `websites` dictionary in the `app.py` file. Add or modify sites using the following format: |
| 44 | + |
| 45 | +```python |
| 46 | +websites = { |
| 47 | + 1: { |
| 48 | + "url": "https://example.com/wp-json/wp/v2/", |
| 49 | + "user": "your_username", |
| 50 | + "password": "your_password" |
| 51 | + }, |
| 52 | + # Add more sites as needed |
| 53 | +} |
| 54 | +``` |
| 55 | + |
| 56 | +Ensure that you're using application passwords for enhanced security. To generate an application password: |
| 57 | + |
| 58 | +1. Go to your WordPress dashboard |
| 59 | +2. Navigate to Users → Profile |
| 60 | +3. Scroll down to the Application Passwords section |
| 61 | +4. Enter a name for the application password and click "Add New" |
| 62 | +5. Copy the generated password and use it in the configuration |
| 63 | + |
| 64 | +## AI Model Settings |
| 65 | + |
| 66 | +Configure AI model settings in the Streamlit sidebar: |
| 67 | + |
| 68 | +- **Input Language**: Select the primary language for content generation. |
| 69 | +- **OpenAI Model**: Choose between different OpenAI models (e.g., GPT-3.5-turbo, GPT-4). |
| 70 | +- **Image AI Model**: Select the AI model for image generation. |
| 71 | + |
| 72 | +These settings can be adjusted per session in the Streamlit interface. |
| 73 | + |
| 74 | +## Content Generation Settings |
| 75 | + |
| 76 | +Customize content generation in the `generate_html_content` function: |
| 77 | + |
| 78 | +- Modify the HTML structure for generated content |
| 79 | +- Adjust the word count or structure of different sections |
| 80 | +- Customize the prompt to fit your content style and requirements |
| 81 | + |
| 82 | +## SEO Settings |
| 83 | + |
| 84 | +SEO settings are managed in the `generate_seo_elements` function: |
| 85 | + |
| 86 | +- Modify the list of generated SEO elements |
| 87 | +- Adjust the format of meta descriptions, titles, and keywords |
| 88 | +- Customize the prompt to align with your SEO strategy |
| 89 | + |
| 90 | +## Image Generation Settings |
| 91 | + |
| 92 | +Configure image generation settings in the Streamlit sidebar: |
| 93 | + |
| 94 | +- **Number of Images**: Set the number of images to generate per post |
| 95 | +- **Image AI Model**: Choose the AI model for image generation |
| 96 | + |
| 97 | +Adjust the `generate_image_async` function to modify image generation parameters. |
| 98 | + |
| 99 | +## Scheduling Options |
| 100 | + |
| 101 | +Post scheduling options are available in the Streamlit sidebar: |
| 102 | + |
| 103 | +- **Relative to today**: Schedule posts relative to the current date |
| 104 | +- **Specific date**: Set an exact date and time for post publishing |
| 105 | + |
| 106 | +Modify the `create_post_async` function to adjust how posts are scheduled and published. |
| 107 | + |
| 108 | +## Performance Tuning |
| 109 | + |
| 110 | +Optimize performance by adjusting the following settings: |
| 111 | + |
| 112 | +- **BATCH_SIZE**: Number of keywords processed in each batch (in `.env` file) |
| 113 | +- **MAX_CONCURRENT_REQUESTS**: Maximum number of concurrent API requests (in `.env` file) |
| 114 | +- Adjust the `asyncio.Semaphore` value in the code to control concurrency |
| 115 | + |
| 116 | +Monitor the application's performance and adjust these values as needed based on your system's capabilities and API rate limits. |
| 117 | + |
| 118 | +--- |
| 119 | + |
| 120 | +Remember to restart the Streamlit application after making changes to the configuration files or environment variables. If you encounter any issues or need further customization, please refer to the project's documentation or open an issue on the GitHub repository. |
0 commit comments