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

9.6.3 Custom Blueprints

AI Assistant allows you to define custom blueprints. The easiest way to create a custom blueprint is by:

  • Saving a chat request using the Save Message as Blueprint button

  • Saving a chat session using the Save Chat Session as Blueprint button

A blueprint file has the following format:

import { SessionBlueprint } from "./@api/v1"  
export default {
    // Unique name used to identify the blueprint and to overwrite a built-in or custom blueprint
    name: 'Write a 4-bit counter',
    // The assistant's reply to the blueprint's messages will target the specified component
    // ('chat' | 'editor')
    target: 'editor',
    // Editor action when the assistant's reply targets the editor
    // ('replace' | 'insert')
    action: 'replace',
    // The messages (requests and replies) used to create the new session:
    // - At least one message must be present
    // - User and assistant messages must alternate
    // - Sessions started from this blueprint will automatically pull a reply from the LLM when the last message is a user message
    // - When targeting the editor, the last blueprint message must be a user message to which the LLM will reply in the editor
    messages: [{
        // Roles can be 'user' or 'assistant'
        role: 'user',
        content: `Write a 4-bit counter in @language.`
    }]
} satisfies SessionBlueprint

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

AI Assistant looks for the blueprint files in these locations:

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

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