Skip to content

Commit

Permalink
feat: Implementing iterate commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Estrada Irribarra, Rodrigo Andres committed Oct 17, 2024
1 parent 152a385 commit 9356aba
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions storycraftr/agent/iterate.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ def insert_new_chapter(book_name, position, prompt):
progress.reset(task_openai)
rewrite_chapters(
book_name,
assistant,
prev_chapter_path,
prev_chapter,
position,
Expand All @@ -430,7 +429,6 @@ def insert_new_chapter(book_name, position, prompt):
progress.reset(task_openai)
rewrite_chapters(
book_name,
assistant,
next_chapter_path,
next_chapter,
position,
Expand All @@ -440,14 +438,13 @@ def insert_new_chapter(book_name, position, prompt):
)


def rewrite_chapters(
book_name, assistant, path, num, position, prompt, progress, task_chapters
):
def rewrite_chapters(book_name, path, num, position, prompt, progress, task_chapters):
"""
Function to rewrite the chapters before and after the inserted chapter to ensure consistency with the new chapter.
Utilizes the retrieval system to access the full context of the book without loading chapter contents directly.
"""
# Get the assistant and thread
assistant = create_or_get_assistant(book_name)
thread = get_thread()

# Rewrite chapters using retrieval context
Expand Down

0 comments on commit 9356aba

Please sign in to comment.