use disambiguation per command

also rename teach to randomTeach
This commit is contained in:
isidorn
2024-08-14 17:51:58 +02:00
parent e5139d5cd4
commit 9e7875d28e
2 changed files with 32 additions and 16 deletions

View File

@ -26,27 +26,43 @@
"isSticky": true,
"commands": [
{
"name": "teach",
"description": "Pick at random a computer science concept then explain it in purfect way of a cat"
"name": "randomTeach",
"description": "Pick at random a computer science concept then explain it in purfect way of a cat",
"disambiguation": [
{
"categoryName": "cat_random_teach",
"description": "The user wants to learn a random computer science topic in an informal way.",
"examples": [
"Teach me anything about computer science using code samples",
"I want to understand computer science topics better"
]
}
]
},
{
"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_teach",
"description": "The user wants to learn a simple computer science topic in an informal way.",
"examples": ["Teach me C++ pointers using metaphors",
"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?"]
},
{
"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?"]
"Can you explain to me what is a function in programming?"
]
}
]
}

View File

@ -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 {