# We will define the response format so the output has the correct schema. You can also use structured outputs with Pydantic models for this.
json_schema = {
    "type": "json_schema",
    "json_schema": {
        "name": "summary_evaluation_schema",
        "schema": {
            "type": "object",
            "properties": {
                "relevance": {
                    "type": "object",
                    "properties": {
                        "score": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 5,
                            "description": "Score between 1-5 for how well the summary addresses the instruction",
                        },
                        "explanation": {
                            "type": "string",
                            "description": "Brief explanation of the relevance score",
                        },
                    },
                    "required": ["score", "explanation"],
                },
                "conciseness": {
                    "type": "object",
                    "properties": {
                        "score": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 5,
                            "description": "Score between 1-5 for how concise the summary is while retaining key information",
                        },
                        "explanation": {
                            "type": "string",
                            "description": "Brief explanation of the conciseness score",
                        },
                    },
                    "required": ["score", "explanation"],
                },
                "technical_accuracy": {
                    "type": "object",
                    "properties": {
                        "score": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 5,
                            "description": "Score between 1-5 for how accurately the summary conveys technical details",
                        },
                        "explanation": {
                            "type": "string",
                            "description": "Brief explanation of the technical accuracy score",
                        },
                    },
                    "required": ["score", "explanation"],
                },
            },
            "required": ["relevance", "conciseness", "technical_accuracy"],
            "additionalProperties": False,
        },
    },
}