Web Analytics

AlphaEvolveWriting

⭐ 114 stars Thai by tamassimonds

🌐 ภาษา

AlphaEvolve Writing

AlphaEvolve Writing Process

คุณสามารถอ่านคำอธิบายฉบับเต็มได้ที่ ที่นี่

คุณสามารถดูตัวอย่างเรื่องราวที่ส่งเข้าประกวดการเขียนได้ ที่นี่

ระบบการเขียนยุคใหม่ที่ใช้โมเดล AI ในการสร้าง ประเมิน และพัฒนางานเขียนหรือเรื่องราวสร้างสรรค์ผ่านการแข่งขันแบบวนซ้ำ สร้างด้วยสถาปัตยกรรม Python ที่เป็นโมดูลและสะอาดตามหลักการออกแบบยุคใหม่

✨ คุณสมบัติ

🚀 เริ่มต้นอย่างรวดเร็ว

การติดตั้ง

# 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)

เรียกใช้งานวิวัฒนาการ

# 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

🏗️ สถาปัตยกรรม

ระบบนี้ปฏิบัติตามหลักการออกแบบ Python สมัยใหม่ โดยมีการแยกหน้าที่อย่างชัดเจน:

├── 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

องค์ประกอบสำคัญ

📖 วิธีการทำงาน

ระบบจะดำเนินการตามวงจรวิวัฒนาการสามขั้นตอน:

1. สร้างชุดแรก

2. จัดการแข่งขัน ELO

3. สร้างชุดถัดไป

กระบวนการวนซ้ำนี้จะทำให้ผลงานเขียนพัฒนาดีขึ้นอย่างต่อเนื่อง

⚙️ การกำหนดค่า

การตั้งค่าพื้นฐาน

แก้ไขไฟล์สำคัญเหล่านี้:

การตั้งค่า API Keys

ระบบรองรับผู้ให้บริการ AI หลายรายโดยกำหนดค่าใน config.json ซึ่งกำหนดโมเดลกับผู้ให้บริการ และระบุว่า environment variable ใดใช้เก็บ API key:

{
  "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"
  }
}
จากนั้นตั้งค่า API keys ของคุณเป็น environment variables:

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
คุณเพียงแค่ต้องตั้งค่า key สำหรับผู้ให้บริการที่คุณต้องการใช้งานเท่านั้น ระบบจะส่งคำขอโมเดลไปยังผู้ให้บริการที่ถูกต้องโดยอัตโนมัติตามค่าคอนฟิก

ตัวเลือกการกำหนดค่า

ไฟล์ config.json ควบคุมพฤติกรรมทั้งหมดของระบบ:

{
  "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
  }
}

🎭 โหมดการเขียน

โหมดเขียนเชิงสร้างสรรค์ (ค่าเริ่มต้น)

โหมดเขียนทั่วไป (--general)

🔧 การตั้งค่าขั้นสูง

การปรับแต่งกลยุทธ์การสร้างเนื้อหา

สำหรับผู้ใช้ขั้นสูง คุณสามารถปรับแต่งพรอมต์การสร้าง สไตล์ผู้เขียน และชุดภารกิจได้โดยแก้ไขไฟล์ในไดเรกทอรี src/generators/:

#### การปรับแต่งงานเขียนเชิงสร้างสรรค์ (src/generators/generate_response.py)

ชุดภารกิจ - กำหนดแนวทางและเป้าหมายเชิงสร้างสรรค์:

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"
    ]
}
สไตล์ผู้เขียน - เลียนแบบแนวทางการเขียนที่แตกต่างกัน:

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"
]
#### การปรับแต่งการเขียนทั่วไป (src/generators/generate_response_general.py)

หัวข้อเน้นทางวิชาการ - มุ่งเน้นไปที่โดเมนการเขียนเฉพาะทาง:

academic_focuses = [
    "Rigorous analytical argument development",
    "Clear thesis statement and supporting evidence",
    "Proper academic citation and source integration",
    "Logical flow and coherent structure"
]
แนวทางการเขียน - กำหนดกลยุทธ์การวิเคราะห์:

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

การปรับแต่งเกณฑ์การตัดสิน (src/generators/judge_response.py)

คุณสามารถปรับเปลี่ยนเกณฑ์การตัดสินและข้อความประเมินเพื่อเน้นในแง่มุมเฉพาะของคุณภาพงานเขียน:

# 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"
]

เคล็ดลับสำหรับการตั้งค่าขั้นสูง

แนวทางแบบแยกส่วนนี้ช่วยให้คุณสามารถปรับแต่งกระบวนการวิวัฒนาการให้เหมาะกับเป้าหมายและโดเมนการเขียนของคุณโดยเฉพาะ

🌐 อินเทอร์เฟซเว็บ

ตรวจสอบผลลัพธ์การวิวัฒนาการของคุณด้วยอินเทอร์เฟซเว็บในตัว:

cd web_interface
pip install -r requirements.txt
python app.py
เปิด http://localhost:5000 เพื่อเข้าถึง:

```

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