Skip to content

Commit

Permalink
Merge pull request #1084 from microsoft/isidorn/solid-chameleon
Browse files Browse the repository at this point in the history
chat sample disambiguation
  • Loading branch information
isidorn committed Aug 14, 2024
2 parents bc0c133 + 73ca99f commit d5cb4fc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
25 changes: 23 additions & 2 deletions chat-sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
]
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions chat-sample/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit d5cb4fc

Please sign in to comment.