-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(copilot): change to gpt-4o to default model
- Loading branch information
Showing
6 changed files
with
157 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
145 changes: 145 additions & 0 deletions
145
src/database/migration/1727111519962-changeDefaultLLMModel.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm' | ||
|
||
export class changeDefaultLLMModel1727111519962 implements MigrationInterface { | ||
name = 'changeDefaultLLMModel1727111519962' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
CREATE TABLE "temporary_SettingEntity" ( | ||
"id" varchar PRIMARY KEY NOT NULL, | ||
"width" integer NOT NULL DEFAULT (1025), | ||
"height" integer NOT NULL DEFAULT (749), | ||
"autoCheck" boolean NOT NULL DEFAULT (1), | ||
"currentLang" varchar CHECK(currentLang IN ('zh', 'en', 'ja', 'tr', 'hu')) NOT NULL DEFAULT ('en'), | ||
"currentTheme" varchar CHECK(currentTheme IN ('light', 'dark', 'night')) NOT NULL DEFAULT ('light'), | ||
"maxReconnectTimes" integer NOT NULL DEFAULT (10), | ||
"autoResub" boolean NOT NULL DEFAULT (1), | ||
"syncOsTheme" boolean NOT NULL DEFAULT (0), | ||
"multiTopics" boolean NOT NULL DEFAULT (1), | ||
"jsonHighlight" boolean NOT NULL DEFAULT (1), | ||
"openAIAPIKey" varchar NOT NULL DEFAULT (''), | ||
"model" varchar NOT NULL DEFAULT ('gpt-4o'), | ||
"enableCopilot" boolean NOT NULL DEFAULT (1), | ||
"logLevel" varchar CHECK(logLevel IN ('debug', 'info', 'warn', 'error')) NOT NULL DEFAULT ('info'), | ||
"openAIAPIHost" varchar NOT NULL DEFAULT ('https://api.openai.com/v1'), | ||
"ignoreQoS0Message" boolean NOT NULL DEFAULT (0) | ||
) | ||
`) | ||
await queryRunner.query(` | ||
INSERT INTO "temporary_SettingEntity"( | ||
"id", | ||
"width", | ||
"height", | ||
"autoCheck", | ||
"currentLang", | ||
"currentTheme", | ||
"maxReconnectTimes", | ||
"autoResub", | ||
"syncOsTheme", | ||
"multiTopics", | ||
"jsonHighlight", | ||
"openAIAPIKey", | ||
"model", | ||
"enableCopilot", | ||
"logLevel", | ||
"openAIAPIHost", | ||
"ignoreQoS0Message" | ||
) | ||
SELECT "id", | ||
"width", | ||
"height", | ||
"autoCheck", | ||
"currentLang", | ||
"currentTheme", | ||
"maxReconnectTimes", | ||
"autoResub", | ||
"syncOsTheme", | ||
"multiTopics", | ||
"jsonHighlight", | ||
"openAIAPIKey", | ||
"model", | ||
"enableCopilot", | ||
"logLevel", | ||
"openAIAPIHost", | ||
"ignoreQoS0Message" | ||
FROM "SettingEntity" | ||
`) | ||
await queryRunner.query(` | ||
DROP TABLE "SettingEntity" | ||
`) | ||
await queryRunner.query(` | ||
ALTER TABLE "temporary_SettingEntity" | ||
RENAME TO "SettingEntity" | ||
`) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
ALTER TABLE "SettingEntity" | ||
RENAME TO "temporary_SettingEntity" | ||
`) | ||
await queryRunner.query(` | ||
CREATE TABLE "SettingEntity" ( | ||
"id" varchar PRIMARY KEY NOT NULL, | ||
"width" integer NOT NULL DEFAULT (1025), | ||
"height" integer NOT NULL DEFAULT (749), | ||
"autoCheck" boolean NOT NULL DEFAULT (1), | ||
"currentLang" varchar CHECK(currentLang IN ('zh', 'en', 'ja', 'tr', 'hu')) NOT NULL DEFAULT ('en'), | ||
"currentTheme" varchar CHECK(currentTheme IN ('light', 'dark', 'night')) NOT NULL DEFAULT ('light'), | ||
"maxReconnectTimes" integer NOT NULL DEFAULT (10), | ||
"autoResub" boolean NOT NULL DEFAULT (1), | ||
"syncOsTheme" boolean NOT NULL DEFAULT (0), | ||
"multiTopics" boolean NOT NULL DEFAULT (1), | ||
"jsonHighlight" boolean NOT NULL DEFAULT (1), | ||
"openAIAPIKey" varchar NOT NULL DEFAULT (''), | ||
"model" varchar NOT NULL DEFAULT ('gpt-3.5-turbo'), | ||
"enableCopilot" boolean NOT NULL DEFAULT (1), | ||
"logLevel" varchar CHECK(logLevel IN ('debug', 'info', 'warn', 'error')) NOT NULL DEFAULT ('info'), | ||
"openAIAPIHost" varchar NOT NULL DEFAULT ('https://api.openai.com/v1'), | ||
"ignoreQoS0Message" boolean NOT NULL DEFAULT (0) | ||
) | ||
`) | ||
await queryRunner.query(` | ||
INSERT INTO "SettingEntity"( | ||
"id", | ||
"width", | ||
"height", | ||
"autoCheck", | ||
"currentLang", | ||
"currentTheme", | ||
"maxReconnectTimes", | ||
"autoResub", | ||
"syncOsTheme", | ||
"multiTopics", | ||
"jsonHighlight", | ||
"openAIAPIKey", | ||
"model", | ||
"enableCopilot", | ||
"logLevel", | ||
"openAIAPIHost", | ||
"ignoreQoS0Message" | ||
) | ||
SELECT "id", | ||
"width", | ||
"height", | ||
"autoCheck", | ||
"currentLang", | ||
"currentTheme", | ||
"maxReconnectTimes", | ||
"autoResub", | ||
"syncOsTheme", | ||
"multiTopics", | ||
"jsonHighlight", | ||
"openAIAPIKey", | ||
"model", | ||
"enableCopilot", | ||
"logLevel", | ||
"openAIAPIHost", | ||
"ignoreQoS0Message" | ||
FROM "temporary_SettingEntity" | ||
`) | ||
await queryRunner.query(` | ||
DROP TABLE "temporary_SettingEntity" | ||
`) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters