Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rschnekenbu committed Jun 25, 2024
1 parent e1383da commit 915194d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/plugin/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ export function createAPIFactory(
createChatParticipant(id: string, handler: theia.ChatRequestHandler): theia.ChatParticipant {
return {
id,
requestHandler: (request: theia.ChatRequest, context: theia.ChatContext, response: theia.ChatResponseStream, token: CancellationToken) => { },
requestHandler: handler,
dispose() {},
onDidReceiveFeedback: (listener, thisArgs?, disposables?) => Event.None(listener, thisArgs, disposables)
};
Expand Down
38 changes: 27 additions & 11 deletions packages/plugin-ext/src/plugin/types-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3863,34 +3863,50 @@ export class ChatRequestTurn {
export class ChatResponseTurn {
readonly command?: string;

private constructor(public readonly response: ReadonlyArray<theia.ChatResponseMarkdownPart | theia.ChatResponseFileTreePart | theia.ChatResponseAnchorPart
| theia.ChatResponseCommandButtonPart>, public readonly result: theia.ChatResult, public readonly participant: string) { }
private constructor(readonly response: ReadonlyArray<theia.ChatResponseMarkdownPart | theia.ChatResponseFileTreePart | theia.ChatResponseAnchorPart
| theia.ChatResponseCommandButtonPart>, readonly result: theia.ChatResult, readonly participant: string) { }
}

export class ChatResponseAnchorPart {
constructor(public value: URI | Location, public title?: string) { }
value: URI | Location;
title?: string;

constructor(value: URI | Location, title?: string) { }
}

export class ChatResponseProgressPart {
constructor(public value: string) { }
value: string;

constructor(value: string) { }
}

export class ChatResponseReferencePart {
constructor(public value: URI | theia.Location, public iconPath?: URI | ThemeIcon | {
value: URI | Location;
iconPath?: URI | ThemeIcon | { light: URI; dark: URI; };

constructor(value: URI | theia.Location, iconPath?: URI | ThemeIcon | {
light: URI;
dark: URI;
}) { }
}
export class ChatResponseCommandButtonPart {
constructor(public value: theia.Command) { }
value: theia.Command;

constructor(value: theia.Command) { }
}

export class ChatResponseMarkdownPart {
constructor(public value: string | theia.MarkdownString) { }
value: theia.MarkdownString;

constructor(value: string | theia.MarkdownString) {
}
}

export class ChatResponseFileTreePart {
constructor(public value: theia.ChatResponseFileTree[], public baseUri: URI) { }
value: theia.ChatResponseFileTree[];
baseUri: URI;

constructor(value: theia.ChatResponseFileTree[], baseUri: URI) { }
}

export type ChatResponsePart = ChatResponseMarkdownPart | ChatResponseFileTreePart | ChatResponseAnchorPart
Expand Down Expand Up @@ -3922,15 +3938,15 @@ export class LanguageModelChatMessage {
export class LanguageModelError extends Error {

static NoPermissions(message?: string): LanguageModelError {
return new LanguageModelError(message, LanguageModelError.NotFound.name);
return new LanguageModelError(message, LanguageModelError.NoPermissions.name);
}

static Blocked(message?: string): LanguageModelError {
return new LanguageModelError(message);
return new LanguageModelError(message, LanguageModelError.Blocked.name);
}

static NotFound(message?: string): LanguageModelError {
return new LanguageModelError(message);
return new LanguageModelError(message, LanguageModelError.NotFound.name);
}

readonly code: string;
Expand Down

0 comments on commit 915194d

Please sign in to comment.