AI text generation is currently surfaced through the JavaScript step. Within Momentic’s JavaScript sandbox, your code can access a special ai object. This object contains the following utility function:

Generating text

The generate utility function allows you to prompt an LLM to generate text. The input is a string which the LLM will use as the prompt.

async function generate(input: string): Promise<string>