Skip to content

Commit 13157e0

Browse files
authored
Remove IntentParams and intent:true (#534)
Took a long time, this started as a PR on the old vscode-copilot repo
1 parent 6357511 commit 13157e0

File tree

78 files changed

+3349
-3154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3349
-3154
lines changed

src/extension/conversation/vscode-node/languageModelAccess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ export class CopilotLanguageModelWrapper extends Disposable {
375375
{ type: 'function', function: { name: _options.tools[0].name } } :
376376
undefined;
377377

378-
const result = await endpoint.makeChatRequest('copilotLanguageModelWrapper', messages, callback, token, ChatLocation.Other, { extensionId }, options, true, telemetryProperties, { intent: true });
378+
const result = await endpoint.makeChatRequest('copilotLanguageModelWrapper', messages, callback, token, ChatLocation.Other, { extensionId }, options, true, telemetryProperties);
379379

380380
if (result.type !== ChatFetchResponseType.Success) {
381381
if (result.type === ChatFetchResponseType.ExtensionBlocked) {

src/extension/mcp/vscode-node/mcpToolCallingLoop.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ export class McpToolCallingLoop extends ToolCallingLoop<IMcpToolCallingLoopOptio
9292
...opts.requestOptions,
9393
temperature: 0
9494
},
95-
intentParams: { intent: true }
9695
}, token);
9796
}
9897
}

src/extension/prompt/node/chatMLFetcher.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ export class ChatMLFetcherImpl extends AbstractChatMLFetcher {
226226
requestOptions,
227227
userInitiatedRequest: false, // do not mark the retry as user initiated
228228
telemetryProperties: { ...telemetryProperties, retryAfterFilterCategory: result.category ?? 'uncategorized' },
229-
intentParams: opts.intentParams,
230229
isFilterRetry: true,
231230
}, token);
232231

src/extension/prompt/node/codebaseToolCalling.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ export class CodebaseToolCallingLoop extends ToolCallingLoop<ICodebaseToolCallin
8888
messageId: randomUUID(), // @TODO@joyceerhl
8989
messageSource: CodebaseToolCallingLoop.ID
9090
},
91-
{ intent: true }
9291
);
9392
}
9493
}

src/extension/prompt/node/defaultIntentRequestHandler.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ class DefaultToolCallingLoop extends ToolCallingLoop<IDefaultToolLoopOptions> {
687687
conversationId: this.options.conversation.sessionId,
688688
messageSource: this.options.intent?.id && this.options.intent.id !== UnknownIntent.ID ? `${messageSourcePrefix}.${this.options.intent.id}` : `${messageSourcePrefix}.user`,
689689
},
690-
intentParams: { intent: true }
691690
}, token);
692691
}
693692

src/extension/workspaceSemanticSearch/node/semanticSearchTextSearchProvider.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ export class SemanticSearchTextSearchProvider implements vscode.AITextSearchProv
232232
messageId: generateUuid(),
233233
messageSource: 'search.workspace'
234234
},
235-
{ intent: true }
236235
);
237236
SemanticSearchTextSearchProvider.feedBackTelemetry.llmFilteringDuration = Date.now() - llmFilteringDuration;
238237
searchResult = fetchResult.type === 'success' ? fetchResult.value : (fetchResult.type === 'length' ? fetchResult.truncatedValue : '');
@@ -481,7 +480,6 @@ export class SemanticSearchTextSearchProvider implements vscode.AITextSearchProv
481480
messageId: generateUuid(),
482481
messageSource: 'search.keywords'
483482
},
484-
{ intent: true }
485483
);
486484
const keywordResult = fetchResult.type === 'success' ? fetchResult.value : (fetchResult.type === 'length' ? fetchResult.truncatedValue : '');
487485
const usedResults = [];

src/platform/chat/common/chatMLFetcher.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ import { FinishedCallback, IResponseDelta, OptionalChatRequestParams } from '../
1111
import { IChatEndpoint, IMakeChatRequestOptions } from '../../networking/common/networking';
1212
import { ChatResponse, ChatResponses } from './commonTypes';
1313

14-
export interface IntentParams {
15-
16-
/** Copilot-only: whether to run intent classifier for off-topic detection */
17-
intent?: boolean;
18-
19-
/** Copilot-only: threshold for intent classifier */
20-
intent_threshold?: number;
21-
}
22-
2314
export interface Source {
2415
readonly extensionId?: string;
2516
}
@@ -43,19 +34,6 @@ export interface IChatMLFetcher {
4334

4435
readonly onDidMakeChatMLRequest: Event<{ readonly model: string; readonly source?: Source; readonly tokenCount?: number }>;
4536

46-
/**
47-
* @param debugName A helpful name for the request, shown in logs and used in telemetry if telemetryProperties.messageSource isn't set. Using a single camelCase word is advised.
48-
* @param messages The list of messages to send to the model
49-
* @param finishedCb A callback that streams response content
50-
* @param token A cancel token
51-
* @param location The location of the feature making this request
52-
* @param endpoint The chat model info
53-
* @param source The participant/extension making this request, if applicable
54-
* @param requestOptions To override the default request options
55-
* @param userInitiatedRequest Whether or not the request is the user's or some background / auxillary request. Used for billing.
56-
* @param telemetryProperties messageSource/messageId are included in telemetry, optional, defaults to debugName
57-
* @param intentParams { intent: true } enables the offtopic classifier
58-
*/
5937
fetchOne(options: IFetchMLOptions, token: CancellationToken): Promise<ChatResponse>;
6038

6139
/**

src/platform/chat/common/responses.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { Raw } from '@vscode/prompt-tsx';
77
import { OptionalChatRequestParams } from '../../networking/common/fetch';
8-
import { IntentParams, Source } from './chatMLFetcher';
8+
import { Source } from './chatMLFetcher';
99
import { ChatLocation } from './commonTypes';
1010

1111
export interface IRichChatRequestOptions {
@@ -17,6 +17,4 @@ export interface IRichChatRequestOptions {
1717
requestOptions?: Omit<OptionalChatRequestParams, 'n'>;
1818
/** Whether the request was user-initiated (applicable to CAPI requests) */
1919
userInitiatedRequest?: boolean;
20-
/** Intent parameters (applicable to CAPI requests) */
21-
intentParams?: IntentParams;
2220
}

src/platform/endpoint/common/autoChatEndpoint.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ChatMessage } from '@vscode/prompt-tsx/dist/base/output/rawTypes';
88
import type { CancellationToken } from 'vscode';
99
import { ITokenizer, TokenizerType } from '../../../util/common/tokenizer';
1010
import { AsyncIterableObject } from '../../../util/vs/base/common/async';
11-
import { IntentParams, Source } from '../../chat/common/chatMLFetcher';
11+
import { Source } from '../../chat/common/chatMLFetcher';
1212
import { ChatLocation, ChatResponse } from '../../chat/common/commonTypes';
1313
import { IEnvService } from '../../env/common/envService';
1414
import { ILogService } from '../../log/common/logService';
@@ -79,7 +79,7 @@ export class AutoChatEndpoint implements IChatEndpoint {
7979
return this._wrappedEndpoint.makeChatRequest2(options, token);
8080
}
8181

82-
async makeChatRequest(debugName: string, messages: ChatMessage[], finishedCb: FinishedCallback | undefined, token: CancellationToken, location: ChatLocation, source?: Source, requestOptions?: Omit<OptionalChatRequestParams, 'n'>, userInitiatedRequest?: boolean, telemetryProperties?: TelemetryProperties, intentParams?: IntentParams): Promise<ChatResponse> {
82+
async makeChatRequest(debugName: string, messages: ChatMessage[], finishedCb: FinishedCallback | undefined, token: CancellationToken, location: ChatLocation, source?: Source, requestOptions?: Omit<OptionalChatRequestParams, 'n'>, userInitiatedRequest?: boolean, telemetryProperties?: TelemetryProperties): Promise<ChatResponse> {
8383
return this.makeChatRequest2({
8484
debugName,
8585
messages,
@@ -89,7 +89,6 @@ export class AutoChatEndpoint implements IChatEndpoint {
8989
requestOptions,
9090
userInitiatedRequest,
9191
telemetryProperties,
92-
intentParams
9392
}, token);
9493
}
9594
}

src/platform/endpoint/node/chatEndpoint.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { deepClone, mixin } from '../../../util/vs/base/common/objects';
1212
import { generateUuid } from '../../../util/vs/base/common/uuid';
1313
import { IInstantiationService } from '../../../util/vs/platform/instantiation/common/instantiation';
1414
import { IAuthenticationService } from '../../authentication/common/authentication';
15-
import { IChatMLFetcher, IntentParams, Source } from '../../chat/common/chatMLFetcher';
15+
import { IChatMLFetcher, Source } from '../../chat/common/chatMLFetcher';
1616
import { ChatLocation, ChatResponse } from '../../chat/common/commonTypes';
1717
import { getTextPart } from '../../chat/common/globalStringUtils';
1818
import { CHAT_MODEL, ConfigKey, IConfigurationService } from '../../configuration/common/configurationService';
@@ -318,7 +318,6 @@ export class ChatEndpoint implements IChatEndpoint {
318318
requestOptions?: Omit<OptionalChatRequestParams, 'n'>,
319319
userInitiatedRequest?: boolean,
320320
telemetryProperties?: TelemetryProperties,
321-
intentParams?: IntentParams
322321
): Promise<ChatResponse> {
323322
return this.makeChatRequest2({
324323
debugName,
@@ -329,7 +328,6 @@ export class ChatEndpoint implements IChatEndpoint {
329328
requestOptions,
330329
userInitiatedRequest,
331330
telemetryProperties,
332-
intentParams
333331
}, token);
334332
}
335333

0 commit comments

Comments
 (0)