Skip to content

Overview

GenAIScript are JavaScript files named as *.genai.js with a prompt creation engine designed by LLM prompting.

shorten.genai.js
script({
title: "Shorten", // displayed in UI and Copilot Chat
// also displayed but grayed out:
description:
"A prompt that shrinks the size of text without losing meaning",
})
// but the variable is appropriately delimited
const file = def("FILE", env.files)
// this appends text to the prompt
$`Shorten ${file}. Limit changes to minimum.`

Script files

  • GenAIScript will detect any file matching *.genai.js in your workspace.
  • GenAIScript files can be placed anywhere in your workspace; but the extension will place them in a genaisrc folder by default.
  • Directory/genaisrc
    • jsconfig.json // TypeScript compiler configuration
    • genaiscript.d.ts // TypeScript definitions
    • myscript.genai.js // your script!