Configuration for prompt generation
| 238 | |
| 239 | @dataclass |
| 240 | class PromptConfig: |
| 241 | """Configuration for prompt generation""" |
| 242 | |
| 243 | template_dir: Optional[str] = None |
| 244 | system_message: str = "system_message" |
| 245 | evaluator_system_message: str = "evaluator_system_message" |
| 246 | |
| 247 | # Large-codebase mode: represent programs in prompts via compact changes descriptions |
| 248 | programs_as_changes_description: bool = False |
| 249 | system_message_changes_description: Optional[str] = None |
| 250 | initial_changes_description: str = "" |
| 251 | |
| 252 | # Number of examples to include in the prompt |
| 253 | num_top_programs: int = 3 |
| 254 | num_diverse_programs: int = 2 |
| 255 | |
| 256 | # Template stochasticity |
| 257 | use_template_stochasticity: bool = True |
| 258 | template_variations: Dict[str, List[str]] = field(default_factory=dict) |
| 259 | |
| 260 | # Meta-prompting |
| 261 | # Note: meta-prompting features not implemented |
| 262 | use_meta_prompting: bool = False |
| 263 | meta_prompt_weight: float = 0.1 |
| 264 | |
| 265 | # Artifact rendering |
| 266 | include_artifacts: bool = True |
| 267 | max_artifact_bytes: int = 20 * 1024 # 20KB in prompt |
| 268 | artifact_security_filter: bool = True |
| 269 | |
| 270 | # Feature extraction and program labeling |
| 271 | suggest_simplification_after_chars: Optional[int] = ( |
| 272 | 500 # Suggest simplifying if program exceeds this many characters |
| 273 | ) |
| 274 | include_changes_under_chars: Optional[int] = ( |
| 275 | 100 # Include change descriptions in features if under this length |
| 276 | ) |
| 277 | concise_implementation_max_lines: Optional[int] = ( |
| 278 | 10 # Label as "concise" if program has this many lines or fewer |
| 279 | ) |
| 280 | comprehensive_implementation_min_lines: Optional[int] = ( |
| 281 | 50 # Label as "comprehensive" if program has this many lines or more |
| 282 | ) |
| 283 | |
| 284 | # Diff summary formatting for "Previous Attempts" section |
| 285 | diff_summary_max_line_len: int = 100 # Truncate lines longer than this |
| 286 | diff_summary_max_lines: int = 30 # Max lines per SEARCH/REPLACE block |
| 287 | |
| 288 | # Backward compatibility - deprecated |
| 289 | code_length_threshold: Optional[int] = ( |
| 290 | None # Deprecated: use suggest_simplification_after_chars |
| 291 | ) |
| 292 | |
| 293 | |
| 294 | @dataclass |
no outgoing calls