mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
Chat Prompt Files Sample
Demonstrates the proposed Chat Prompt Files API to register providers for custom agents, instructions, and prompt files with dynamic content.
Features
Three provider types, each with dynamic content generation:
- Custom Agent (customAgentProvider.ts) - Workspace statistics with folder names and counts
- Instructions (instructionsProvider.ts) - Active editor context including current file and language
- Prompt Files (promptFileProvider.ts) - Time-based greetings and contextual suggestions
Static files are contributed via package.json. Providers demonstrate dynamic content using data URIs.
Running the Sample
npm installto install dependenciesnpm run watchto compileF5to launch with the extension- Open the chat panel to see the contributed prompts
API Reference
vscode.chat.registerCustomAgentProvider()vscode.chat.registerInstructionsProvider()vscode.chat.registerPromptFileProvider()