From e5139d5cd497cbf76ee1b20c7e238b29a9162f62 Mon Sep 17 00:00:00 2001 From: isidorn Date: Wed, 14 Aug 2024 17:27:29 +0200 Subject: [PATCH 1/3] chat sample disambiguation --- chat-sample/package.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/chat-sample/package.json b/chat-sample/package.json index 6f30faac0..28366e393 100644 --- a/chat-sample/package.json +++ b/chat-sample/package.json @@ -33,6 +33,21 @@ "name": "play", "description": "Do whatever you want, you are a cat after all" } + ], + "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", + "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?"] + } ] } ], From 9e7875d28e557de1ab59570e42ee36d3545b769d Mon Sep 17 00:00:00 2001 From: isidorn Date: Wed, 14 Aug 2024 17:51:58 +0200 Subject: [PATCH 2/3] use disambiguation per command also rename teach to randomTeach --- chat-sample/package.json | 42 +++++++++++++++++++++++++----------- chat-sample/src/extension.ts | 6 +++--- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/chat-sample/package.json b/chat-sample/package.json index 28366e393..65b4b95c5 100644 --- a/chat-sample/package.json +++ b/chat-sample/package.json @@ -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?" + ] } ] } diff --git a/chat-sample/src/extension.ts b/chat-sample/src/extension.ts index f96939705..db684874c 100644 --- a/chat-sample/src/extension.ts +++ b/chat-sample/src/extension.ts @@ -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 { From 73ca99f455c8f580d582657b69888a250ea5cf64 Mon Sep 17 00:00:00 2001 From: isidorn Date: Wed, 14 Aug 2024 17:56:10 +0200 Subject: [PATCH 3/3] remove randomTeach disambiguation --- chat-sample/package.json | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/chat-sample/package.json b/chat-sample/package.json index 65b4b95c5..20f5ab95b 100644 --- a/chat-sample/package.json +++ b/chat-sample/package.json @@ -27,17 +27,7 @@ "commands": [ { "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" - ] - } - ] + "description": "Pick at random a computer science concept then explain it in purfect way of a cat" }, { "name": "play",