47 lines
1.5 KiB
Python
47 lines
1.5 KiB
Python
SUPPORT_OUTPUT_SCHEMA = {
|
|
"type": "object",
|
|
"properties": {
|
|
"analysis_summary": {"type": "string"},
|
|
"troubleshooting_steps": {
|
|
"type": "array",
|
|
"items": {"type": "string"},
|
|
"maxItems": 12,
|
|
},
|
|
"candidate_solution_ids": {
|
|
"type": "array",
|
|
"items": {"type": "integer"},
|
|
},
|
|
"customer_reply_draft": {"type": "string"},
|
|
"citations": {
|
|
"type": "array",
|
|
"items": {"type": "integer", "minimum": 1},
|
|
},
|
|
"auto_resolve_recommended": {"type": "boolean"},
|
|
},
|
|
"required": [
|
|
"analysis_summary",
|
|
"troubleshooting_steps",
|
|
"candidate_solution_ids",
|
|
"customer_reply_draft",
|
|
"citations",
|
|
"auto_resolve_recommended",
|
|
],
|
|
"additionalProperties": False,
|
|
}
|
|
|
|
SUPPORT_OUTPUT_FIELDS = frozenset(SUPPORT_OUTPUT_SCHEMA["required"])
|
|
|
|
|
|
def missing_support_output_fields(output_schema) -> list[str]:
|
|
if not isinstance(output_schema, dict) or output_schema.get("type") != "object":
|
|
return sorted(SUPPORT_OUTPUT_FIELDS)
|
|
|
|
required = output_schema.get("required")
|
|
properties = output_schema.get("properties")
|
|
required_fields = set(required) if isinstance(required, list) else set()
|
|
property_fields = set(properties) if isinstance(properties, dict) else set()
|
|
return sorted(
|
|
(SUPPORT_OUTPUT_FIELDS - required_fields)
|
|
| (SUPPORT_OUTPUT_FIELDS - property_fields)
|
|
)
|