The updated script now includes AI-powered behavior generation using Pydantic models and LiteLLM.
- Install required dependencies:
pip install litellm pydantic- Set your API key:
export OPENAI_API_KEY="your-api-key-here"python run_steps_given_character_1_4.py --character-id socratica_research_librarian_backstorypython run_steps_given_character_1_4.py \
--character-id socratica_research_librarian_backstory \
--enhancer-model "anthropic/claude-sonnet-4-20250514" \
--behavior-model "gpt-4o-2024-08-06"python run_steps_given_character_1_4.py \
--character-id socratica_research_librarian_backstory \
--dry-runpython run_steps_given_character_1_4.py \
--character-id socratica_research_librarian_backstory \
--skip-steps 2 3- Registers the character in
character_definitions.json - Skips if character already exists
- Uses Claude Sonnet 4 to enhance the character's system prompt
- Improves traits and key facts
- Updates character definition
- Extracts and refines traits from the system prompt
- Generates key facts that can be tested
- Updates character definition
- Uses AI to generate comprehensive behavior definitions
- Creates realistic evaluation examples for each behavior
- Updates
behaviors.jsonwith new behaviors - Creates example files in
behaviors/examples/ - Updates character with evaluation list
After running the script, you'll have:
- Updated
character_definitions.json- Enhanced character with traits, facts, and evaluations - Updated
behaviors.json- New behavior definitions - Example files in
behaviors/examples/- Realistic conversation examples for each behavior - Next steps markdown file - Commands to run steps 5-6
🎭 socratica_research_librarian_backstory - Steps 1-4 Automation
======================================================================
Enhancer Model: anthropic/claude-sonnet-4-20250514
Behavior Model: gpt-4o-2024-08-06
======================================================================
📝 Step 1: Character Registration
✅ Character 'socratica_research_librarian_backstory' already exists, skipping registration.
🤖 Step 2: AI Enhancement
✅ Character 'socratica_research_librarian_backstory' enhanced successfully using anthropic/claude-sonnet-4-20250514
🎯 Step 3: Traits & Facts Derivation
✅ Traits and facts derived successfully using anthropic/claude-sonnet-4-20250514
📋 Step 4: Behavior Setup with AI Generation
Character: Socratica
Traits: 7 traits
Key Facts: 11 facts
🤖 Generating behaviors using gpt-4o-2024-08-06...
✅ Generated 8 behaviors:
- socratica_collaborative
- socratica_guiding
- socratica_critical
- socratica_development
- socratica_intellectual
- socratica_librarian
- socratica_challenging
- socratica_self_knowledge
✅ Updated behaviors.json with 8 behaviors
🎭 Generating behavior examples...
Generating example for socratica_collaborative...
✅ Saved to auto_eval_gen/behaviors/examples/socratica_collaborative.json
Generating example for socratica_guiding...
✅ Saved to auto_eval_gen/behaviors/examples/socratica_guiding.json
...
✅ Generated 8 behavior examples
✅ Updated character with 8 evaluations
✅ Behavior setup completed for 'socratica_research_librarian_backstory'
- 8 behaviors generated
- 8 examples created
- behaviors.json updated
- character_definitions.json updated
✅ Steps 1-4 completed successfully for socratica_research_librarian_backstory!
🎉 SUCCESS!
==================================================
✅ Steps 1-4 completed successfully for socratica_research_librarian_backstory
📝 Next steps guide created: socratica_research_librarian_backstory.md
Next: Follow the commands in the markdown file to complete steps 5-6
The fine-tuning script will automatically update globals.py with the new model
Run the test script to verify everything works:
python test_behavior_generation.pyThis will:
- Check dependencies
- Test behavior generation
- Test step 4 functionality
- Provide feedback on any issues
- Check your API key is set correctly
- Verify you have internet connectivity
- Try a different model with
--behavior-model - The script will fall back to basic behavior setup
- Make sure you're in the project root directory
- Check that all required files exist
- Install missing dependencies
- Check the character ID exists in
character_definitions.json - Use the exact character ID from the file
- List available characters with:
grep -o '"[^"]*":' auto_eval_gen/character_definitions.json
Some characters you can test with:
socratica_research_librarian_backstoryclyde_thoughtful_assistant_backstoryrudi_storyteller_companion_backstorygenesis_helpful_assistant_backstoryagora_collaborative_thinker_backstory