From 607f7202f7fb449c813785e1821f6f650c8a81d9 Mon Sep 17 00:00:00 2001 From: Meherzi Zied Date: Mon, 16 Jun 2025 09:14:00 +0100 Subject: [PATCH] Update README.md I rewrote the README to be more beginner-friendly by simplifying language, adding step-by-step instructions, explaining technical terms (like Docker and virtual environments), and improving structure with clear sections and tips for first-time users. --- README.md | 93 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 1ce7f60..2713a30 100644 --- a/README.md +++ b/README.md @@ -3,33 +3,90 @@ This repository contains different examples and use cases showcased in the book Book cover -If you are coming from the first edition, you will find that the code has been updated to use a more recent OpenAI Python library version. You will also find additional code examples that are not in this book's first edition. To switch back to the original code, go to this tag. The chapters and numbering of the examples are identical across book editions. +πŸ“˜ Developing Apps with GPT-4 and ChatGPT β€” Code Examples +Welcome! πŸ‘‹ +This repository contains all the example projects and code snippets featured in the book Developing Apps with GPT-4 and ChatGPT. -# Usage +Whether you're new to coding or exploring AI development for the first time, this repo is designed to help you learn by doing. -### All examples -Install the requirements for all the examples with: +πŸ“– About This Repository +If you're coming from the first edition of the book: - pip install -r requirements.txt +The code in this repo has been updated to use a newer version of the official OpenAI Python library. -Each example contains either a Jupyter notebook, or a Python file that can be run with: +You’ll also find additional examples not included in the first edition. - python [example_folder]/run.py +The chapter numbers and example structure remain the same across book editions for easy navigation. -Some examples require some additional setup. +To view the original version of the code (first edition), switch to the appropriate tag using Git: -### Chap3_03_QuestionAnseringOnPDF -Start Redis with - docker-compose up -d +git checkout [tag_name] +πŸš€ Getting Started +1. Clone the Repository +If you haven’t already, clone the repository to your local machine: -### Chap3_04_VoiceAssistant -The Gradio interface is available at the address displayed in the output. -### Chap5_04_LlamaIndexCustomization -Customize if needed the docker-compose.yml file and start Weaviate with +git clone https://github.com/your-username/your-repo-name.git +cd your-repo-name +2. Install the Required Packages +Make sure you have Python installed. Then, install the dependencies for all examples: - docker-compose up -d -Alternatively, run: - docker run -p 8080:8080 -p 50051:50051 cr.weaviate.io/semitechnologies/weaviate:1.24.9 +pip install -r requirements.txt +πŸ’‘ Tip: It’s a good idea to use a virtual environment to manage your Python packages. + +πŸ§ͺ How to Run the Examples +Each example is stored in its own folder and contains either a Jupyter Notebook (.ipynb) or a Python script (run.py). + +To run an example: + +python [example_folder]/run.py +Or open the .ipynb file in a Jupyter environment like VS Code or Google Colab. + +βš™οΈ Examples That Need Extra Setup +Some examples need a bit more configuration to work. Here's a quick guide: + +πŸ“„ Chapter 3.03 β€” Question Answering on PDFs +This example uses Redis, a fast in-memory database. + +To start Redis using Docker: + + +docker-compose up -d +Make sure Docker is installed and running on your machine. Learn more about Docker here. + +πŸŽ™οΈ Chapter 3.04 β€” Voice Assistant with Gradio +This example launches a simple voice assistant interface using Gradio. + +After running the script, you’ll see a link in your terminal. Open it in your browser to use the assistant. + +🧠 Chapter 5.04 β€” Customizing with LlamaIndex and Weaviate +This example demonstrates how to customize LlamaIndex with a vector database called Weaviate. + +You can start Weaviate locally using Docker: + + +docker-compose up -d +Or run it directly via Docker without using docker-compose: + + +docker run -p 8080:8080 -p 50051:50051 cr.weaviate.io/semitechnologies/weaviate:1.24.9 +If needed, customize the docker-compose.yml file to suit your setup. + +πŸ™‹ Need Help? +If you're stuck, feel free to: + +Open an issue + +Check the official OpenAI API documentation + +Google the error message β€” it's what all devs do πŸ˜„ + +βœ… Contributing +Beginner contributions are welcome! +If you improve the documentation or fix an error in the code, feel free to make a pull request. + +⭐️ Show Some Love +If you found this helpful, please give the repo a ⭐️ on GitHub! It helps others discover it β€” and gives you credit on your profile too. +