Path: blob/main/extensions/copilot/src/platform/chat/common/interactionService.ts
13401 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { createServiceIdentifier } from '../../../util/common/services';6import { generateUuid } from '../../../util/vs/base/common/uuid';78export const IInteractionService = createServiceIdentifier<IInteractionService>('IInteractionService');910export interface IInteractionService {11readonly _serviceBrand: undefined;1213readonly interactionId: string;1415startInteraction(): void;16}1718/**19* Simple service that tracks an interaction with a chat service20* This is used for grouping requests to a logical interaction with the UI21* It is just used for telemetry collection so is not 100% accurate, especially in the case of parallel interactions22*/23export class InteractionService implements IInteractionService {24_serviceBrand: undefined;25private _interactionId: string = generateUuid();2627startInteraction(): void {28this._interactionId = generateUuid();29}3031public get interactionId(): string {32return this._interactionId;33}34}353637