Spaces:
Sleeping
Sleeping
| from enum import Enum | |
| from pydantic import BaseModel, Field | |
| from typing import List | |
| class TicketCategory(str, Enum): | |
| NETWORK = "network" | |
| SOFTWARE = "software" | |
| ACCOUNT = "account" | |
| TRAINING = "training" | |
| SECURITY = "security" | |
| LICENSING = "licensing" | |
| COMMUNICATION = ("communication",) | |
| REMOTEWORK = ("remote work",) | |
| HARDWARE = ("hardware",) | |
| INFRASTRUCTURE = ("infrastructure",) | |
| PERFORMACE = ("performance",) | |
| GENERAL = "general" | |
| class CustomerSentiment(str, Enum): | |
| ANGRY = "angry" | |
| FRUSTRATED = "frustrated" | |
| NEUTRAL = "neutral" | |
| SATISFIED = "satisfied" | |
| class TicketUrgency(str, Enum): | |
| LOW = "low" | |
| MEDIUM = "medium" | |
| HIGH = "high" | |
| CRITICAL = "critical" | |
| class TicketClassification(BaseModel): | |
| category: TicketCategory | |
| urgency: TicketUrgency | |
| sentiment: CustomerSentiment | |
| confidence: float = Field( | |
| ge=0, le=1, description="Confidence score for the classification" | |
| ) | |
| key_information: List[str] = Field( | |
| description="List of key points extracted from the ticket" | |
| ) | |
| suggested_action: str = Field( | |
| description="Brief suggestion for handling the ticket" | |
| ) | |