Skip to content

Commit

Permalink
refactor: remove teams chat participant (#12348)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alive-Fish committed Sep 10, 2024
1 parent 1fac52f commit 987cee6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 32 deletions.
15 changes: 0 additions & 15 deletions packages/vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1551,21 +1551,6 @@
}
},
"chatParticipants": [
{
"id": "ms-teams-vscode-extension.teams",
"name": "teams",
"description": "%teamstoolkit.chatParticipants.teams.description%",
"commands": [
{
"name": "create",
"description": "%teamstoolkit.chatParticipants.create.description%"
},
{
"name": "nextstep",
"description": "%teamstoolkit.chatParticipants.nextStep.description%"
}
]
},
{
"id": "ms-teams-vscode-extension.office",
"name": "office",
Expand Down
14 changes: 7 additions & 7 deletions packages/vscode-extension/src/chat/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const defaultSystemPrompt = () => {
);

return new vscode.LanguageModelChatMessage(
vscode.LanguageModelChatMessageRole.System,
vscode.LanguageModelChatMessageRole.User,
`You are an expert in Teams Toolkit Extension for VS Code. The user wants to use Teams Toolkit Extension for VS Code. Your job is to answer general conceputal question related Teams Toolkit Extension for VS Code. Folow the instruction and think step by step.
<Instruction>
Expand Down Expand Up @@ -40,22 +40,22 @@ export const defaultSystemPrompt = () => {

export const describeProjectSystemPrompt = () =>
new vscode.LanguageModelChatMessage(
vscode.LanguageModelChatMessageRole.System,
vscode.LanguageModelChatMessageRole.User,
`You are an advisor for Teams App developers. You need to describe the project based on the name and description field of user's JSON content. You should control the output between 50 and 80 words.`
);
export const brieflyDescribeProjectSystemPrompt = () =>
new vscode.LanguageModelChatMessage(
vscode.LanguageModelChatMessageRole.System,
vscode.LanguageModelChatMessageRole.User,
`You are an advisor for Teams App developers. You need to describe the project based on the name and description field of user's JSON content. You should control the output between 30 and 40 words.`
);
export const describeScenarioSystemPrompt = () =>
new vscode.LanguageModelChatMessage(
vscode.LanguageModelChatMessageRole.System,
vscode.LanguageModelChatMessageRole.User,
`You are an advisor for Teams App developers. You need to describe the project based on the name and description field of user's JSON content. You should control the output between 50 and 80 words.`
);
export const describeStepSystemPrompt = () =>
new vscode.LanguageModelChatMessage(
vscode.LanguageModelChatMessageRole.System,
vscode.LanguageModelChatMessageRole.User,
`You are an advisor for Teams App developers. You need to reorganize the content. You should control the output between 30 and 50 words. Don't split the content into multiple sentences.`
);

Expand All @@ -69,7 +69,7 @@ export function getTemplateMatchChatMessages(
.join(", ");
const chatMessages = [
new vscode.LanguageModelChatMessage(
vscode.LanguageModelChatMessageRole.System,
vscode.LanguageModelChatMessageRole.User,
`You're an assistant designed to find matched Teams template projects based on user's input and templates. The users will describe their requirement and application scenario in user ask. Follow the instructions and think step by step. You'll respond with IDs you've found from the templates as a JSON object. Respond result contains the app IDs you choose with a float number between 0-1.0 representing confidence. Here's an example of your output format:
{"app": [{"id": "", "score": 1.0}]}
Expand Down Expand Up @@ -125,7 +125,7 @@ export function getSampleMatchChatMessages(
.join(", ");
const chatMessages = [
new vscode.LanguageModelChatMessage(
vscode.LanguageModelChatMessageRole.System,
vscode.LanguageModelChatMessageRole.User,
`You're an assistant designed to find matched Teams application projects based on user's input and a list of existing application descriptions. Users will paste in a string of text that describes their requirement and application scenario. Follow the instructions and think step by step. You'll respond with IDs you've found from the existing application list as a JSON object. Respond result contains the app IDs you choose with a float number between 0-1.0 representing confidence. Here's an example of your output format:
{"app": [{"id": "", "score": 1.0}]}
Expand Down
8 changes: 1 addition & 7 deletions packages/vscode-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,10 @@ import { checkProjectTypeAndSendTelemetry, isM365Project } from "./utils/project
import { ReleaseNote } from "./utils/releaseNote";
import { ExtensionSurvey } from "./utils/survey";
import { getSettingsVersion, projectVersionCheck } from "./utils/telemetryUtils";
import { isVSCodeInsiderVersion } from "./utils/versionUtil";
import { createPluginWithManifest } from "./handlers/createPluginWithManifestHandler";

export async function activate(context: vscode.ExtensionContext) {
const value =
IsChatParticipantEnabled &&
semver.gte(vscode.version, "1.90.0-insider") &&
isVSCodeInsiderVersion();
const value = IsChatParticipantEnabled && semver.gte(vscode.version, "1.90.0");
featureFlagManager.setBooleanValue(FeatureFlags.ChatParticipant, value);

context.subscriptions.push(new ExtTelemetry.Reporter(context));
Expand All @@ -225,8 +221,6 @@ export async function activate(context: vscode.ExtensionContext) {
registerInternalCommands(context);

if (featureFlagManager.getBooleanValue(CoreFeatureFlags.ChatParticipant)) {
registerChatParticipant(context);

registerOfficeChatParticipant(context);
}

Expand Down
6 changes: 3 additions & 3 deletions packages/vscode-extension/test/chat/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ describe("chat utils", () => {

it("count empty message", () => {
const message = new vscodeMocks.chat.LanguageModelChatMessage(
vscodeMocks.chat.LanguageModelChatMessageRole.System,
vscodeMocks.chat.LanguageModelChatMessageRole.User,
""
);
const result = utils.countMessageTokens(message);
Expand All @@ -178,7 +178,7 @@ describe("chat utils", () => {

it("count message without name", () => {
const message = new vscodeMocks.chat.LanguageModelChatMessage(
vscodeMocks.chat.LanguageModelChatMessageRole.System,
vscodeMocks.chat.LanguageModelChatMessageRole.User,
"testContent1"
);
const result = utils.countMessageTokens(message);
Expand Down Expand Up @@ -221,7 +221,7 @@ describe("chat utils", () => {
it("count messages", () => {
const messages = [
new vscodeMocks.chat.LanguageModelChatMessage(
vscodeMocks.chat.LanguageModelChatMessageRole.System,
vscodeMocks.chat.LanguageModelChatMessageRole.User,
"testContent1"
),
new vscodeMocks.chat.LanguageModelChatMessage(
Expand Down

0 comments on commit 987cee6

Please sign in to comment.