⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@

import { IAction } from '../../../../../../base/common/actions.js';
import { IMarkdownString } from '../../../../../../base/common/htmlContent.js';
import { Disposable } from '../../../../../../base/common/lifecycle.js';
import { IObservable, observableValue } from '../../../../../../base/common/observable.js';
import { ElicitationState, IChatElicitationRequest, IChatElicitationRequestSerialized } from '../../chatService/chatService.js';
import { ToolDataSource } from '../../tools/languageModelToolsService.js';

export class ChatElicitationRequestPart extends Disposable implements IChatElicitationRequest {
export class ChatElicitationRequestPart implements IChatElicitationRequest {
public readonly kind = 'elicitation2';
public state = observableValue('state', ElicitationState.Pending);
public acceptedResult?: Record<string, unknown>;
Expand All @@ -32,8 +31,6 @@ export class ChatElicitationRequestPart extends Disposable implements IChatElici
public readonly moreActions?: IAction[],
public readonly onHide?: () => void,
) {
super();

if (reject) {
this.reject = async () => {
const state = await reject!();
Expand All @@ -54,7 +51,7 @@ export class ChatElicitationRequestPart extends Disposable implements IChatElici
}
this._isHiddenValue.set(true, undefined, undefined);
this.onHide?.();
this.dispose();
this.state.set(ElicitationState.Rejected, undefined);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A hidden part is not necessarily rejected. An elicitaiton could be accepted and then hidden.

}

public toJSON() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ export class OutputMonitor extends Disposable implements IOutputMonitor {
}
let part!: ChatElicitationRequestPart;
const promise = new Promise<T | undefined>(resolve => {
const thePart = part = this._register(new ChatElicitationRequestPart(
const thePart = part = new ChatElicitationRequestPart(
title,
detail,
subtitle,
Expand Down Expand Up @@ -744,7 +744,7 @@ export class OutputMonitor extends Disposable implements IOutputMonitor {
undefined, // source
moreActions,
() => this._outputMonitorTelemetryCounters.inputToolManualShownCount++
));
);

chatModel.acceptResponseProgress(request, thePart);
this._promptPart = thePart;
Expand Down
Loading