{"id":26563663,"url":"https://github.com/engineerdogita/fantasybookmakerlangchain","last_synced_at":"2026-04-14T23:33:46.641Z","repository":{"id":282833735,"uuid":"949678636","full_name":"EngineerDogIta/FantasyBookMakerLangChain","owner":"EngineerDogIta","description":"This repository contains a script that uses the LangChain library to generate a fantasy book. The script initializes various language models for different phases of the book creation process, including idea generation, synopsis creation, quality verification, and chapter drafting. ","archived":false,"fork":false,"pushed_at":"2025-06-09T22:51:55.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T23:32:23.750Z","etag":null,"topics":["ai","book-structure","chapter-generation","creative-writing","langchain","llm","prompt-engineering","storytell"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EngineerDogIta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-17T00:41:59.000Z","updated_at":"2025-03-18T08:00:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"04b328b4-b958-4f91-8426-1cb340155b36","html_url":"https://github.com/EngineerDogIta/FantasyBookMakerLangChain","commit_stats":null,"previous_names":["engineerdogita/fantasybookmakerlangchain"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EngineerDogIta/FantasyBookMakerLangChain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineerDogIta%2FFantasyBookMakerLangChain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineerDogIta%2FFantasyBookMakerLangChain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineerDogIta%2FFantasyBookMakerLangChain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineerDogIta%2FFantasyBookMakerLangChain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EngineerDogIta","download_url":"https://codeload.github.com/EngineerDogIta/FantasyBookMakerLangChain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineerDogIta%2FFantasyBookMakerLangChain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018118,"owners_count":26086280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","book-structure","chapter-generation","creative-writing","langchain","llm","prompt-engineering","storytell"],"created_at":"2025-03-22T16:16:42.470Z","updated_at":"2025-10-14T06:13:12.131Z","avatar_url":"https://github.com/EngineerDogIta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fantasy Book Generator\n\n![Python Version](https://img.shields.io/badge/python-3.13.2-blue)\n![License](https://img.shields.io/badge/license-MIT-green)\n![GitHub Issues](https://img.shields.io/github/issues/EngineerDogIta/fantasy-book-generator)\n\nThis project generates a fantasy book using Large Language Models (LLMs) from the LangChain community. The process involves generating story ideas, creating a synopsis, structuring chapters, and drafting and verifying chapter content.\n\n## Project Structure\n\nThe repository contains the following key files and folders:\n\n- **main.py**: The main script that orchestrates the story generation process.\n- **prompts.py**: Contains the prompt templates for various phases (idea generation, synopsis, quality verification, etc.).\n- **generated/**: When the `main.py` script is executed and a synopsis is approved, this folder is created (if it doesn't already exist) with:\n  - A subdirectory named after the book title (e.g., `Echoes of the Veil`), containing:\n    - `structure.md`: A file outlining the detailed book structure and chapter breakdown.\n    - One Markdown file per chapter (e.g., `1.md`, `2.md`, etc.) with the final polished chapter content.\n- **README.md**: This documentation file.\n- **requirements.txt**: Lists the required dependencies for the project.\n- **LICENSE**: The project’s license file.\n\n## Requirements\n\n- Python 3.13.2 or higher\n- LangChain library\n- Ollama models\n\n## Setup\n\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/yourusername/fantasy-book-generator.git\n    cd fantasy-book-generator\n    ```\n\n2. Install the required dependencies:\n    ```sh\n    pip install -r requirements.txt\n    ```\n\n3. Install Ollama and the required models:\n    - Download and install [Ollama](https://ollama.ai) following their official instructions.\n    - Ensure the following models are installed and available:\n        - deepseek-r1:1.5b\n        - gemma3:1b\n        - mistral:latest\n    - Start the Ollama models locally on `http://localhost:11434`.\n\n## Usage\n\nTo generate a fantasy book, run the `main.py` script:\n    ```sh\n    python main.py\n    ```\n\nThe script will go through the following phases:\n\n1. **Generating Story Ideas**: Creates five detailed fantasy story ideas.\n2. **Generating Synopsis**: Composes a detailed synopsis based on the generated ideas.\n3. **Quality Verification**: Analyzes the synopsis for consistency, completeness, plot potential, and originality.\n4. **Final Approval Check**: Checks if the synopsis meets all the required criteria.\n5. **Structuring Chapters**: Generates a detailed chapter-by-chapter structure for the book.\n6. **Chapter Generation and Verification**: Drafts and verifies each chapter based on the structure.\n7. **Final Chapter Generation**: Produces a polished final version of each chapter.\n\nGenerated content will be saved in the `generated/` directory under a subfolder corresponding to the book title.\n\n## Prompts\n\nThe prompts used for generating and verifying content are defined in `prompts.py`. They include:\n\n- `IDEA_GENERATION_PROMPT`\n- `STORY_SYNOPSIS_PROMPT`\n- `QUALITY_VERIFICATION_PROMPT`\n- `FINAL_APPROVAL_CHECK_PROMPT`\n- `BOOK_STRUCTURE_PROMPT`\n- `CHAPTER_DRAFT_PROMPT`\n- `CHAPTER_VERIFICATION_PROMPT`\n- `FINAL_CHAPTER_GENERATION_PROMPT`\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## LLMs to Pull from Ollama\n\nEnsure the following LLMs are pulled and available from Ollama:\n\n- `deepseek-r1:1.5b` for creative idea generation\n- `gemma3:1b` for quality verification and structure generation\n- `mistral:latest` for chapter generation","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineerdogita%2Ffantasybookmakerlangchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengineerdogita%2Ffantasybookmakerlangchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineerdogita%2Ffantasybookmakerlangchain/lists"}