diff --git a/chat-agent-sample/src/extension.ts b/chat-agent-sample/src/extension.ts index e7f59b0b..5ac0d048 100644 --- a/chat-agent-sample/src/extension.ts +++ b/chat-agent-sample/src/extension.ts @@ -89,6 +89,28 @@ export function activate(context: vscode.ExtensionContext) { } }; + vscode.chat.registerVariable('cat_context', 'Describes the state of mind and version of the cat', { + resolve: (name, context, token) => { + if (name == 'cat_context') { + const mood = Math.random() > 0.5 ? 'happy' : 'grumpy'; + return [ + { + level: vscode.ChatVariableLevel.Short, + value: 'version 1.3 ' + mood + }, + { + level: vscode.ChatVariableLevel.Medium, + value: 'I am a playful cat, version 1.3, and I am ' + mood + }, + { + level: vscode.ChatVariableLevel.Full, + value: 'I am a playful cat, version 1.3, this version prefer to explain everything using mouse and tail metaphores. I am ' + mood + } + ] + } + } + }); + context.subscriptions.push( agent, // Register the command handler for the /meow followup