Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
HikaruEgashira committed Nov 21, 2024
1 parent 7306410 commit c1fd53e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/chatHandler.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import * as vscode from "vscode";
import { createOpenAI } from "@ai-sdk/openai";
import { type CoreMessage, generateText } from "ai";

export interface IChatResult extends vscode.ChatResult {
metadata: {
command: string;
};
}
import * as vscode from "vscode";

export const chatHandler: ({
apiKey,
Expand Down Expand Up @@ -61,7 +55,7 @@ function handleChatError(err: unknown, stream: vscode.ChatResponseStream): void
if (err instanceof vscode.LanguageModelError) {
console.error(err.message, err.code, err.cause);
if (err.cause instanceof Error) {
stream.markdown(vscode.l10n.t("I'm sorry, I cannot o1 your text."));
stream.markdown(vscode.l10n.t("I'm sorry, I cannot process your text."));
}
} else {
// re-throw other errors so they show up in the UI
Expand Down

0 comments on commit c1fd53e

Please sign in to comment.