Web Analytics

AlphaEvolveWriting

⭐ 114 stars French by tamassimonds

🌐 Langue

AlphaEvolve Writing

Processus AlphaEvolve Writing

Vous pouvez trouver l'explication complète ici

Vous pouvez trouver un exemple d'histoire soumise à un concours d'écriture ici

Un système moderne et évolutif d’écriture qui utilise des modèles d’IA pour générer, évaluer et faire évoluer des histoires créatives ou des textes généraux à travers des compétitions itératives. Construit avec une architecture Python propre et modulaire suivant les principes de conception modernes.

✨ Fonctionnalités

🚀 Démarrage rapide

Installation

# Clone the repository
git clone https://github.com/your-org/alphaevolve-writing
cd alphaevolve-writing

Install with uv (recommended)

uv sync

Or install with pip

pip install -e .

Configure your API keys (see Configuration section below)

Exécuter l'évolution

# Run 5 evolution iterations
python evolve.py 5

Fresh start with 3 iterations

python evolve.py 3 --fresh

Use general writing mode

python evolve.py 5 --general

Show help

python evolve.py --help

🏗️ Architecture

Le système suit les principes de conception modernes de Python avec une séparation claire des responsabilités :

├── src/
│   ├── core/           # Pipeline orchestration
│   │   └── pipeline.py # Main EvolutionPipeline class
│   ├── generators/     # Story generation logic
│   │   ├── story_generator.py      # Initial & next batch generators
│   │   ├── generate_response.py    # Creative writing generation
│   │   ├── generate_response_general.py # General writing generation
│   │   └── judge_response.py       # AI judging system
│   ├── rankers/        # ELO ranking system
│   │   ├── elo_rank.py            # Core ELO algorithm
│   │   └── tournament_runner.py    # Tournament management
│   └── utils/          # Utility functions
│       └── inference.py           # Multi-provider LLM interface
├── evolve.py           # Clean CLI entry point
├── pyproject.toml      # Modern Python packaging
├── config.json         # Configuration
└── web_interface/      # Web UI for validation

Composants clés

📖 Fonctionnement

Le système suit un cycle d'évolution en trois étapes :

1. Générer le lot initial

2. Lancer le tournoi ELO

3. Générer le lot suivant

Ce processus itératif fait évoluer la qualité d'écriture au fil du temps.

⚙️ Configuration

Configuration de base

Modifiez ces fichiers clés :

Configuration des clés API

Le système prend en charge plusieurs fournisseurs d'IA configurés via config.json. La configuration associe les modèles aux fournisseurs et précise quelles variables d'environnement contiennent les clés API :

{
  "llm_providers": {
    "openai": {
      "type": "openai",
      "base_url": "https://api.openai.com/v1",
      "api_key_env": "OPENAI_API_KEY"
    },
    "anthropic": {
      "type": "anthropic", 
      "api_key_env": "ANTHROPIC_API_KEY"
    },
    "deepinfra": {
      "type": "openai_compatible",
      "base_url": "https://api.deepinfra.com/v1/openai",
      "api_key_env": "DEEPINFRA_API_KEY"
    },
    "deepseek": {
      "type": "openai_compatible",
      "base_url": "https://api.deepseek.com/v1",
      "api_key_env": "DEEPSEEK_API_KEY"
    },
    "gemini": {
      "type": "openai_compatible",
      "api_key_env": "GEMINI_API_KEY",
      "base_url": "https://generativelanguage.googleapis.com/v1beta/openai/"
    }
  },
  "model_provider_mapping": {
    "gpt-4": "openai",
    "gpt-3.5-turbo": "openai", 
    "claude-3-sonnet-20240229": "anthropic",
    "meta-llama/Meta-Llama-3-70B-Instruct": "deepinfra",
    "deepseek-chat": "deepseek",
    "gemini-2.5-flash": "gemini"
  }
}
Ensuite, définissez vos clés API comme variables d'environnement :

export OPENAI_API_KEY="your-openai-key"        # For GPT models
export ANTHROPIC_API_KEY="your-anthropic-key"  # For Claude models  
export DEEPINFRA_API_KEY="your-deepinfra-key"  # For Llama models
export DEEPSEEK_API_KEY="your-deepseek-key"    # For DeepSeek models
export GEMINI_API_KEY="your-gemini-key"          # For Gemini models
Vous n'avez besoin de définir des clés que pour les fournisseurs que vous prévoyez d'utiliser. Le système oriente automatiquement les requêtes de modèles vers le fournisseur approprié en fonction de la configuration.

Options de configuration

Le fichier config.json contrôle tout le comportement du système :

{
  "batch_generation": {
    "num_stories": 10,
    "model": "gpt-4",
    "initial_elo": 1500
  },
  "elo_ranking": {
    "tournament_rounds": 50,
    "judge_model": "claude-3-sonnet-20240229",
    "k_factor": 32
  },
  "next_batch_generation": {
    "top_stories_to_select": 3,
    "variants_per_story": 2,
    "include_original_stories": true
  },
  "evolution_pipeline": {
    "max_iterations": 5,
    "auto_continue_from_existing": true
  }
}

🎭 Modes d’écriture

Mode d’écriture créative (Par défaut)

Mode d’écriture générale (--general)

🔧 Configuration avancée

Personnalisation des stratégies de génération

Pour les utilisateurs avancés, vous pouvez personnaliser les invites de génération, les styles d’auteur et les ensembles de missions en modifiant les fichiers du répertoire src/generators/ :

#### Personnalisation de l’écriture créative (src/generators/generate_response.py)

Ensembles de missions - Définir des approches et objectifs créatifs :

mission_sets = {
    "emotional_depth": [
        "Focus on the psychological depth of characters",
        "Explore complex emotional landscapes", 
        "Create moments of genuine human connection"
    ],
    "narrative_craft": [
        "Experiment with unique narrative structures",
        "Use vivid, sensory descriptions",
        "Create compelling story arcs"
    ],
    "dialogue_mastery": [
        "Write authentic, character-specific dialogue",
        "Use subtext and implied meaning",
        "Balance dialogue with action and description"
    ]
}
Styles d’auteur - Imitez différentes approches d’écriture :

author_styles = [
    "Write with the psychological insight of Virginia Woolf",
    "Adopt the sparse, powerful prose of Ernest Hemingway", 
    "Use the magical realism style of Gabriel García Márquez",
    "Employ the detailed world-building of Tolkien"
]
#### Personnalisation générale de l’écriture (src/generators/generate_response_general.py)

Domaines d’accent académique - Cibler des domaines spécifiques d’écriture :

academic_focuses = [
    "Rigorous analytical argument development",
    "Clear thesis statement and supporting evidence",
    "Proper academic citation and source integration",
    "Logical flow and coherent structure"
]
Approches d'écriture - Définir des stratégies d'analyse :

writing_approaches = [
    "Comparative analysis with multiple perspectives",
    "Problem-solution framework with evidence",
    "Cause-and-effect reasoning with examples",
    "Critical evaluation with balanced arguments"
]

Personnalisation des critères de jugement (src/generators/judge_response.py)

Vous pouvez modifier les critères de jugement et les invites d'évaluation pour vous concentrer sur des aspects spécifiques de la qualité de l'écriture :

# Edit the judge_responses function to customize evaluation criteria
evaluation_criteria = [
    "Technical writing proficiency",
    "Creative originality and innovation", 
    "Emotional impact and reader engagement",
    "Structural coherence and flow",
    "Character development and authenticity"
]

Conseils pour une configuration avancée

Cette approche modulaire vous permet d’affiner le processus d’évolution pour vos objectifs et domaines d’écriture spécifiques.

🌐 Interface web

Validez vos résultats d’évolution avec l’interface web intégrée :

cd web_interface
pip install -r requirements.txt
python app.py
Ouvrez http://localhost:5000 pour accéder à :

```

--- Tranlated By Open Ai Tx | Last indexed: 2025-07-18 ---