{%- 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 : Judge if the document is relevant to the query. Reply "yes" or "no". On "yes", also emit: One sentence covering every core point the document contributes to the query, without elaboration. 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. : {{ query_text }} : {{ document_text }}<|im_end|> <|im_start|>assistant