Spaces:
Build error
Build error
Download response_validation.py from srijan9994/rag-application: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/spaces/srijan9994/rag-application/resolve/main/response_validation.py
- Command line
-
hf download hf://spaces/srijan9994/rag-application/response_validation.py
-
curl -L -o response_validation.py https://huggingface.co/spaces/srijan9994/rag-application/resolve/main/response_validation.py
1.19 kB
| 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" | |
| ) | |