You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
original_blocks=re.findall(r'```(\w+)', output_file_content)# output_file_content is LLM's previous output
2321
+
revised_blocks=re.findall(r'```(\w+)', revised_content)# revised_content is user's direct edit
2322
2322
2323
-
# If user changed code block types, make this very explicit in the prompt
2324
2323
block_changes=""
2325
2324
iforiginal_blocks!=revised_blocks:
2326
-
block_changes="\n\nIMPORTANT: The user has changed code block types which MUST be preserved exactly as edited:\n"
2325
+
block_changes="\n\nIMPORTANT: The user has changed code block types which MUST be preserved exactly as edited when you update your previous response:\n"
"The user has provided two types of feedback:\n\n"
2343
-
"1. DOCUMENT EDITS: They've directly edited the document. Here is the unified diff between the previous and revised version:\n\n"
2341
+
"The user has provided two types of feedback on your previous output:\n\n"
2342
+
"1. DOCUMENT EDITS: They've directly edited your previous output. Here is the unified diff showing their changes:\n\n"
2344
2343
f"{diff}\n\n"
2345
2344
f"{block_changes}"
2346
2345
"2. ADDITIONAL COMMENTS: They've also provided these additional instructions:"
2347
2346
f"\n\n{cli_text}\n\n"
2348
-
"Incorporate BOTH the document edits AND the additional instructions into the document "
2347
+
"Incorporate BOTH the document edits (apply them to your previous output as shown in the diff) AND the additional instructions into an updated document. "
2349
2348
"STRICTLY follow these user edits - preserve ALL formatting changes EXACTLY as made by the user, "
2350
2349
"especially changes to code block types (like bash→shell). "
2351
2350
"DO NOT revert any user edits when creating the updated document. "
2352
2351
"Ensure all Exec Doc requirements and formatting rules are still met while maintaining the user's exact changes. "
2353
2352
"ONLY GIVE THE UPDATED DOC, NOTHING ELSE."
2354
2353
)
2355
2354
2356
-
# Start with the user's edited version as a base
2357
2355
output_file_content=revised_content
2356
+
# REMOVED: output_file_content = revised_content
2358
2357
2359
2358
elifdoc_edited:
2360
2359
# Only document edits
2361
-
revised_content=feedback["doc_edit"]
2360
+
revised_content=feedback["doc_edit"]# User's direct edit
original_blocks=re.findall(r'```(\w+)', output_file_content)# output_file_content is LLM's previous output
2364
+
revised_blocks=re.findall(r'```(\w+)', revised_content)# revised_content is user's direct edit
2366
2365
2367
-
# If user changed code block types, make this very explicit in the prompt
2368
2366
block_changes=""
2369
2367
iforiginal_blocks!=revised_blocks:
2370
-
block_changes="\n\nIMPORTANT: The user has changed code block types which MUST be preserved exactly as edited:\n"
2368
+
block_changes="\n\nIMPORTANT: The user has changed code block types which MUST be preserved exactly as edited when you update your previous response:\n"
0 commit comments