feat: Add Streamlit dashboard with Blueprint compliance (v2.1.0)
Dashboard Features: - 8 navigation sections: Overview, Outcomes, Poor CX, FCR, Churn, Agent, Call Explorer, Export - Beyond Brand Identity styling (colors #6D84E3, Outfit font) - RCA Sankey diagram (Driver → Outcome → Churn Risk flow) - Correlation heatmaps (driver co-occurrence, driver-outcome) - Outcome Deep Dive (root causes, correlation, duration analysis) - Export functionality (Excel, HTML, JSON) Blueprint Compliance: - FCR: 4 categories (Primera Llamada/Rellamada × Sin/Con Riesgo de Fuga) - Churn: Binary view (Sin Riesgo de Fuga / En Riesgo de Fuga) - Agent: Talento Para Replicar / Oportunidades de Mejora - Fixed FCR rate calculation (only FIRST_CALL counts as success) Technical: - Streamlit + Plotly for interactive visualizations - Light theme configuration (.streamlit/config.toml) - Fixed Plotly colorbar titlefont deprecation Documentation: - Updated PROJECT_CONTEXT.md, TODO.md, CHANGELOG.md - Added 4 new technical decisions (TD-014 to TD-017) - Created TROUBLESHOOTING.md with 10 common issues Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
217
config/prompts/call_analysis/v2.0/schema.json
Normal file
217
config/prompts/call_analysis/v2.0/schema.json
Normal file
@@ -0,0 +1,217 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "CallAnalysisResponseV2",
|
||||
"description": "LLM response schema for comprehensive call analysis (v2.0 - Blueprint aligned)",
|
||||
"type": "object",
|
||||
"required": ["outcome"],
|
||||
"properties": {
|
||||
"outcome": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"SALE_COMPLETED",
|
||||
"SALE_LOST",
|
||||
"CANCELLATION_SAVED",
|
||||
"CANCELLATION_COMPLETED",
|
||||
"INQUIRY_RESOLVED",
|
||||
"INQUIRY_UNRESOLVED",
|
||||
"COMPLAINT_RESOLVED",
|
||||
"COMPLAINT_UNRESOLVED",
|
||||
"TRANSFER_OUT",
|
||||
"CALLBACK_SCHEDULED",
|
||||
"UNKNOWN"
|
||||
],
|
||||
"description": "Final outcome of the call"
|
||||
},
|
||||
"lost_sales_drivers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/RCALabel"
|
||||
},
|
||||
"maxItems": 5,
|
||||
"default": []
|
||||
},
|
||||
"poor_cx_drivers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/RCALabel"
|
||||
},
|
||||
"maxItems": 5,
|
||||
"default": []
|
||||
},
|
||||
"fcr_status": {
|
||||
"type": "string",
|
||||
"enum": ["FIRST_CALL", "REPEAT_CALL", "UNKNOWN"],
|
||||
"default": "UNKNOWN",
|
||||
"description": "First Call Resolution status"
|
||||
},
|
||||
"fcr_failure_drivers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/RCALabel"
|
||||
},
|
||||
"maxItems": 5,
|
||||
"default": [],
|
||||
"description": "Factors that may cause repeat calls"
|
||||
},
|
||||
"churn_risk": {
|
||||
"type": "string",
|
||||
"enum": ["NO_RISK", "AT_RISK", "UNKNOWN"],
|
||||
"default": "UNKNOWN",
|
||||
"description": "Customer churn risk classification"
|
||||
},
|
||||
"churn_risk_drivers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/RCALabel"
|
||||
},
|
||||
"maxItems": 5,
|
||||
"default": [],
|
||||
"description": "Factors indicating churn risk"
|
||||
},
|
||||
"agent_classification": {
|
||||
"type": "string",
|
||||
"enum": ["GOOD_PERFORMER", "NEEDS_IMPROVEMENT", "MIXED", "UNKNOWN"],
|
||||
"default": "UNKNOWN",
|
||||
"description": "Agent skill classification"
|
||||
},
|
||||
"agent_positive_skills": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/AgentSkillIndicator"
|
||||
},
|
||||
"maxItems": 5,
|
||||
"default": [],
|
||||
"description": "Positive skills demonstrated (Buen Comercial)"
|
||||
},
|
||||
"agent_improvement_areas": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/AgentSkillIndicator"
|
||||
},
|
||||
"maxItems": 5,
|
||||
"default": [],
|
||||
"description": "Areas needing improvement (Necesita Mejora)"
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"EvidenceSpan": {
|
||||
"type": "object",
|
||||
"required": ["text", "start_time", "end_time"],
|
||||
"properties": {
|
||||
"text": {
|
||||
"type": "string",
|
||||
"maxLength": 500,
|
||||
"description": "Exact quoted text from transcript (in Spanish)"
|
||||
},
|
||||
"start_time": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "Start time in seconds"
|
||||
},
|
||||
"end_time": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"description": "End time in seconds"
|
||||
},
|
||||
"speaker": {
|
||||
"type": "string",
|
||||
"enum": ["agent", "customer", "unknown"],
|
||||
"description": "Speaker identifier"
|
||||
}
|
||||
}
|
||||
},
|
||||
"RCALabel": {
|
||||
"type": "object",
|
||||
"required": ["driver_code", "confidence", "evidence_spans"],
|
||||
"properties": {
|
||||
"driver_code": {
|
||||
"type": "string",
|
||||
"description": "Driver code from taxonomy"
|
||||
},
|
||||
"confidence": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1,
|
||||
"description": "Confidence score (0-1)"
|
||||
},
|
||||
"evidence_spans": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/EvidenceSpan"
|
||||
},
|
||||
"minItems": 1,
|
||||
"description": "Supporting evidence (minimum 1 required)"
|
||||
},
|
||||
"reasoning": {
|
||||
"type": "string",
|
||||
"maxLength": 500,
|
||||
"description": "Brief reasoning for classification"
|
||||
},
|
||||
"proposed_label": {
|
||||
"type": "string",
|
||||
"description": "For OTHER_EMERGENT: proposed new label"
|
||||
},
|
||||
"origin": {
|
||||
"type": "string",
|
||||
"enum": ["AGENT", "CUSTOMER", "COMPANY", "PROCESS", "UNKNOWN"],
|
||||
"default": "UNKNOWN",
|
||||
"description": "Origin/responsibility for this driver"
|
||||
},
|
||||
"corrective_action": {
|
||||
"type": "string",
|
||||
"maxLength": 500,
|
||||
"description": "Specific action to correct this issue"
|
||||
},
|
||||
"replicable_practice": {
|
||||
"type": "string",
|
||||
"maxLength": 500,
|
||||
"description": "For positive factors: practice to replicate"
|
||||
}
|
||||
}
|
||||
},
|
||||
"AgentSkillIndicator": {
|
||||
"type": "object",
|
||||
"required": ["skill_code", "skill_type", "confidence", "evidence_spans", "description"],
|
||||
"properties": {
|
||||
"skill_code": {
|
||||
"type": "string",
|
||||
"description": "Skill code from taxonomy"
|
||||
},
|
||||
"skill_type": {
|
||||
"type": "string",
|
||||
"enum": ["positive", "improvement_needed"],
|
||||
"description": "Whether this is a positive skill or area for improvement"
|
||||
},
|
||||
"confidence": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1,
|
||||
"description": "Confidence score (0-1)"
|
||||
},
|
||||
"evidence_spans": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/EvidenceSpan"
|
||||
},
|
||||
"minItems": 1,
|
||||
"description": "Supporting evidence (minimum 1 required)"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"maxLength": 500,
|
||||
"description": "Detailed description of the skill demonstration"
|
||||
},
|
||||
"coaching_recommendation": {
|
||||
"type": "string",
|
||||
"maxLength": 500,
|
||||
"description": "Specific coaching recommendation (for improvement areas)"
|
||||
},
|
||||
"replicable_practice": {
|
||||
"type": "string",
|
||||
"maxLength": 500,
|
||||
"description": "How to replicate this skill (for positive skills)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user