Build the full system prompt for a single evaluation task.
(prompt, testpoint, test_desc, lang)
| 199 | |
| 200 | |
| 201 | def build_system_prompt(prompt, testpoint, test_desc, lang): |
| 202 | """Build the full system prompt for a single evaluation task.""" |
| 203 | config = LANG_CONFIGS[lang] |
| 204 | explanation_dict = config["explanation_dict"] |
| 205 | |
| 206 | # Build checkpoint explanation |
| 207 | explanation = f"{config['checkpoint_header']}:\u300c" |
| 208 | for point in testpoint: |
| 209 | if point not in explanation_dict: |
| 210 | raise ValueError(f"Checkpoint '{point}' not found in {lang} explanation dict") |
| 211 | explanation += f"\n{point}: {explanation_dict[point]}" |
| 212 | explanation += "\n\u300d" |
| 213 | |
| 214 | # Build checkpoint description |
| 215 | test_explanation = f"{config['checkpoint_desc_header']}:\u300c" |
| 216 | for idx, point in enumerate(testpoint): |
| 217 | test_explanation += f"\n{point}: {test_desc[idx]}" |
| 218 | test_explanation += "\n\u300d" |
| 219 | |
| 220 | return config["system_prompt_template"].format( |
| 221 | prompt=prompt, |
| 222 | testpoint=testpoint, |
| 223 | explanation=explanation, |
| 224 | test_explanation=test_explanation, |
| 225 | ) |
| 226 | |
| 227 | |
| 228 | def parse_evaluation_response(text, testpoint): |
no outgoing calls
no test coverage detected