Skip to content

Commit 60021d6

Browse files
authored
chore(chat): Remove proposed API (#842)
1 parent 9279339 commit 60021d6

File tree

4 files changed

+12
-473
lines changed

4 files changed

+12
-473
lines changed

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
"color": "#3D4F58",
3333
"theme": "dark"
3434
},
35-
"enabledApiProposals": [
36-
"chatParticipantAdditions"
37-
],
35+
"enabledApiProposals": [],
3836
"license": "SEE LICENSE IN LICENSE.txt",
3937
"main": "./dist/extension.js",
4038
"scripts": {

src/participant/participant.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,9 +1417,18 @@ Please see our [FAQ](https://www.mongodb.com/docs/generative-ai-faq/) for more i
14171417
if (feedback.result.metadata?.intent === 'docs') {
14181418
await this._rateDocsChatbotMessage(feedback);
14191419
}
1420+
1421+
// unhelpfulReason is available in insider builds and is accessed through
1422+
// https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts
1423+
// Since this is a proposed API, we can't depend on it being available, which is why
1424+
// we're dynamically checking for it.
1425+
const unhelpfulReason =
1426+
'unhelpfulReason' in feedback
1427+
? (feedback.unhelpfulReason as string)
1428+
: undefined;
14201429
this._telemetryService.trackCopilotParticipantFeedback({
14211430
feedback: chatResultFeedbackKindToTelemetryValue(feedback.kind),
1422-
reason: feedback.unhelpfulReason,
1431+
reason: unhelpfulReason,
14231432
response_type: (feedback.result as ChatResult)?.metadata.intent,
14241433
});
14251434
}

src/test/suite/participant/participant.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,7 @@ Schema:
15781578
},
15791579
},
15801580
unhelpfulReason: 'incompleteCode',
1581-
});
1581+
} as vscode.ChatResultFeedback);
15821582

15831583
sinon.assert.calledOnce(telemetryTrackStub);
15841584
expect(telemetryTrackStub.lastCall.args[0]).to.be.equal(

0 commit comments

Comments
 (0)