Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(chat): Remove proposed API #842

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
"color": "#3D4F58",
"theme": "dark"
},
"enabledApiProposals": [
"chatParticipantAdditions"
],
"enabledApiProposals": [],
"license": "SEE LICENSE IN LICENSE.txt",
"main": "./dist/extension.js",
"scripts": {
Expand Down
11 changes: 10 additions & 1 deletion src/participant/participant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1417,9 +1417,18 @@ Please see our [FAQ](https://www.mongodb.com/docs/generative-ai-faq/) for more i
if (feedback.result.metadata?.intent === 'docs') {
await this._rateDocsChatbotMessage(feedback);
}

// unhelpfulReason is available in insider builds and is accessed through
// https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts
// Since this is a proposed API, we can't depend on it being available, which is why
// we're dynamically checking for it.
const unhelpfulReason =
'unhelpfulReason' in feedback
? (feedback.unhelpfulReason as string)
: undefined;
this._telemetryService.trackCopilotParticipantFeedback({
feedback: chatResultFeedbackKindToTelemetryValue(feedback.kind),
reason: feedback.unhelpfulReason,
reason: unhelpfulReason,
response_type: (feedback.result as ChatResult)?.metadata.intent,
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/suite/participant/participant.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ Schema:
},
},
unhelpfulReason: 'incompleteCode',
});
} as vscode.ChatResultFeedback);

sinon.assert.calledOnce(telemetryTrackStub);
expect(telemetryTrackStub.lastCall.args[0]).to.be.equal(
Expand Down
Loading
Loading