Spaces:
Sleeping
Sleeping
File size: 2,210 Bytes
397249e d26a747 397249e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | ---
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
``` |