Skip to content

Commit 7711dd6

Browse files
committed
feat: template aritifact and diverse program title
1 parent d061670 commit 7711dd6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

openevolve/prompt/sampler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def _format_evolution_history(
356356
# Use random sampling to get diverse programs
357357
diverse_programs = random.sample(remaining_programs, num_diverse)
358358

359-
diverse_programs_str += "\n\n## Diverse Programs\n\n"
359+
diverse_programs_str += "\n\n## " + self.template_manager.get_fragment("diverse_programs_title") + "\n\n"
360360

361361
for i, program in enumerate(diverse_programs):
362362
# Use the full program code
@@ -589,7 +589,7 @@ def _render_artifacts(self, artifacts: Dict[str, Union[str, bytes]]) -> str:
589589
sections.append(f"### {key}\n```\n{content}\n```")
590590

591591
if sections:
592-
return "## Last Execution Output\n\n" + "\n\n".join(sections)
592+
return "## " + self.template_manager.get_fragment("artifact_title") + "\n\n" + "\n\n".join(sections)
593593
else:
594594
return ""
595595

openevolve/prompts/defaults/fragments.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@
1515
"metrics_regressed": "Metrics showing changes: {metrics}. Consider different approaches in these areas.",
1616
"code_simplification": "Consider simplifying the code to improve readability and maintainability",
1717
"default_improvement": "Focus on improving the fitness score while exploring diverse solutions",
18-
"no_feature_coordinates": "No feature coordinates"
18+
"no_feature_coordinates": "No feature coordinates",
19+
"artifact_title": "Last Execution Output",
20+
"diverse_programs_title": "Diverse Programs"
1921
}

0 commit comments

Comments
 (0)