An automated system for generating and updating custom chatter files for the EDCopilot platform using AI language models.
- Smart AI Conversations: Creates fresh, engaging conversations using advanced AI (OpenAI and Claude) that sound natural and varied
- Personal Touch: Makes conversations feel personal by including your commander name, squadron, and preferences from your settings
- Natural Variety: Creates conversations that feel realistic by mixing in personal details, news references, and context tags at natural intervals
- Fresh News & Content: Pulls in recent Elite Dangerous Galnet to keep conversations current and relevant
-
Clone the repository
git clone <repository-url> cd ConversationRefresher
-
Install dependencies
py -m pip install -r requirements.txt
-
Configure environment
copy env.example .env # Edit .env with your API keys and settings
-
Run the updater
py src/main.py
Note: This project uses py
to execute Python on Windows systems. If you're using a different operating system, replace py
with python
or python3
as appropriate.
Create a .env
file with the following variables:
# API Keys
KEY_OPENAI=your_openai_api_key_here
KEY_ANTHROPIC=your_anthropic_api_key_here
# Model Configuration
MODEL_ANTHROPIC=claude-3-7-sonnet-20250219
MODEL_OPENAI=gpt-4.1-mini
# Provider Configuration
PROVIDER_PREFERRED=OPENAI
# Directory Configuration
DIR_CUSTOM=path/to/your/edcopilot/custom/directory # Path to EDCopilot custom files directory (used in production mode)
# Optional Configuration
LOG_LEVEL=INFO
MAX_RETRIES=3
CONTENT_LENGTH=50
CONVERSATIONS_COUNT=30 # Default number of conversation pieces to generate (when not in debug mode)
CONVERSATIONS_CHANCE_PERSONALIZATION=25 # Percentage chance for personalization references
CONVERSATIONS_CHANCE_RSS=15 # Percentage chance for RSS feed references
CONVERSATIONS_CHANCE_CONDITIONALS=10 # Percentage chance for context tags
The system automatically routes output to the appropriate directory based on the mode:
- Production Mode (default): Writes directly to the EDCopilot custom directory specified in
DIR_CUSTOM
- Debug Mode (
--debug
): Writes to the project'soutput/
directory for testing and review
This ensures that generated content goes directly to EDCopilot when ready for use, while allowing safe testing in debug mode.
The system uses configurable probability percentages to create natural, varied conversations:
- Context Tags (Conditionals): Only 10% of conversations include context tags like
(not-station)
,(not-planet)
,(not-deep-space)
- Personalization References: Only 25% of conversations include personal references (commander name, squadron, fleet carrier)
- RSS Feed References: Only 15% of conversations reference recent news and events
This ensures conversations feel natural and varied, avoiding over-personalization or excessive context tagging.
Create a personalization.md
file to provide context for content generation:
# Personalization
## Specific Data
- Commander Name: Your Commander Name
- Squadron Name: Your Squadron Name
- Theme: Your preferred themes and style
## RSS Feeds
- https://www.elitedangerous.com/en-GB/rss/galnet.xml
## Quick Notes
- Your content preferences and guidelines
- Topics to include or avoid
- Humor style and tone preferences
The system uses template files in the prompts/
directory to generate content. You can create and customize these templates to control the style and content of generated conversations.
π For detailed template documentation, see prompts/README.md
Generate content for all chatter types:
py src/main.py
Validate setup without generating content:
py src/main.py --test
Output generated content to the shell:
py src/main.py --debug
Generate content for specific chatter types:
# Generate for one file type
py src/main.py --files chit_chat --debug
# Generate for multiple file types
py src/main.py --files space_chatter crew_chatter --debug
# Adjust the number of entries (default: 5)
py src/main.py --files deep_space_chatter --max-entries 10 --debug
Disable personalization features:
# Disable all personalization
py src/main.py --no-personalization
# Disable RSS feeds only
py src/main.py --no-rss
# Disable web content only
py src/main.py --no-web
Control content replacement:
# Keep existing content and merge with new content (default: replace entirely)
py src/main.py --keep-existing
Option | Description |
---|---|
--test |
Run in test mode (validate only) |
--debug |
Enable debug mode - output generated content to shell |
--files |
Generate content for specific file types only |
--max-entries |
Maximum number of entries to generate per file (default: from CONVERSATIONS_COUNT config, or 5 in debug mode) |
--keep-existing |
Keep existing content and merge with new content (default: replace entirely) |
--no-personalization |
Disable personalization context |
--no-rss |
Disable RSS feed fetching |
--no-web |
Disable web content fetching |
--clear-cache |
Clear RSS cache before running |
--cache-info |
Show RSS cache information and exit |
--prompt-only |
enable's debug mode & outputs the prompts that would have been sent to the LLM for review placing them in the output directory |
--generate-prompt-template |
Generate specific prompt files for each chatter type in the prompts directory (enables debug mode) |
chit_chat
- General chit chat conversationsspace_chatter
- Space exploration and astronomy discussionscrew_chatter
- Ship crew interactions and operationsdeep_space_chatter
- Deep space exploration and mysteries
py src/main.py --files chit_chat --debug --max-entries 3
py src/main.py --files chit_chat
py src/main.py --files space_chatter crew_chatter --no-personalization
py src/main.py --debug --max-entries 10
# Show cache information
py src/main.py --cache-info
# Clear cache and run
py src/main.py --clear-cache --files chit_chat
# Generate specific prompt files for each chatter type
py src/main.py --generate-prompt-template
# Generate prompt files for specific chatter types only
py src/main.py --generate-prompt-template --files chit_chat crew_chatter
# Generate prompt file for one chatter type
py src/main.py --generate-prompt-template --files space_chatter
ConversationRefresher/
βββ src/
β βββ config.py # Configuration management
β βββ main.py # Main orchestrator
β βββ generators/ # Content generators
β β βββ base_generator.py
β β βββ chit_chat_generator.py
β β βββ space_chatter_generator.py
β β βββ crew_chatter_generator.py
β β βββ deep_space_chatter_generator.py
β βββ utils/ # Utility modules
β βββ api_client.py # API client for OpenAI/Anthropic
β βββ file_manager.py # File operations and backups
β βββ personalization.py # Personalization context management
βββ prompts/ # Prompt template files
β βββ README.md # Template documentation
β βββ sample.prompt.md # Example template
β βββ prompt_*.md # Chatter type templates
βββ scheduler.py # Windows Task Scheduler integration
βββ run_updater.bat # Simple batch script
βββ run_updater.ps1 # PowerShell script
βββ test_setup.py # Setup validation
βββ requirements.txt # Python dependencies
βββ .env.example # Environment template
βββ personalization.md # User personalization context
βββ logs/ # Log files
βββ backups/ # Backup files
βββ cache/ # RSS cache files
βββ output/ # Generated content files
Use the included PowerShell script to set up automated execution:
.\run_updater.ps1 -SetupScheduler -Frequency Weekly
Run the updater manually using the batch script:
run_updater.bat
If you want EDCopilot to launch after the updater runs make sure you set the following in your .env file:
- START_EDCOPILOT_AFTER_UPDATE=TRUE
- DIR_EDCOPILOT=C:\Path\To\EDCopilot
- API Key Errors: Ensure your API keys are correctly set in the
.env
file - Directory Not Found: Verify the
DIR_CUSTOM
path exists and is accessible (in production mode) or check theoutput/
directory (in debug mode) - Permission Errors: Run as administrator if needed for file operations
- Network Issues: Check internet connectivity for API calls and RSS feeds
Check the logs/
directory for detailed execution logs. Log files are timestamped for easy tracking.
Run the test script to validate your setup:
py test_setup.py
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Operating System: Windows 10/11 with PowerShell
- Python Version: Python 3.8 or higher
- Python Execution: Uses
py
command on Windows systems - API Dependencies: OpenAI API, Anthropic Claude API access