File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ class Program:
6565 # Metadata
6666 metadata : Dict [str , Any ] = field (default_factory = dict )
6767
68+ # Prompts
69+ prompts : Optional [Dict [str , Any ]] = None
70+
6871 # Artifact storage
6972 artifacts_json : Optional [str ] = None # JSON-serialized small artifacts
7073 artifact_dir : Optional [str ] = None # Path to large artifact files
Original file line number Diff line number Diff line change @@ -119,6 +119,11 @@ async def run_iteration_with_shared_db(
119119 # Handle artifacts if they exist
120120 artifacts = evaluator .get_pending_artifacts (child_id )
121121
122+ # Set template_key of Prompts
123+ template_key = (
124+ "full_rewrite_user" if not config .diff_based_evolution else "diff_user"
125+ )
126+
122127 # Create a child program
123128 result .child_program = Program (
124129 id = child_id ,
@@ -132,6 +137,13 @@ async def run_iteration_with_shared_db(
132137 "changes" : changes_summary ,
133138 "parent_metrics" : parent .metrics ,
134139 },
140+ prompts = {
141+ template_key : {
142+ "system" : prompt ["system" ],
143+ "user" : prompt ["user" ],
144+ "responses" : [llm_response ] if llm_response is not None else [],
145+ }
146+ } if database .config .log_prompts else None ,
135147 )
136148
137149 result .prompt = prompt
You can’t perform that action at this time.
0 commit comments