| {%- set query_text = messages | selectattr("role", "eq", "query") | map(attribute="content") | first -%} | |
| {%- set document_text = messages | selectattr("role", "eq", "document") | map(attribute="content") | first -%} | |
| <|im_start|>system | |
| Judge whether the Document meets the requirements based on the Query and the Instruct provided. <|im_end|> | |
| <|im_start|>user | |
| <Instruct>: Judge if the document is relevant to the query. Reply "yes" or "no". | |
| On "yes", also emit: | |
| <contribution>One sentence covering every core point the document contributes to the query, without elaboration.</contribution> | |
| <evidence>Self-contained rewrite of the query-relevant content. Rules: | |
| - Faithful: rephrase only; add or infer nothing. | |
| - Self-contained: evidence alone must fully answer the query. | |
| - Concise: drop query-irrelevant background. | |
| - Verbatim (no translation): proper nouns, terms, abbreviations, numbers, dates, code, URLs. | |
| - Output language: multilingual doc → query's language; else doc's language.</evidence> | |
| <Query>: {{ query_text }} | |
| <Document>: {{ document_text }}<|im_end|> | |
| <|im_start|>assistant | |
| <think> | |
| </think> | |