Welcome to AIBook! 🎉 This is a command-line application built in Rust that allows you to generate comprehensive summaries of EPUB e-books using advanced AI language models. With this tool, you can extract the essence of your favorite books, complete with images, references, and additional resources. 🚀
- Detailed Summaries: Generates in-depth summaries highlighting key points and insights from each chapter.
- Image Extraction: Extracts images from the e-book and includes them in the summary.
- References & Resources: Incorporates citations, references, and additional materials to enrich your understanding.
- Customizable Output: Adjust the level of detail, output language, and format to suit your preferences.
- Easy to Use: Simple command-line interface for quick and efficient summarization.
- Prerequisites
- Installation
- Configuration
- Usage
- Customization
- Contributing
- License
- Acknowledgments
- Contact
- Rust: Ensure you have Rust installed (version 1.56 or higher). Install it here.
- OpenRouter API Key: Required to access the AI language models. Get yours here.
-
Clone the repository:
git clone https://github.com/felipepimentel/aibook.git cd aibook
-
Build the application:
cargo build --release
To use AIBook, you need an API key from OpenRouter:
-
Sign up at OpenRouter and obtain your API key.
-
Copy the
.env.sample
file to.env
:cp .env.sample .env
-
Open the
.env
file and add your API key:OPENROUTER_API_KEY=your-api-key-here
You can define additional settings in the .env
file:
# Model to be used (default: openai/gpt-3.5-turbo)
MODEL_NAME=openai/gpt-3.5-turbo
# Output language of the summary (default: en)
OUTPUT_LANGUAGE=en
An example .env.sample
file is provided in the repository. It contains placeholders for the necessary environment variables. Copy it to create your own .env
file.
Run the application by providing the path to the EPUB file you want to summarize:
cargo run --release -- --input /path/to/your/ebook.epub
--input
: Path(s) to the EPUB file(s).--output_dir
: Directory where summaries and images will be saved (default:output/
).--api_key
: OpenRouter API key (can be set in the.env
file).--model
: Language model to be used.--language
: Output language of the summary (default:en
).--detail_level
: Level of detail of the summary (short
,medium
,long
; default:medium
).--output_format
: Output format (markdown
,html
; default:markdown
).--verbose
: Verbosity level of logs (use-v
for more details).
cargo run --release -- \
--input /path/to/your/ebook.epub \
--output_dir /path/to/output/ \
--language en \
--detail_level long \
--output_format markdown \
--verbose
Feel free to adjust the application's behavior:
- Custom Prompts: Modify the prompts in
src/summarizer.rs
to change how the AI model generates summaries. - Source Code: If you're familiar with Rust, you can adapt the code to your specific needs.
Contributions are welcome! If you find a bug or have an idea to improve the project:
- Open an issue describing the problem or suggestion.
- Fork the repository.
- Create a new branch for your contribution.
- Submit a pull request detailing the changes.
This project is licensed under the MIT License.
We thank all contributors and users who make this project possible.
For questions or suggestions:
- Email: [email protected]
- GitHub: felipepimentel
We hope that AIBook is a useful tool for you to extract the most from your favorite e-books. Happy reading! 📚✨
Create a .env.sample
file in the root directory of the repository with the following content:
# OpenRouter API Key
OPENROUTER_API_KEY=your-api-key-here
# Model to be used (default: openai/gpt-3.5-turbo)
# MODEL_NAME=openai/gpt-3.5-turbo
# Output language of the summary (default: en)
# OUTPUT_LANGUAGE=en
This sample file provides a template for the necessary environment variables. Users can copy this file to .env
and fill in their own API key and optional settings.
Note: Ensure that the .env.sample
file has the .env.sample
extension and that it is included in your repository. The .env
file, containing your actual API keys and sensitive information, should not be committed to version control. It's good practice to add .env
to your .gitignore
file to prevent accidental commits.
By following these steps, you'll have a fully functional AIBook application ready to generate summaries of your EPUB e-books. If you have any questions or run into issues, feel free to reach out!
Happy summarizing! 🎉