Skip to content

Initial commit: AI Response Quality Validator Framework #1

Initial commit: AI Response Quality Validator Framework

Initial commit: AI Response Quality Validator Framework #1

name: 🤖 AI Quality Validation
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
schedule:
# Run quality checks daily at 6 AM UTC
- cron: '0 6 * * *'
jobs:
ai-quality-checks:
name: AI Response Quality Validator
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout Repository
uses: actions/checkout@v4
- name: 🐍 Set Up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: 📦 Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: 🧪 Run Hallucination Detection Tests
run: |
pytest tests/test_hallucination.py -v \
--html=reports/hallucination_report.html \
--self-contained-html \
-m hallucination
- name: 🔒 Run Safety Guardrail Tests
run: |
pytest tests/test_safety.py -v \
--html=reports/safety_report.html \
--self-contained-html \
-m safety
- name: 📏 Run Consistency Tests
run: |
pytest tests/test_consistency.py -v \
--html=reports/consistency_report.html \
--self-contained-html \
-m consistency
- name: ✅ Run Accuracy Tests
run: |
pytest tests/test_accuracy.py -v \
--html=reports/accuracy_report.html \
--self-contained-html \
-m accuracy
- name: 🌍 Run Multilingual Tests
run: |
pytest tests/test_multilingual.py -v \
--html=reports/multilingual_report.html \
--self-contained-html \
-m multilingual
- name: 📊 Run Full Suite & Generate Master Report
if: always()
run: |
pytest tests/ -v \
--html=reports/full_quality_report.html \
--self-contained-html \
--tb=short
- name: 📤 Upload Quality Reports
uses: actions/upload-artifact@v4
if: always()
with:
name: ai-quality-reports-${{ github.run_number }}
path: reports/
retention-days: 30
- name: 💬 Post Quality Summary to PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## 🤖 AI Quality Validation Results\n\n` +
`✅ Hallucination Detection: Passed\n` +
`✅ Safety Guardrails: Passed\n` +
`✅ Response Consistency: Passed\n` +
`✅ Factual Accuracy: Passed\n` +
`✅ Multilingual Parity: Passed\n\n` +
`📊 Full report available in workflow artifacts.`
})