-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gpt-runner-web): add third-party api providers and notification
- Loading branch information
1 parent
fcaf7af
commit 1ebc996
Showing
54 changed files
with
2,575 additions
and
651 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"recommendations": [ | ||
"jsynowiec.vscode-insertdatestring", | ||
"EditorConfig.EditorConfig", | ||
"dbaeumer.vscode-eslint" | ||
] | ||
} |
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
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,74 @@ | ||
import type { GetModelConfigType } from './config' | ||
import type { ChatModelType, LocaleLang, VendorTag } from './enum' | ||
|
||
export type MarkdownString = string | ||
|
||
export interface BaseConfig { | ||
/** | ||
* create time like 2023-04-23 12:34:56, for diff update | ||
*/ | ||
createAt: string | ||
} | ||
|
||
export interface ChangeLogConfig { | ||
/** | ||
* like 2023-04-23 12:34:56 | ||
*/ | ||
releaseDate: string | ||
version: string | ||
changes: MarkdownString | ||
} | ||
|
||
export interface ReleaseConfig extends BaseConfig { | ||
changeLogs: ChangeLogConfig[] | ||
} | ||
|
||
export interface NotificationConfig extends BaseConfig { | ||
title: string | ||
message: MarkdownString | ||
} | ||
|
||
export interface BaseApiVendor { | ||
vendorName: string | ||
vendorShortDescription?: string | ||
vendorOfficialUrl?: string | ||
vendorLogoUrl?: string | ||
vendorDescription?: MarkdownString | ||
vendorTags?: VendorTag[] | ||
} | ||
|
||
export type ModelApiVendor<T extends ChatModelType> = BaseApiVendor & { | ||
vendorSecrets?: GetModelConfigType<T, 'secrets'> | ||
} | ||
|
||
export type ModelTypeVendorsMap = { | ||
[Key in ChatModelType]?: ModelApiVendor<Key>[] | ||
} | ||
|
||
export interface VendorsConfig extends BaseConfig, ModelTypeVendorsMap { | ||
} | ||
|
||
export interface CommonAppConfig { | ||
notificationConfig: NotificationConfig | ||
releaseConfig: ReleaseConfig | ||
vendorsConfig: VendorsConfig | ||
} | ||
|
||
export type AppConfig = { | ||
common: CommonAppConfig | ||
} & { | ||
[K in LocaleLang]?: Partial<CommonAppConfig> | ||
} | ||
|
||
export interface CurrentAppConfig { | ||
showNotificationModal: boolean | ||
showReleaseModal: boolean | ||
currentConfig?: CommonAppConfig | ||
} | ||
|
||
export interface LastVisitModalDateRecord { | ||
notificationDate?: string | ||
releaseDate?: string | ||
} | ||
|
||
export type MarkedAsVisitedType = keyof LastVisitModalDateRecord |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './app-config' | ||
export * from './client' | ||
export * from './common-file' | ||
export * from './common' | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"common": { | ||
"notificationConfig": { | ||
"createAt": "2023-07-24 23:31:22", | ||
"title": "GPT Runner Notification", | ||
"message": "v1.2.0 is release" | ||
}, | ||
"releaseConfig": { | ||
"createAt": "2023-07-24 23:41:04", | ||
"changeLogs": [ | ||
{ | ||
"releaseDate": "2023-07-24 23:40:59", | ||
"version": "1.2.0", | ||
"changes": "fix some bug" | ||
} | ||
] | ||
}, | ||
"vendorsConfig": { | ||
"createAt": "2023-07-24 23:40:49", | ||
"openai": [], | ||
"anthropic": [] | ||
} | ||
}, | ||
"zh_CN": { | ||
"notificationConfig": { | ||
"createAt": "2023-07-24 23:31:26", | ||
"title": "GPT Runner 通知", | ||
"message": "\n### 版本更新到了 v1.2.0\n1. 重启 vscode 即可去扩展处更新\n2. cli 的执行 `npm i -g gptr` 即可更新\n\n### 本次功能更新\n1. 针对语言为简体中文的用户提供 OpenAI API key 供应商,也就是你可以白嫖了。\n2. 点击左上角设置,切换供应商即可。\n3. 本次 API Key 由慷慨大方的 `剑廿三` 提供,让我们把掌声送给他。\n\n### 交流\n1. 想进群交流的加 wechat: `qq2214962083`\n " | ||
}, | ||
"vendorsConfig": { | ||
"createAt": "2023-07-24 23:40:49", | ||
"openai": [ | ||
{ | ||
"vendorName": "xabcai", | ||
"vendorSecrets": { | ||
"basePath": "https://api.xabcai.com/v1", | ||
"apiKey": "c2stWHZQeGJQMVBySFduZDJFZ0xpa0lKTlQzOTNoc3pZdDdmN0NNZUozSE1pdkw2QVdx" | ||
} | ||
} | ||
], | ||
"anthropic": [] | ||
} | ||
} | ||
} |
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
Oops, something went wrong.