diff --git a/storycraftr/prompts/chapters.py b/storycraftr/prompts/chapters.py index 50bf94e..f8584b9 100644 --- a/storycraftr/prompts/chapters.py +++ b/storycraftr/prompts/chapters.py @@ -3,12 +3,14 @@ CHAPTER_PROMPT_NEW = """ Write a detailed and engaging chapter for the following book premise: {prompt}. Ensure the chapter contributes meaningfully to the plot, character development, and overall progression of the story. +Generate content for a single chapter only, not an overarching story arc. The chapter should include a title and typical chapter structure, without subtitling or segmenting the content. """ CHAPTER_PROMPT_REFINE = """ Refine and evolve the content based on this prompt: {prompt}. Improve the narrative flow, character development, and pacing. +Generate content for a single chapter only, not an overarching story arc. The chapter should include a title and typical chapter structure, without subtitling or segmenting the content. """ @@ -16,7 +18,6 @@ Create a professional book cover in markdown format for the book titled '{title}'. Include only the title and author ('{author}'). Strictly return only the cover content in markdown format, ready for direct use in the book. - Use the following as additional context: {prompt}. """ @@ -24,7 +25,7 @@ BACK_COVER_PROMPT = """ Generate a detailed and engaging synopsis for the back cover of the book titled '{title}', written by '{author}'. Include the genre ('{genre}') and any alternate languages ('{alternate_languages}') where the book is available. -Also, include the license type '{license}', along with a professional description of the license. +Include ALWAYS the license type '{license}', along with a professional description of the license. Use the following as additional context: {prompt}. """ @@ -32,6 +33,7 @@ EPILOGUE_PROMPT_NEW = """ Generate a complete and compelling epilogue for the book based on the following context: {prompt}. The epilogue should tie up loose ends and provide closure in a way that complements the main storyline. +Generate content for a single chapter only, not an overarching story arc. The chapter should include a title and typical chapter structure, without subtitling or segmenting the content. """ @@ -39,4 +41,5 @@ Refine and evolve the content based on this prompt: {prompt}. Improve its narrative flow, tie up remaining plot points, and evolve the content. Ensure that the refined epilogue maintains the tone and themes of the story. +Generate content for a single chapter only, not an overarching story arc. The chapter should include a title and typical chapter structure, without subtitling or segmenting the content. """ diff --git a/storycraftr/prompts/core.py b/storycraftr/prompts/core.py index 0bdf957..189d09c 100644 --- a/storycraftr/prompts/core.py +++ b/storycraftr/prompts/core.py @@ -1,5 +1,6 @@ FORMAT_OUTPUT = """ Write the book on lang "{language}". Return in markdown format, without using code block syntax (no triple backticks or code fences). +Do not add your comments ath thend. You are {reference_author} writing a new engaging book. """ diff --git a/storycraftr/utils/markdown.py b/storycraftr/utils/markdown.py index 56e2355..dbde53e 100644 --- a/storycraftr/utils/markdown.py +++ b/storycraftr/utils/markdown.py @@ -1,4 +1,5 @@ import os +import re import shutil from storycraftr.agent.agents import create_or_get_assistant, get_thread, create_message from rich.console import Console