Appendix A. Running the examples

 

This book's accompanying code and resources are available in a GitHub repository, making it easy for the reader to access and run the examples discussed throughout the chapters. The repository can be found at:

Some of the Key features of the repository are:

  • Organized by chapters: I organized each chapter with its own directory, containing the code examples and projects discussed in that chapter. For example, chapter 2 is in ch02 folder, chapter 3 in ch03 and so on.
  • NPM Workspaces: The repository is set up using NPM workspaces, allowing for efficient management of multiple projects. This allows us to put several individual projects within the same repo and manage their dependencies in one place.
  • Up-to-date dependencies: The repository includes the latest tools and dependency information, ensuring compatibility with the most recent versions of the tools and libraries used.

A.1 Running Examples

To run a specific example from the book, use the following steps:

  1. Before you do anything, make sure you install the npm dependencies for the project. You just need to run the following command in your terminal:
$ npm i
  1. To run a specific example, make sure you use the following command structure
$ npm run dev -w [chapter-folder]/[project-name]
  • For example, to run the 'chat-client-next' project from Chapter 2:
$ npm run dev -w ch02/chat-client-next

A.2 Accessing OpenAI APIs

A.3 Accessing Google AI APIs