{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "CallAnalysisResponse", "description": "LLM response schema for call analysis", "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" }, "default": [] }, "poor_cx_drivers": { "type": "array", "items": { "$ref": "#/definitions/RCALabel" }, "default": [] } }, "definitions": { "EvidenceSpan": { "type": "object", "required": ["text", "start_time", "end_time"], "properties": { "text": { "type": "string", "maxLength": 500, "description": "Exact quoted text from transcript" }, "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", "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" } } } } }