mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 03:30:19 +00:00
✨ feat: support latest openai model (#417)
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@
|
||||
"modern-screenshot": "^4",
|
||||
"nanoid": "^5",
|
||||
"next": "^13.5.3",
|
||||
"openai": "^4.10.0",
|
||||
"openai": "~4.15.0",
|
||||
"polished": "^4",
|
||||
"posthog-js": "^1",
|
||||
"query-string": "^8",
|
||||
|
||||
+3
-6
@@ -1,3 +1,5 @@
|
||||
import { LanguageModel } from '@/types/llm';
|
||||
|
||||
/**
|
||||
* A white list of language models that are allowed to display and be used in the app.
|
||||
*/
|
||||
@@ -9,9 +11,4 @@ export const LanguageModelWhiteList = [
|
||||
'gpt-4-32k',
|
||||
];
|
||||
|
||||
export const DEFAULT_OPENAI_MODEL_LIST = [
|
||||
'gpt-3.5-turbo',
|
||||
'gpt-3.5-turbo-16k',
|
||||
'gpt-4',
|
||||
'gpt-4-32k',
|
||||
];
|
||||
export const DEFAULT_OPENAI_MODEL_LIST: string[] = Object.values(LanguageModel);
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import { LanguageModel } from '@/types/llm';
|
||||
|
||||
// refs to: https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
|
||||
export const ModelTokens: Record<LanguageModel, number> = {
|
||||
[LanguageModel.GPT3_5]: 4096,
|
||||
[LanguageModel.GPT3_5_16K]: 4096 * 4,
|
||||
[LanguageModel.GPT3_5_1106]: 16_385,
|
||||
[LanguageModel.GPT3_5_16K]: 16_385,
|
||||
[LanguageModel.GPT4]: 8196,
|
||||
[LanguageModel.GPT4_32K]: 8196 * 4,
|
||||
[LanguageModel.GPT4_PREVIEW]: 128_000,
|
||||
[LanguageModel.GPT4_VISION_PREVIEW]: 128_000,
|
||||
[LanguageModel.GPT4_32K]: 32_768,
|
||||
};
|
||||
|
||||
@@ -6,12 +6,15 @@ export enum LanguageModel {
|
||||
* GPT 3.5 Turbo
|
||||
*/
|
||||
GPT3_5 = 'gpt-3.5-turbo',
|
||||
GPT3_5_1106 = 'gpt-3.5-turbo-1106',
|
||||
GPT3_5_16K = 'gpt-3.5-turbo-16k',
|
||||
/**
|
||||
* GPT 4
|
||||
*/
|
||||
GPT4 = 'gpt-4',
|
||||
GPT4_32K = 'gpt-4-32k',
|
||||
GPT4_PREVIEW = 'gpt-4-1106-preview',
|
||||
GPT4_VISION_PREVIEW = 'gpt-4-vision-preview',
|
||||
}
|
||||
|
||||
// 语言模型的设置参数
|
||||
|
||||
Reference in New Issue
Block a user