1

Bootstrap a new project

Running the following commands will:

  • Install the Inferable CLI
  • Authenticate with the Inferable API (if not already authenticated)
  • Create a new Cluster within your account (this is the --cluster flag)
  • Bootstrap a new project in the ./inferable-demo directory with credentials stored in .env
  # Install the Inferable CLI
  npm i @inferable/cli -g

  # Bootstrap a new NodeJS project
  inf bootstrap --cluster node
2

Start the service

cd ./inferable-app
npm run dev
3

Issue a prompt

The project contains some functions that we can interact with.

Let’s create a new Run with the following prompt

Can you make an order for 2 lightsabers?

Issue the prompt with the Inferable web application.

Because the makeOrder() function is configured with requiresApproval = true, the run will wait until explicit approval is provided via the UI, API or CLI.

This approval step also allows A user to review and edit the request before finalizing the order.

You can see that Inferable has successfully understood the command and has issued the commands to:

  1. Check the inventory (searchInventory())
  2. Paused, awaiting user approval
  3. Place an order for the lightsabers (makeOrder())

You can also try the following:

  1. What items do we have in stock?
  2. Can you order 3 more lightsabers? (This will fail, as we only have 2 in stock)
  3. What orders have I made?