Skip to content

Commit 322b4e7

Browse files
authored
Adopt tool API changes (#6487)
1 parent 84b7387 commit 322b4e7

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"version": "0.100.1",
3636
"publisher": "GitHub",
3737
"engines": {
38-
"vscode": "^1.95.0"
38+
"vscode": "^1.96.0"
3939
},
4040
"categories": [
4141
"Other",
@@ -3164,7 +3164,7 @@
31643164
"modelDescription": "Get a GitHub issue/PR's details as a JSON object.",
31653165
"icon": "$(info)",
31663166
"canBeReferencedInPrompt": true,
3167-
"parametersSchema": {
3167+
"inputSchema": {
31683168
"type": "object",
31693169
"properties": {
31703170
"repo": {
@@ -3207,7 +3207,7 @@
32073207
"modelDescription": "Get a GitHub notification's details as a JSON object.",
32083208
"icon": "$(info)",
32093209
"canBeReferencedInPrompt": true,
3210-
"parametersSchema": {
3210+
"inputSchema": {
32113211
"type": "object",
32123212
"properties": {
32133213
"thread_id": {
@@ -3233,7 +3233,7 @@
32333233
"modelDescription": "Summarizes a GitHub issue or pull request. A summary is a great way to describe an issue or pull request.",
32343234
"icon": "$(info)",
32353235
"canBeReferencedInPrompt": true,
3236-
"parametersSchema": {
3236+
"inputSchema": {
32373237
"type": "object",
32383238
"properties": {
32393239
"title": {
@@ -3308,7 +3308,7 @@
33083308
"modelDescription": "Summarizes a GitHub notification. A summary is a great way to describe a notification.",
33093309
"icon": "$(info)",
33103310
"canBeReferencedInPrompt": true,
3311-
"parametersSchema": {
3311+
"inputSchema": {
33123312
"type": "object",
33133313
"properties": {
33143314
"lastReadAt": {
@@ -3420,7 +3420,7 @@
34203420
"modelDescription": "Summarize and suggest a fix for a GitHub issue.",
34213421
"icon": "$(info)",
34223422
"canBeReferencedInPrompt": true,
3423-
"parametersSchema": {
3423+
"inputSchema": {
34243424
"type": "object",
34253425
"properties": {
34263426
"repo": {
@@ -3467,7 +3467,7 @@
34673467
"modelDescription": "Converts natural language to a GitHub search query. Should ALWAYS be called before doing a search.",
34683468
"icon": "$(search)",
34693469
"canBeReferencedInPrompt": true,
3470-
"parametersSchema": {
3470+
"inputSchema": {
34713471
"type": "object",
34723472
"properties": {
34733473
"repo": {
@@ -3511,7 +3511,7 @@
35113511
"modelDescription": "Execute a GitHub search given a well formed GitHub search query. Call github-pull-request_formSearchQuery first to get good search syntax and pass the exact result in as the 'query'.",
35123512
"icon": "$(search)",
35133513
"canBeReferencedInPrompt": true,
3514-
"parametersSchema": {
3514+
"inputSchema": {
35153515
"type": "object",
35163516
"properties": {
35173517
"repo": {
@@ -3557,7 +3557,7 @@
35573557
"modelDescription": "Render issue items from an issue search in a markdown table. The markdown table will be displayed directly to the user by the tool. No further display should be done after this!",
35583558
"icon": "$(paintcan)",
35593559
"canBeReferencedInPrompt": false,
3560-
"parametersSchema": {
3560+
"inputSchema": {
35613561
"type": "object",
35623562
"properties": {
35633563
"arrayOfIssues": {

src/lm/tools/fetchIssueTool.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ export class FetchIssueTool extends RepoToolBase<FetchIssueToolParameters> {
8080
}
8181
const { owner, name } = await this.getRepoInfo({ owner: options.input.repo?.owner, name: options.input.repo?.name });
8282
const url = (owner && name) ? `https://github.com/${owner}/${name}/issues/${options.input.issueNumber}` : undefined;
83+
const message = url ? new vscode.MarkdownString(vscode.l10n.t('Fetching item [#{0}]({1}) from GitHub', options.input.issueNumber, url)) : vscode.l10n.t('Fetching item #{0} from GitHub', options.input.issueNumber);
8384
return {
84-
invocationMessage: url ? vscode.l10n.t('Fetching item [#{0}]({1}) from GitHub', options.input.issueNumber, url) : vscode.l10n.t('Fetching item #{0} from GitHub', options.input.issueNumber),
85+
invocationMessage: message,
8586
};
8687
}
8788
}

src/lm/tools/searchTools.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,12 @@ export class SearchTool extends RepoToolBase<SearchToolParameters> {
439439

440440
async prepareInvocation(options: vscode.LanguageModelToolInvocationPrepareOptions<SearchToolParameters>): Promise<vscode.PreparedToolInvocation> {
441441
const parameterQuery = options.input.query;
442+
const message = new vscode.MarkdownString();
443+
message.appendText(vscode.l10n.t('Searching for issues with "{0}".', parameterQuery));
444+
message.appendMarkdown(vscode.l10n.t('[Open on GitHub.com]({0})', escapeMarkdown(this.toGitHubUrl(parameterQuery))));
442445

443446
return {
444-
invocationMessage: vscode.l10n.t('Searching for issues with "{0}". [Open on GitHub.com]({1})', escapeMarkdown(parameterQuery), escapeMarkdown(this.toGitHubUrl(parameterQuery)))
447+
invocationMessage: message
445448
};
446449
}
447450

src/lm/tools/summarizeNotificationsTool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class NotificationSummarizationTool implements vscode.LanguageModelTool<F
2121
const type = parameters.itemType === 'issue' ? 'issues' : 'pull';
2222
const url = `https://github.com/${parameters.owner}/${parameters.repo}/${type}/${parameters.itemNumber}`;
2323
return {
24-
invocationMessage: vscode.l10n.t('Summarizing item [#{0}]({1})', parameters.itemNumber, url)
24+
invocationMessage: new vscode.MarkdownString(vscode.l10n.t('Summarizing item [#{0}]({1})', parameters.itemNumber, url))
2525
};
2626
}
2727

0 commit comments

Comments
 (0)