Sample Book project using Promptbook and pure vanilla JavaScript in Node.js environment
Welcome! In this repository, you'll find a simple example of how to write your first Book and run it using the Promptbook Engine via the CLI.
TODO: !!!!!! Merge Book and Node Getting Started
Follow these steps to get up and running:
First, clone this repository to your local machine.
Navigate to the root of the project and run the following command to install Promptbook:
npm i ptbk
Note: Currently, installation is supported only via NPM. We are actively working on adding support for other package managers and installer files such as .msi
, .rpm
, and .deb
.
Create a .env
file in the root of the project to configure the necessary API keys for the model providers you plan to use:
# You only need to configure one provider:
# OpenAI
OPENAI_API_KEY=sk-proj-...
# Anthropic Claude
ANTHROPIC_CLAUDE_API_KEY=sk-ant-api03-...
# Azure OpenAI
AZUREOPENAI_API_KEY=...
AZUREOPENAI_RESOURCE_NAME=...
AZUREOPENAI_DEPLOYMENT_NAME=...
From the root of the repository, execute the following command to run the example:
npx ptbk books/hello.book.md
If everything is set up correctly, you should see the following output:
$ npx ptbk books/hello.book.md
√ yourName ... The World
--- Result: ---
greeting: Hello World!
🚀✨ Congratulations! You've successfully created your first book with Promptbook! Now you can continue with the examples or the book language blueprint to dive deeper into the book language, integrate books into your app or create instant miniapps without classical programming.