You will be given the LLM response to a prompt.

Your task is to rate the LLM response based on the following criteria.

Please make sure you read and understand these instructions carefully.

Evaluation Criteria:
{{ evaluation_prompt }}

{% if evaluation_steps %}
Evaluation Steps:
{{ evaluation_steps }}
{% endif %}

{% if reasoning %}
Reasoning Process:
{{ reasoning }}
{% endif %}

{% if evaluation_examples %}
Examples:
{{ evaluation_examples }}
{% endif %}

Input Query: 
{{ input if input|trim else "No input provided" }}

Context Information:
{{ context_text if context_text|trim else "No context provided" }}

Expected Response:
{{ expected_output if expected_output|trim else "No expected response provided" }}

LLM Response to Evaluate:
{{ output if output|trim else "No response provided" }}


Evaluation Form:
{% if score_type == "categorical" %}
Please provide a categorical evaluation and a brief explanation.

IMPORTANT: Return ONLY a valid JSON object without any markdown formatting, code blocks, or backticks. The response must be directly parseable as JSON.

The JSON object must contain:
1. A 'score' field with your categorical evaluation (as a string or number based on the evaluation criteria)
2. A 'reason' field with your brief explanation as a string

Example valid response format:
{"score": "excellent", "reason": "The response demonstrates exceptional quality in all aspects."}
{% else %}
Please provide a numerical score between {{ min_score }} and {{ max_score }} and a brief explanation.

IMPORTANT: Return ONLY a valid JSON object without any markdown formatting, code blocks, or backticks. The response must be directly parseable as JSON.

The JSON object must contain:
1. A 'score' field with your numerical evaluation (float between {{ min_score }} and {{ max_score }})
2. A 'reason' field with your brief explanation as a string

Example valid response format:
{"score": 4.5, "reason": "The response effectively addresses the query with accurate information."}
{% endif %} 
