Aller au contenu
A small, flat, square illustration shows a plain file folder with three simple geometric icons rising from it: a rectangle marked ".js," another marked ".ts," and a third icon featuring a basic gear shape. The design uses five bold, contrasting corporate colors and is composed of only clean, flat shapes without any background or decorative effects. There are no people, textures, or dimensional shading. The image is limited to a 128x128 pixel size and is designed to be immediately recognizable and iconic.

Aperçu

AI generated translation.

GenAIScript sont des fichiers JavaScript nommés *.genai.mjs ou des fichiers TypeScript nommés *.genai.mts, avec un moteur de création d’invites conçu pour les LLM.

shorten.genai.mjs
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.`;
  • GenAIScript détectera tout fichier correspondant à *.genai.mjs, *.genai.js, *.genai.mts dans votre espace de travail.
  • Les fichiers GenAIScript peuvent être placés n’importe où dans votre espace de travail ; cependant, l’extension les placera par défaut dans un dossier genaisrc.
  • .genai.mjs utilise la syntaxe de module JavaScript et prend en charge les imports.
  • .genai.js sont évalués et ne prennent pas en charge les imports.
  • .genai.mts sont des fichiers module TypeScript et prennent en charge les imports, y compris les imports dynamiques d’autres fichiers TypeScript.
  • Répertoire/genaisrc
    • jsconfig.json // Configuration du compilateur TypeScript
    • genaiscript.d.ts // Définitions TypeScript
    • myscript.genai.mjs // votre script !