Path: blob/main/extensions/copilot/src/extension/prompt/node/feedbackReporter.ts
13399 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 { constObservable, IObservable } from '../../../util/vs/base/common/observableInternal';7import { InteractionOutcome, PromptQuery } from '../../inlineChat/node/promptCraftingTypes';8import { SearchFeedbackKind } from '../../workspaceSemanticSearch/node/semanticSearchTextSearchProvider';9import { Conversation, Turn } from '../common/conversation';1011export const IFeedbackReporter = createServiceIdentifier<IFeedbackReporter>('IFeedbackReporter');1213export interface IFeedbackReporter {14readonly _serviceBrand: undefined;1516readonly canReport: IObservable<boolean>;1718reportInline(conversation: Conversation, promptQuery: PromptQuery, interactionOutcome: InteractionOutcome): Promise<void>;19reportChat(turn: Turn): Promise<void>;20reportSearch(kind: SearchFeedbackKind): Promise<void>;21}222324export class NullFeedbackReporterImpl implements IFeedbackReporter {25_serviceBrand: undefined;2627readonly canReport = constObservable(false);2829async reportInline(conversation: Conversation, promptQuery: PromptQuery, interactionOutcome: InteractionOutcome): Promise<void> {30// nothing31}3233async reportChat(turn: Turn): Promise<void> {34// nothing35}3637async reportSearch(): Promise<void> {38// nothing39}40}4142export const NullFeedbackReporter = new NullFeedbackReporterImpl();434445