Skip to content
A simple, flat 2D illustration depicts an open package box with basic digital script symbols, small code blocks, and algorithm icons rising from it. Stylized arrows represent data flow around the box. The art uses five solid corporate colors in an 8-bit, geometric, pixelated style. The image is 128x128 pixels, transparent background, no text, no people, and no shading.

Runtime

The GenAIScript runtime provides additional helpers and allows to use the runtime in any Node.JS application.

In order to use the runtime, you will need to install GenAIScript in your project.

Terminal window
npm i -D @genaiscript/runtime

If you are using GenAIScript without the CLI or Visual Studio Code extension, you need to initialize the runtime before using any global types or functions.

import { initialize } from "@genaiscript/runtime";
// runs this before using any global types
await initialize();

The runtime is available as a module. You can import it using the following code:

import { cast } from "@genaiscript/runtime";

The runtime installs global parsers and inline prompt types. However, the global $, def, etc… is not available, online inline prompts.

The following helpers have been moved into their own packages to reduce the default installation size. They will require an additional installation step if you want to use them.