Galileo Luna-2 Integration Examples
This directory contains examples demonstrating Agent Control integration with Galileo’s Luna-2 Protect service for real-time toxicity detection and content moderation.Luna-2 Demo (luna2_demo.py)
Demonstrates using the Luna-2 evaluator with a CENTRAL stage for toxicity detection.
Prerequisites
- Galileo API Key: Get yours from Galileo Console
- Galileo Project: Create a project and stage in the Galileo Console
- Agent Control: Install with Luna-2 support
Setup
What it Does
The demo tests various inputs against a pre-configured toxicity detection stage:- ✅ Safe greetings and questions pass through
- 🚫 Toxic content gets blocked
- 📊 Toxicity scores are displayed for each input
- 🔗 Trace IDs link to detailed analysis in Galileo Console
Central vs Local Stages
- Central Stage (used in this demo): Rulesets and policies are pre-configured on the Galileo server. Simply reference the stage by name.
- Local Stage: Define rulesets at runtime in your code (see evaluator documentation).
Expected Output
Troubleshooting
- “GALILEO_API_KEY environment variable is required”: Export your API key
- “Project not found”: Set
GALILEO_PROJECT_NAMEto match your Galileo project - “Stage not found”: Set
GALILEO_STAGE_NAMEto match a stage in your project - Import errors: Ensure you installed with
[galileo]extra:pip install agent-control-evaluators[galileo]
Documentation
Source Code
View the complete example with all scripts and setup instructions:Galileo Luna-2 Integration Example