822
823
clearToPreviousToolInvocation(message?: string): void {
825
>
// look through the response parts and find the last tool invocation, then slice the response parts to that point
826
>
let lastToolInvocationIndex = -1;
827
>
for (let i = this._responseParts.length - 1; i >= 0; i--) {
828
>
const part = this._responseParts[i];
829
>
if (part.kind === 'toolInvocation' || part.kind === 'toolInvocationSerialized') {
830
lastToolInvocationIndex = i;
831
break;
832
}
834
>
if (lastToolInvocationIndex !== -1) {
835
this._responseParts = this._responseParts.slice(0, lastToolInvocationIndex + 1);
837
>
this._responseParts = [];
838
>
}
839
>
if (message) {
840
>
this._responseParts.push({ kind: 'warning', content: new MarkdownString(message) });
841
>
}
842
>
this._contentChanged(true);
843
>
}
844
845
updateContent(progress: IChatProgressResponseContent | IChatTextEdit | IChatNotebookEdit | IChatTask | IChatExternalToolInvocationUpdate, quiet?: boolean): void {