Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove type duplication for kind property #14207

Merged
merged 1 commit into from
Sep 24, 2024
Merged
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
16 changes: 8 additions & 8 deletions packages/ai-chat/src/common/chat-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export class ChatRequestModelImpl implements ChatRequestModel {
}

export class ErrorChatResponseContentImpl implements ErrorChatResponseContent {
kind: 'error' = 'error';
readonly kind = 'error';
protected _error: Error;
constructor(error: Error) {
this._error = error;
Expand All @@ -388,7 +388,7 @@ export class ErrorChatResponseContentImpl implements ErrorChatResponseContent {
}

export class TextChatResponseContentImpl implements TextChatResponseContent {
kind: 'text' = 'text';
readonly kind = 'text';
protected _content: string;

constructor(content: string) {
Expand All @@ -410,7 +410,7 @@ export class TextChatResponseContentImpl implements TextChatResponseContent {
}

export class MarkdownChatResponseContentImpl implements MarkdownChatResponseContent {
kind: 'markdownContent' = 'markdownContent';
readonly kind = 'markdownContent';
protected _content: MarkdownStringImpl = new MarkdownStringImpl();

constructor(content: string) {
Expand All @@ -432,7 +432,7 @@ export class MarkdownChatResponseContentImpl implements MarkdownChatResponseCont
}

export class InformationalChatResponseContentImpl implements InformationalChatResponseContent {
kind: 'informational' = 'informational';
readonly kind = 'informational';
protected _content: MarkdownStringImpl;

constructor(content: string) {
Expand All @@ -454,7 +454,7 @@ export class InformationalChatResponseContentImpl implements InformationalChatRe
}

export class CodeChatResponseContentImpl implements CodeChatResponseContent {
kind: 'code' = 'code';
readonly kind = 'code';
protected _code: string;
protected _language?: string;
protected _location?: Location;
Expand Down Expand Up @@ -488,7 +488,7 @@ export class CodeChatResponseContentImpl implements CodeChatResponseContent {
}

export class ToolCallChatResponseContentImpl implements ToolCallChatResponseContent {
kind: 'toolCall' = 'toolCall';
readonly kind = 'toolCall';
protected _id?: string;
protected _name?: string;
protected _arguments?: string;
Expand Down Expand Up @@ -546,7 +546,7 @@ export const COMMAND_CHAT_RESPONSE_COMMAND: Command = {
id: 'ai-chat.command-chat-response.generic'
};
export class CommandChatResponseContentImpl implements CommandChatResponseContent {
kind: 'command' = 'command';
readonly kind = 'command';

constructor(public command?: Command, public customCallback?: CustomCallback, protected args?: unknown[]) {
}
Expand All @@ -561,7 +561,7 @@ export class CommandChatResponseContentImpl implements CommandChatResponseConten
}

export class HorizontalLayoutChatResponseContentImpl implements HorizontalLayoutChatResponseContent {
kind: 'horizontal' = 'horizontal';
readonly kind = 'horizontal';
protected _content: ChatResponseContent[];

constructor(content: ChatResponseContent[] = []) {
Expand Down
Loading