3v324v23's picture
fix: use actual robot emoji for HuggingFace YAML validation
d26a747
|
Raw
History Blame Contribute Delete
2.21 kB
---
title: Customer Support AI API
emoji: ๐Ÿค–
colorFrom: blue
colorTo: green
sdk: docker
pinned: false
---
# ๐ŸŽฎ AI Customer Support Simulator
A strict, deterministic RL-style environment for training and evaluating AI agents on customer support tasks.
## ๐Ÿ—๏ธ Architecture
```
โ”œโ”€โ”€ models.py # Core data models (Episode, StepResult, Task)
โ”œโ”€โ”€ environment.py # Strict step enforcement + fail logic
โ”œโ”€โ”€ inference.py # Rule-based agent + CLI runner
โ”œโ”€โ”€ app.py # Gradio UI
โ”œโ”€โ”€ tasks/
โ”‚ โ”œโ”€โ”€ easy_task.py # Delayed delivery complaint
โ”‚ โ”œโ”€โ”€ medium_task.py # Billing double-charge
โ”‚ โ””โ”€โ”€ hard_task.py # Angry VIP threatening legal action
โ”œโ”€โ”€ graders/
โ”‚ โ””โ”€โ”€ base_grader.py # BaseGrader + HardTaskGrader
โ””โ”€โ”€ tests/
โ””โ”€โ”€ test_cases.py # 4 mandatory test scenarios
```
## ๐ŸŽฏ Step Flow
**Empathy โ†’ Collect Info โ†’ Investigate โ†’ Resolution**
Each step must be completed correctly before advancing.
## ๐Ÿ“Š Reward Formula
```
reward = base_score + step_bonus โˆ’ penalty
```
| Component | Value |
|---------------|--------|
| Base (correct)| 1.00 |
| Base (wrong) | 0.20 |
| Step bonus | 0.20 |
| Max per step | **1.20** |
| Episode max | **4.80** |
## โš ๏ธ Penalties
| Trigger | Penalty |
|-------------------------------|---------|
| Wrong action in step | โˆ’0.30 |
| Repeated response | โˆ’0.20 |
| Early solution | โˆ’0.25 |
| Angry customer ignored | โˆ’0.25 |
| Generic / too-short response | โˆ’0.15 |
| Wrong assumption | โˆ’0.20 |
| Skipped step | โˆ’0.30 |
## ๐Ÿ’ฅ Fail Conditions
- More than **3 wrong steps** across episode
- Total reward below **1.5**
- Agent stuck in loop: **3 consecutive failures** at same step
- Single-step penalty โ‰ฅ 0.80
## ๐Ÿš€ Local Setup
```bash
pip install -r requirements.txt
python inference.py --task all --agent rule # CLI test
python app.py # Gradio UI
python tests/test_cases.py # Run tests
```