mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Merge pull request #1084 from microsoft/isidorn/solid-chameleon
chat sample disambiguation
This commit is contained in:
@ -26,12 +26,33 @@
|
||||
"isSticky": true,
|
||||
"commands": [
|
||||
{
|
||||
"name": "teach",
|
||||
"name": "randomTeach",
|
||||
"description": "Pick at random a computer science concept then explain it in purfect way of a cat"
|
||||
},
|
||||
{
|
||||
"name": "play",
|
||||
"description": "Do whatever you want, you are a cat after all"
|
||||
"description": "Do whatever you want, you are a cat after all",
|
||||
"disambiguation": [
|
||||
{
|
||||
"categoryName": "cat_play",
|
||||
"description": "The user just wants to relax and see the cat play.",
|
||||
"examples": [
|
||||
"Enough learning, let the cat play with a ball of yarn",
|
||||
"Can you show me a cat playing with a laser pointer?"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"disambiguation": [
|
||||
{
|
||||
"categoryName": "cat",
|
||||
"description": "The user wants to learn a specific computer science topic in an informal way.",
|
||||
"examples": [
|
||||
"Teach me C++ pointers using metaphors",
|
||||
"Explain to me what is a linked list in a simple way",
|
||||
"Can you explain to me what is a function in programming?"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
// To talk to an LLM in your subcommand handler implementation, your
|
||||
// extension can use VS Code's `requestChatAccess` API to access the Copilot API.
|
||||
// The GitHub Copilot Chat extension implements this provider.
|
||||
if (request.command === 'teach') {
|
||||
if (request.command === 'randomTeach') {
|
||||
stream.progress('Picking the right topic to teach...');
|
||||
const topic = getTopic(context.history);
|
||||
try {
|
||||
@ -47,8 +47,8 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
title: vscode.l10n.t('Use Cat Names in Editor')
|
||||
});
|
||||
|
||||
logger.logUsage('request', { kind: 'teach'});
|
||||
return { metadata: { command: 'teach' } };
|
||||
logger.logUsage('request', { kind: 'randomTeach'});
|
||||
return { metadata: { command: 'randomTeach' } };
|
||||
} else if (request.command === 'play') {
|
||||
stream.progress('Throwing away the computer science books and preparing to play with some Python code...');
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user