Skip to content

Commit

Permalink
Merge pull request Bklieger#39 from bklieger-groq/main
Browse files Browse the repository at this point in the history
fix: Improve prompt engineering for higher quality books, remove re-enable without clearing book contents
  • Loading branch information
Bklieger committed Aug 10, 2024
2 parents 08588b4 + cbecaab commit b2cf105
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion infinite_bookshelf/agents/structure_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def generate_book_structure(
},
{
"role": "user",
"content": f"Write a comprehensive structure, omiting introduction and conclusion sections (forward, author's note, summary), for a long (>300 page) book. It is very important that use the following subject and additional instructions to write the book. \n\n<subject>{prompt}</subject>\n\n<additional_instructions>{additional_instructions}</additional_instructions>",
"content": f"Write a comprehensive structure, omiting introduction and conclusion sections (forward, author's note, summary), for a book. Only provide up to one level of depth for nested sections. Make clear titles and descriptions that have no overlap with other sections. It is very important that use the following subject and additional instructions to write the book. \n\n<subject>{prompt}</subject>\n\n<additional_instructions>{additional_instructions}</additional_instructions>",
},
],
temperature=0.3,
Expand Down
2 changes: 0 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ def stream_section_content(sections):
except json.JSONDecodeError:
st.error("Failed to decode the book structure. Please try again.")

enable()

except Exception as e:
st.session_state.button_disabled = False
st.error(e)
Expand Down

0 comments on commit b2cf105

Please sign in to comment.