Skip to main content
Glama

GenAIScript

Official
by microsoft
MIT License
43
2,820
  • Linux
  • Apple
glossary.md17.9 kB
--- title: Glossary description: A glossary of terms used in the GenAI project. keywords: glossary, terms, definitions sidebar: order: 200 --- This glossary provides definitions for terms used in the project. Each term is linked to its corresponding section in the documentation for easy reference. > This glossary is auto-generated from the source files. ## Terms - **/v1/chat/completions**: API route mostly compatible with OpenAI chat completions API. - **/v1/models**: API route returning the list of models and aliases available on the server. - **About mixing files and —vars**: Order of CLI arguments for specifying files and variables. - **Additional flags**: Repo clone flags: `--remote-branch <branch>` specifies branch, `--remote-force` forces overwrite, `--remote-nstall` installs dependencies after cloning. - **Agent**: In GenAIScript, an agent is a [tool](/genaiscript/reference/scripts/tools) that runs an [inline prompt](/genaiscript/reference/scripts/inline-prompts) using an LLM and additional tools/memory to accomplish tasks. Agents rely on tools for workflow and decision making. - **Agent memory**: Shared log storing all `agent/query/answer` interactions, enabling agents to share context across conversations. A small LLM extracts relevant memory for the agent's prompt. - **Agent vs Tools**: An agent is a tool that internally queries an LLM with access to subordinate tools to accomplish tasks. - **Annotation filtering**: Using `defOutputProcessor` to filter generated annotations by criteria like severity before output. - **Annotations**: Structured metadata such as errors, warnings, or notes in LLM output. Integrate with IDEs, CI, and reviews to highlight issues or suggestions. - **Astro**: Astro is a modern static site generator for building fast, optimized websites using any framework. - **Authentication**: Supports authentication via environment variables and Microsoft Entra. - **Azure AI Content Safety**: Service for detecting and filtering harmful content in applications and LLM output. See [Azure Content Safety](https://learn.microsoft.com/en-us/azure/ai-services/content-safety/quickstart-text). - **Azure AI Foundry**: Platform for building and deploying AI models. - **Azure AI Inference**: [Azure AI Inference](/genaiscript/getting-started/configuration/) - **Azure AI Search**: Hybrid vector and keyword search engine for semantic retrieval. - **Azure AI Serverless Models**: [Azure AI Serverless Models](/genaiscript/getting-started/configuration/) - **Azure OpenAI and AI services**: Enables GenAIScript to run LLM inference on Azure AI Foundry. - **Azure OpenAI Serverless**: [Azure OpenAI Serverless](/genaiscript/getting-started/configuration/) - **Buffer, Blob, ReadableStream**: The `defImages` function also supports [Buffer](https://nodejs.org/api/buffer.html), [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob), and [ReadableStream](https://nodejs.org/api/stream.html), enabling loading and encoding of local images or screenshots. - **Builtin Agents**: Predefined agents provided by GenAIScript for common tasks. Examples: [agent_git](/genaiscript/reference/scripts/system), agent_fs, agent_github. - **Capabilities**: Empowers teams (including non-developers) to create and debug AI-enhanced JavaScript scripts calling LLMs and foundation models. - **Cast**: Runtime helper converting unstructured text/images to structured data using a JSON schema and LLM extraction. - **Classify**: Runtime helper categorizing input text/images by labels, returning best-matching label, optional explanation, and confidence. - **CLI**: GenAIScript's command-line interface for running, testing, and automating scripts outside VS Code. - **Compile scripts**: Runs TypeScript compiler to check GenAIScript scripts for errors. - **config file resolution**: The process by which GenAIScript scans and merges settings from configuration files. - **Configuration**: CLI loads secrets from environment variables or a `./.env` file. - **Containers**: Lightweight executables (e.g., Docker containers) encapsulating applications and dependencies. Used in GenAIScript for secure, isolated execution of untrusted code. - **Content Safety**: Built-in system prompts and Azure Content Safety integrations protect LLM outputs from harmful content, prompt injections, and leaks. - **Create a new script**: Command to generate a new script in the `genaisrc` folder. - **Crop**: Feature in `defImages` for cropping a region from an image by specifying coordinates and dimensions. - **CSV**: Class for parsing and stringifying CSV, mapping headers, supporting markdown conversion, and repairing CSV. - **defAgent**: Defines an agent callable by an LLM, using a JSON schema for input and expecting string output - **DefChatParticipant**: Function to register handlers that can add/modify user messages in multi-turn GenAIScript chat conversations. - **defDiff**: Highlights and analyzes differences between files, strings, or objects for LLM reasoning—emphasizes only changes. - **defFileMerge**: Registers callbacks for merging files during LLM-driven transformations. - **defImages**: Declares image files for inclusion in prompts sent to vision-capable models, supporting local/remote images, formats, and transforms. - **diff filter**: Uses a diff string to filter AST pattern search matches intersecting with changed files, restricting AST queries to modified code. - **DOCX Parser**: Function to extract and clean text from DOCX files for LLM prompts or variables. - **embedding**: Vector representation of text for semantic similarity search. See [Vector Search](/genaiscript/reference/scripts/vector-search/). - **env**: Global object in GenAIScript containing execution context data, such as files and variables. - **env.files**: Array of files in execution context—user-selected or specified, filterable for script use. - **env.vars**: Object containing execution-specific variables, readable and settable during GenAIScript execution. - **envFile**: Specifies the environment file to load secrets as environment variables. - **Example: Summary of file summaries using Phi-3**: Snippet demonstrating [Phi-3](https://azure.microsoft.com/en-us/blog/introducing-phi-3-redefining-whats-possible-with-slms/) via [Ollama](https://ollama.com/) to summarize file groups and aggregate summaries. - **file filters**: Options for `def` to filter input files by extension or pattern when defining variables for prompts. - **files parameters**: Script parameters specifying target files for processing for reusability. - **Flip**: Image manipulation in `defImages` to flip images horizontally and/or vertically. - **Foundation models and LLMs**: GenAIScript supports multiple LLMs and plans to add other foundation models beyond language models. - **GenAIScript**: GenAIScript is a scripting language making LLMs first-class in scripts, enabling users to author, debug, and deploy AI-powered scripts for advanced automation. - **GenAIScript CLI**: The command-line tool for GenAIScript, allowing script execution, automation, and testing. See [installation guide](https://microsoft.github.io/genaiscript/getting-started/installation). - **generateImage**: API for OpenAI-compatible image generation services (e.g., DALL-E, Stable Diffusion), returns URLs/images for LLM prompts. - **Git Agent ([agent_git])**: Built-in agent able to interact with the current Git repository to query commits, diffs, branches, etc. - **GitHub Agent ([agent_github])**: Built-in agent querying GitHub data (workflows, runs, jobs, logs, issues, PRs) via specialized tools. - **grep**: workspace API to search files by globs or regex, returning matches. - **Greyscale**: Image processing option in `defImages` to convert images to greyscale. - **Helper scripts**: `package.json` entries ensuring correct TypeScript definition file generation for scripts. - **host.fetch**: Enhanced fetch supporting proxies and auto-retries for HTTP requests. - **host.fetchText**: Function to fetch and convert text or HTML to normalized plain text/Markdown for LLM prompts. - **HTML Processing**: Functions to convert HTML to text/markdown or extract tables as JSON from HTML. - **Import Template**: Import prompt templates into GenAIScript with `importTemplate`, supporting mustache variable interpolation and file globs. - **include**: Glob pattern setting to include additional scripts for sharing across projects. - **Inline prompt**: Embedded prompt template or function in GenAIScript scripts, templated for LLM requests, often used with `prompt` or `runPrompt`. - **Inline prompts**: Embedded prompt templates (often via `prompt` or `runPrompt`) forming LLM requests with programmatic context. - **Label**: Identifier assigned to a prompt/transformation step for tracking or caching. - **Launching**: From the workspace root, run `npx --yes genaiscript serve` and go to the provided URL, typically `http://127.0.0.1:8003/`. - **List of script configuration**: Lists scripts/model configurations for CI/CD troubleshooting. - **Listing model configuration**: Lists available scripts/model configurations for CI/CD troubleshooting. - **Local installation**: Install CLI locally with `npm install -g genaiscript` to avoid npx slowness. - **Locators**: APIs in browser automation to select DOM elements using roles, test IDs, or CSS selectors. - **Logging**: Debug/log mechanism in agents and scripts. Uses [debug](https://www.npmjs.com/package/debug) library to select logging namespaces. - **Markdown**: Markdown is a lightweight markup language used for authoring content, documentation, and web pages. - **Markdown Notebook**: Interactive Markdown editor in VS Code that executes GenAIScript snippets inline within Markdown files. - **Max width, max height**: Options in `defImages` to constrain image size by specifying maximum width/height. - **Memory**: Shared data store across agents logging queries and answers to maintain context and horizontal sharing. - **Mermaid**: Markdown extension for generating diagrams and charts, supported for visual output in GenAIScript. - **Model Context Protocol (MCP)**: Protocol for sharing and consuming [tools](https://modelcontextprotocol.io/docs/concepts/tools) regardless of runtime/framework - **modelAliases**: Allows aliases for model names in GenAIScript configuration. - **modelEncodings**: Defines model-specific encodings for LLMs. - **Module Imports**: Support in `.mjs`/`.mts` scripts for importing npm packages/local modules, statically or dynamically. - **Multiple Instances of Agents**: Ability to run several instances of the same agent (e.g., multiple `agent_git`s) separately with different parameters. - **Native Playwright APIs**: Underlying Playwright Page API objects for advanced automation/scraping in GenAIScript's browser automation. - **network flag**: CLI/server flag to bind to `0.0.0.0` for remote/container access. - **No Installation (npx)**: Run GenAIScript CLI with npx without prior installation. - **Node.JS run API**: API to run GenAIScript in isolated Node worker threads to prevent scope pollution. - **OpenAI**: Provider of foundation models like GPT-4, used as LLMs in GenAIScript. - **OpenAI Vision**: Feature allowing image and URL processing directly with OpenAI models in GenAIScript. - **openai-compatible endpoints**: GenAIScript exposes endpoints (e.g., `/v1/chat/completions`) compatible with OpenAI APIs. - **parsers.CSV**: Parser processing CSV files or text - **parsers.DOCX**: Automatically extracts and cleans text from DOCX files for prompts. - **patches**: Object used to cache computed transformations in search-and-transform, mapping original matches to transformed text. - **patternRx**: RegExp built from input pattern, used to search files for matches in search-and-transform scripts. - **Phi-3**: [Phi-3](https://azure.microsoft.com/en-us/blog/introducing-phi-3-redefining-whats-possible-with-slms/) is a 3.8B parameter open LLM by Microsoft. - **Playground**: Self-hosted web app for running GenAIScript scripts with a user-friendly UI - **Playwright**: Open-source browser automation library for headless control, scraping, and automation. Integrated into GenAIScript. - **Prerequisites**: Requirements for using GenAIScript CLI, such as Node.js installation. - **Promise queue**: Concurrency utility limiting simultaneous async LLM calls to avoid rate limits. - **prompty**: Templating format for LLM prompts in GenAIScript. - **Pull Requests**: Open PRs against the `dev` branch in GenAIScript repositories. - **Remote repository**: Playground runs scripts from a remote repo using secrets from `.env`. - **Rotate**: Image manipulation in `defImages` to rotate an image by a specified degree. - **run**: The `run` function wraps the [CLI run](/genaiscript/reference/cli/run) command to execute scripts. - **Run a script**: Executes a script, streaming LLM output to stdout from the workspace root. - **Running scripts from a remote repository**: Use `--remote` to load/run scripts from a remote repository via shallow clone. - **runPrompt**: Function in GenAIScript to prompt an LLM and receive transformed text or results. Used for text transformation and structured reasoning. - **samples**: Sample scripts, fully usable and modifiable for your needs. - **SARIF**: Static Analysis Results Interchange Format, a JSON standard for security/code analysis. GenAIScript can convert annotations to SARIF for upload/review (e.g., in VS Code). - **saving changed files**: In search-and-transform, after updating, writes modified content back to file via `workspace.writeText`. - **Scale**: Resizes an image proportionally in `defImages`. - **script files**: GenAIScript accepts any `*.genai.mjs`, `*.genai.js`, or `*.genai.mts` as scripts, located anywhere in the workspace. - **Script logger**: Script-level debug logger `env.dbg` in GenAIScript with a `script` namespace, visible when enabled. - **script parameters**: Named inputs (`glob`, `pattern`, `transform`) in search-and-transform scripts, specifying file glob, regex, and LLM transformation applied to matches. - **Scripts**: GenAIScript source files (e.g., `*.genai.mjs`) using features like inline prompts, agents, and tooling. - **Secret scanning**: Scans resources/tool outputs for secrets (e.g., API keys/patterns) to prevent accidental exposure. - **Starlight**: Project for building/authoring documentation sites using Astro with specific design principles. - **suffix option**: CLI `convert` command option to set a suffix for output files, handling markdown fences. - **System behavior**: Integration framework for code execution, foundation model/LLM invocations, and parsing results. - **system prompt template**: Files named `system.*.genai.mjs` act as templates providing system-level prompt context for LLMs. - **System Prompts**: Predefined templates inserted in LLM context for assistant behavior and safety (e.g., `system.assistant`, `system.safety_jailbreak`, `system.safety_harmful_content`). - **system.*.genai.mjs**: Files `system.*.genai.mjs` are [system prompt templates](/genaiscript/reference/scripts/system), hidden/unlisted by default. - **Test result viewer**: CLI command (`test view`) to visually inspect prompt-driven test results in GenAIScript using promptfoo. - **top logprobs**: Advanced logging mode for LLMs to return probabilities and top alternate tokens for each generated token, aiding model diagnosis. - **transform**: Textual LLM instruction for modifying matched content in search-and-transform - **Transformation options**: Image transformations supported in `defImages` (crop, auto crop, greyscale, rotate, scale, flip). - **Transparency Note**: Information to help users understand GenAIScript’s features and limitations. - **UpdateFrontmatter**: Function in `MD` class to merge or remove frontmatter fields in markdown files. - **Vector Search**: Semantic search using vector embeddings for document retrieval. See [Vector Search](/genaiscript/reference/scripts/vector-search/). - **video extract-audio**: CLI/subcommand to extract and optimize audio from video for transcription. - **video extract-frames**: CLI/subcommand to extract screenshots at specific timestamps from video files. - **Video probe**: CLI/subcommand running `ffprobe` to display video/audio media info. - **Visual Studio Code extension**: Add-in for VS Code to author, debug, and deploy GenAIScript scripts. - **Visual Studio Code Markdown Notebook**: Integration for interactive Markdown editing, enabling execution and inline GenAIScript results inside VS Code documents. - **Visual Studio Code Markdown Preview**: Uses VS Code’s built-in Markdown preview for displaying LLM output and traces, with content restrictions. - **Visual Studio Code Marketplace**: [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=genaiscript.genaiscript-vscode) provides the latest [VS Code GenAIScript extension](https://marketplace.visualstudio.com/items?itemName=genaiscript.genaiscript-vscode). - **Visual Studio Code Workspace Trust**: Disables GenAIScript extension in [Restricted Mode](https://code.visualstudio.com/docs/editor/workspace-trust). - **VS Code Extension**: GenAIScript extension for VS Code, enabling scripting, debugging, and execution. - **VS Code GenAIScript extension**: VS Code extension for creating, editing, running, and debugging GenAIScript scripts. - **WarningCode**: Component to show security warnings and mitigations in documentation. - **Working behind a Proxy**: Using CLI in HTTP proxy environments, with config adjustments as required. - **workspace**: API representing the file workspace, offering file search (`grep`), read (`readText`), and write (`writeText`) operations. - **Workspace cache**: Storage for caching LLM request results for performance (~`.genaiscript/cache/chat.jsonl`).

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/microsoft/genaiscript'

If you have feedback or need assistance with the MCP directory API, please join our Discord server