Better refinement
This commit is contained in:
@@ -644,7 +644,7 @@ def write_chapter(chap, bp, folder, prev_sum, tracking=None, prev_content=None):
|
|||||||
return f"## Chapter {chap['chapter_number']} Failed\n\nError: {e}"
|
return f"## Chapter {chap['chapter_number']} Failed\n\nError: {e}"
|
||||||
|
|
||||||
# Refinement Loop
|
# Refinement Loop
|
||||||
max_attempts = 3
|
max_attempts = 5
|
||||||
SCORE_AUTO_ACCEPT = 9
|
SCORE_AUTO_ACCEPT = 9
|
||||||
SCORE_PASSING = 7
|
SCORE_PASSING = 7
|
||||||
|
|
||||||
@@ -686,7 +686,8 @@ def write_chapter(chap, bp, folder, prev_sum, tracking=None, prev_content=None):
|
|||||||
guidelines = get_style_guidelines()
|
guidelines = get_style_guidelines()
|
||||||
fw_list = '", "'.join(guidelines['filter_words'])
|
fw_list = '", "'.join(guidelines['filter_words'])
|
||||||
|
|
||||||
history_str = "\n".join(past_critiques)
|
# Exclude current critique from history to avoid duplication in prompt
|
||||||
|
history_str = "\n".join(past_critiques[:-1]) if len(past_critiques) > 1 else "None"
|
||||||
|
|
||||||
refine_prompt = f"""
|
refine_prompt = f"""
|
||||||
Act as a Senior Editor. Rewrite this chapter to fix the issues identified below and ELEVATE the writing quality.
|
Act as a Senior Editor. Rewrite this chapter to fix the issues identified below and ELEVATE the writing quality.
|
||||||
|
|||||||
Reference in New Issue
Block a user