DVT PSS IDE User Guide
Rev. 24.2.24, 14 October 2024

9.6.5 Custom Snippets

AI Assistant allows you to define custom snippets. The easiest way to create a custom snippet is by saving a chat request using the “Save Message as Snippet” button.

A snippet file has the following format:

import { PromptSnippet } from "./@api/v1";
export default {
    // Unique name used to identify the snippet and to overwrite a built-in or custom snippet
    name: 'Intro',
    // Snippet signature used to refer to this snippet
    signature: '@intro',
    // Whether to expand snippets and symbols nested in the prompt string
    expand: true,
    // The prompt string (snippet expansion)
    prompt: 'Act as a @language engineer.'
} satisfies PromptSnippet

The snippet must be a valid TypeScript file with the .ai.ts extension.

AI Assistant looks for the snippet files in these locations:

  • $HOME/.dvt/ai/*.ai.ts

  • <project>/.dvt/ai/*.ai.ts