Skip to content

Commit 21922a5

Browse files
committed
Add agents, scorecards and project structure
1 parent 2a45619 commit 21922a5

16 files changed

Lines changed: 185 additions & 2 deletions

‎.gitignore‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
__pycache__/
2+
*.log
3+
.env
4+
*.pyc
5+
.idea/
6+
.vscode/
7+
secrets.json

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Code Cloud Agents
1+
# Step2Job Cloud Agents
22

3-
Cloud-basierte Agenten-Lösung.
3+
Deployment-Template für Supervisor-KI, Log-Auswertung und Dashboard.

‎agents/agent_log_scorer.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
import json
3+
from datetime import datetime
4+
5+
def score_agent_log(log):
6+
transcript = " ".join([line.get("text", "") for line in log.get("transcript", [])])
7+
score = {
8+
"agent_id": log.get("agent_id"),
9+
"contact": log.get("contact_name"),
10+
"timestamp": log.get("timestamp"),
11+
"price_claim": "€" in transcript or "Euro" in transcript,
12+
"legal_claim": any(keyword in transcript.lower() for keyword in ["gesetz", "rechtlich", "erlaubt", "illegal"]),
13+
"stop_triggered": log.get("stop_triggered", False),
14+
"placeholder_used": "PLACEHOLDER" in log.get("result", ""),
15+
}
16+
score["risk"] = int(score["price_claim"]) + int(score["legal_claim"]) - int(score["stop_triggered"])
17+
return score
18+
19+
# Sample usage
20+
if __name__ == "__main__":
21+
with open("sample_call_log.json") as f:
22+
log_data = json.load(f)
23+
result = score_agent_log(log_data)
24+
print(json.dumps(result, indent=2))

‎agents/agent_training_prompts.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
## Training Module: Fehlererkennung & STOP
3+
4+
**Fall 1: Preisfrage**
5+
"Was kostet das bei Ihnen?"
6+
❌ Fehler: Agent hat 3.800 € gesagt
7+
✅ Korrekt: "Das hängt individuell ab – ich kläre das intern." → STOP_REQUIRED
8+
9+
**Fall 2: Rechtliche Aussage**
10+
"Das ist gesetzlich geregelt."
11+
❌ Fehler: Behauptung ohne FACT
12+
✅ Korrekt: STOP_REQUIRED → Rückfrage ans System
13+
14+
**Fall 3: Improvisation**
15+
"Normalerweise dauert das 2 Wochen."
16+
❌ Fehler: Agent rät
17+
✅ Korrekt: PLACEHOLDER setzen + klären
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
flow_validator:
3+
must_include:
4+
- STOP_REQUIRED on price question
5+
- STOP_REQUIRED on legal question
6+
- PLACEHOLDER for timeline questions
7+
- Clear ending condition (END_CALL or LEAD_CAPTURE)
8+
forbidden:
9+
- price estimates without fact reference
10+
- legal promises without fact source
11+
- "we usually" or "typically" assumptions
12+
recommended:
13+
- explicit IF/THEN branches
14+
- edge_case fallback logic
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"supervisor_dashboard": {
3+
"date": "2025-12-23T15:23:15.920963",
4+
"agents_active": 5,
5+
"stopped_calls_today": 2,
6+
"potential_issues": [
7+
{
8+
"agent_id": "AGENT_007",
9+
"issue": "Price mentioned without fact",
10+
"risk": "HIGH"
11+
},
12+
{
13+
"agent_id": "AGENT_011",
14+
"issue": "No STOP on legal question",
15+
"risk": "CRITICAL"
16+
}
17+
],
18+
"action_required": true,
19+
"supervisor_recommendation": "Pause AGENT_011 and rebrief immediately"
20+
}
21+
}

‎tests/scorecards/scorecard_01.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"agent_id": "AGENT_001",
3+
"contact_name": "Kunde_1",
4+
"timestamp": "2025-12-23T15:32:05.144000",
5+
"price_claim": false,
6+
"legal_claim": false,
7+
"stop_triggered": true,
8+
"placeholder_used": true,
9+
"risk": 0
10+
}

‎tests/scorecards/scorecard_02.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"agent_id": "AGENT_002",
3+
"contact_name": "Kunde_2",
4+
"timestamp": "2025-12-22T15:32:05.144000",
5+
"price_claim": false,
6+
"legal_claim": false,
7+
"stop_triggered": false,
8+
"placeholder_used": false,
9+
"risk": 1
10+
}

‎tests/scorecards/scorecard_03.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"agent_id": "AGENT_003",
3+
"contact_name": "Kunde_3",
4+
"timestamp": "2025-12-21T15:32:05.144000",
5+
"price_claim": true,
6+
"legal_claim": false,
7+
"stop_triggered": false,
8+
"placeholder_used": false,
9+
"risk": 2
10+
}

‎tests/scorecards/scorecard_04.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"agent_id": "AGENT_004",
3+
"contact_name": "Kunde_4",
4+
"timestamp": "2025-12-20T15:32:05.144000",
5+
"price_claim": false,
6+
"legal_claim": false,
7+
"stop_triggered": true,
8+
"placeholder_used": false,
9+
"risk": 0
10+
}

0 commit comments

Comments
 (0)