File size: 846 Bytes
fb78c46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import random
import uuid

ISSUE_TEMPLATES = {
    "billing": ["I was overcharged on my last invoice.", "How do I update my credit card?", "Cancel my subscription."],
    "tech": ["The app keeps crashing on startup.", "I can't log in to my account.", "API is returning 500 errors."],
    "general": ["What are your business hours?", "Where can I find the documentation?", "Do you offer enterprise plans?"]
}
SENTIMENTS = ["angry", "frustrated", "neutral", "polite"]

def generate_ticket(level: str):
    category = random.choice(list(ISSUE_TEMPLATES.keys()))
    message = random.choice(ISSUE_TEMPLATES[category])
    sentiment = random.choice(SENTIMENTS)
    
    return {
        "id": f"TKT-{uuid.uuid4().hex[:8].upper()}",
        "category": category,
        "message": message,
        "sentiment": sentiment,
        "level": level
    }