Skip to content

Commit 7d16ade

Browse files
committed
✨ feat: 支持 openai o1
1 parent c83f881 commit 7d16ade

File tree

3 files changed

+69
-135
lines changed

3 files changed

+69
-135
lines changed

package.json

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -64,105 +64,105 @@
6464
]
6565
},
6666
"dependencies": {
67-
"@ant-design/icons": "^5.3.7",
68-
"@aws-sdk/client-s3": "^3.600.0",
69-
"@aws-sdk/s3-request-presigner": "^3.600.0",
70-
"@gltf-transform/core": "^4.0.2",
71-
"@icons-pack/react-simple-icons": "^9.6.0",
72-
"@lobehub/i18n-cli": "^1.18.1",
73-
"@lobehub/icons": "^1.24.0",
74-
"@lobehub/tts": "^1.24.2",
75-
"@lobehub/ui": "^1.146.8",
67+
"@ant-design/icons": "^5.5.1",
68+
"@aws-sdk/client-s3": "^3.654.0",
69+
"@aws-sdk/s3-request-presigner": "^3.654.0",
70+
"@gltf-transform/core": "^4.0.8",
71+
"@icons-pack/react-simple-icons": "^9.7.0",
72+
"@lobehub/i18n-cli": "^1.20.0",
73+
"@lobehub/icons": "^1.34.0",
74+
"@lobehub/tts": "^1.25.1",
75+
"@lobehub/ui": "^1.151.0",
7676
"@pixiv/three-vrm": "2.1.2",
7777
"@pixiv/three-vrm-core": "2.1.2",
78-
"@react-spring/web": "^9.7.3",
78+
"@react-spring/web": "^9.7.4",
7979
"@trpc/client": "next",
8080
"@trpc/next": "next",
8181
"@trpc/server": "next",
8282
"@types/react-speech-recognition": "^3.9.5",
8383
"@vercel/analytics": "^1.3.1",
84-
"ahooks": "^3.8.0",
84+
"ahooks": "^3.8.1",
8585
"ai": "^2.2.37",
8686
"antd": "~5.18.3",
87-
"antd-style": "^3.6.2",
88-
"axios": "^1.7.2",
87+
"antd-style": "^3.6.3",
88+
"axios": "^1.7.7",
8989
"buffer": "^6.0.3",
9090
"classnames": "^2.5.1",
91-
"dayjs": "^1.11.11",
91+
"dayjs": "^1.11.13",
9292
"fast-deep-equal": "^3.1.3",
93-
"i18next": "^23.11.5",
93+
"i18next": "^23.15.1",
9494
"i18next-browser-languagedetector": "^7.2.1",
9595
"i18next-resources-to-backend": "^1.2.1",
9696
"immer": "^10.1.1",
97-
"js-tiktoken": "^1.0.12",
97+
"js-tiktoken": "^1.0.14",
9898
"localforage": "^1.10.0",
9999
"lodash-es": "^4.17.21",
100100
"lucide-react": "^0.395.0",
101-
"mime": "^4.0.3",
101+
"mime": "^4.0.4",
102102
"mmd-parser": "^1.0.4",
103103
"modern-screenshot": "^4.4.39",
104104
"nanoid": "^5.0.7",
105-
"next": "^14.2.4",
105+
"next": "^14.2.13",
106106
"next-pwa": "^5.6.0",
107107
"numeral": "^2.0.6",
108-
"openai": "^4.52.1",
109-
"pino": "^9.2.0",
108+
"openai": "^4.63.0",
109+
"pino": "^9.4.0",
110110
"polished": "^4.3.1",
111-
"query-string": "^9.0.0",
111+
"query-string": "^9.1.0",
112112
"react": "^18.3.1",
113113
"react-dom": "^18.3.1",
114114
"react-i18next": "14.0.2",
115-
"react-intersection-observer": "^9.10.3",
115+
"react-intersection-observer": "^9.13.1",
116116
"react-layout-kit": "^1.9.0",
117117
"react-lazy-load": "^4.0.1",
118-
"react-virtuoso": "^4.7.11",
118+
"react-virtuoso": "^4.10.4",
119119
"remark": "^15.0.1",
120120
"remark-gfm": "^3.0.1",
121121
"remark-html": "^16.0.1",
122-
"resolve-accept-language": "^3.1.4",
122+
"resolve-accept-language": "^3.1.7",
123123
"superjson": "^2.2.1",
124124
"swr": "^2.2.5",
125125
"three": "0.164.1",
126-
"ua-parser-js": "^1.0.38",
126+
"ua-parser-js": "^1.0.39",
127127
"url-join": "^5.0.0",
128128
"utility-types": "^3.11.0",
129129
"uuid": "^10.0.0",
130-
"ws": "^8.17.1",
130+
"ws": "^8.18.0",
131131
"zod": "^3.23.8",
132-
"zustand": "^4.5.4"
132+
"zustand": "^4.5.5"
133133
},
134134
"devDependencies": {
135-
"@commitlint/cli": "^19.3.0",
136-
"@ducanh2912/next-pwa": "^10.2.7",
137-
"@lobehub/lint": "^1.23.4",
138-
"@next/bundle-analyzer": "^14.2.4",
139-
"@next/eslint-plugin-next": "^14.2.4",
135+
"@commitlint/cli": "^19.5.0",
136+
"@ducanh2912/next-pwa": "^10.2.9",
137+
"@lobehub/lint": "^1.24.4",
138+
"@next/bundle-analyzer": "^14.2.13",
139+
"@next/eslint-plugin-next": "^14.2.13",
140140
"@peculiar/webcrypto": "^1.5.0",
141-
"@testing-library/jest-dom": "^6.4.6",
142-
"@testing-library/react": "^16.0.0",
141+
"@testing-library/jest-dom": "^6.5.0",
142+
"@testing-library/react": "^16.0.1",
143143
"@types/lodash-es": "^4.17.12",
144144
"@types/node": "20.14.2",
145145
"@types/numeral": "^2.0.5",
146-
"@types/react": "^18.3.3",
146+
"@types/react": "^18.3.8",
147147
"@types/react-dom": "^18.3.0",
148148
"@types/three": "^0.165.0",
149149
"@types/ua-parser-js": "^0.7.39",
150150
"@types/uuid": "^10.0.0",
151-
"commitlint": "^19.3.0",
151+
"commitlint": "^19.5.0",
152152
"consola": "^3.2.3",
153153
"dpdm": "^3.14.0",
154-
"eslint": "^8.57.0",
155-
"glob": "^10.4.2",
156-
"husky": "^9.0.11",
157-
"jsdom": "^24.1.0",
154+
"eslint": "^8.57.1",
155+
"glob": "^10.4.5",
156+
"husky": "^9.1.6",
157+
"jsdom": "^24.1.3",
158158
"just-diff": "^6.0.2",
159-
"lint-staged": "^15.2.5",
160-
"prettier": "^3.2.5",
159+
"lint-staged": "^15.2.10",
160+
"prettier": "^3.3.3",
161161
"semantic-release": "^21.1.2",
162162
"stylelint": "^15.11.0",
163-
"tsx": "^4.15.7",
164-
"typescript": "^5.5.2",
165-
"vite": "^5.3.1",
163+
"tsx": "^4.19.1",
164+
"typescript": "^5.6.2",
165+
"vite": "^5.4.7",
166166
"vitest": "~1.6.0",
167167
"vitest-canvas-mock": "^0.3.3"
168168
},

src/components/ModelIcon/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const ModelIcon = memo<ModelProviderIconProps>(({ model: originModel, size = 12
4646
// currently supported models, maybe not in its own provider
4747
if (model.includes('gpt-3')) return <OpenAI.Avatar size={size} type={'gpt3'} />;
4848
if (model.includes('gpt-4')) return <OpenAI.Avatar size={size} type={'gpt4'} />;
49+
if (model.includes('o1')) return <OpenAI.Avatar size={size} type={'o1'} />;
4950
if (model.startsWith('glm') || model.includes('chatglm')) return <ChatGLM.Avatar size={size} />;
5051
if (model.includes('deepseek')) return <DeepSeek.Avatar size={size} />;
5152
if (model.includes('claude')) return <Claude.Avatar size={size} />;

src/constants/openai.ts

Lines changed: 23 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ export const OPENAI_END_POINT = 'x-openai-endpoint';
77
* OpenAI 模型列表
88
*/
99
export const OPENAI_MODEL_LIST: ChatModelCard[] = [
10+
{
11+
description: 'Currently points to o1-mini-2024-09-12',
12+
displayName: 'OpenAI o1-mini',
13+
enabled: true,
14+
id: 'o1-mini',
15+
maxOutput: 65_536,
16+
tokens: 128_000,
17+
},
18+
{
19+
description: 'Currently points to o1-preview-2024-09-12',
20+
displayName: 'OpenAI o1-preview',
21+
enabled: true,
22+
id: 'o1-preview',
23+
maxOutput: 32_768,
24+
tokens: 128_000,
25+
},
26+
1027
{
1128
description: 'Currently points to gpt-4o-mini-2024-07-18',
1229
displayName: 'GPT-4o mini',
@@ -17,126 +34,42 @@ export const OPENAI_MODEL_LIST: ChatModelCard[] = [
1734
tokens: 128_000,
1835
vision: true,
1936
},
37+
2038
{
2139
description: 'Currently points to gpt-4o-2024-05-13',
2240
displayName: 'GPT-4o',
2341
enabled: true,
2442
functionCall: true,
43+
maxOutput: 4096,
2544
id: 'gpt-4o',
2645
tokens: 128_000,
2746
vision: true,
2847
},
29-
{
30-
description: 'GPT-4 Turbo with Vision',
31-
displayName: 'GPT-4 Turbo',
32-
enabled: true,
33-
functionCall: true,
34-
id: 'gpt-4-turbo',
35-
tokens: 128_000,
36-
vision: true,
37-
},
3848
{
3949
description: 'GPT-4 Turbo 视觉版 (240409)',
4050
displayName: 'GPT-4 Turbo Vision (240409)',
4151
functionCall: true,
4252
id: 'gpt-4-turbo-2024-04-09',
53+
maxOutput: 4096,
4354
tokens: 128_000,
4455
vision: true,
4556
},
46-
{
47-
description: 'Currently points to gpt-4-0125-preview',
48-
displayName: 'GPT-4 Turbo Preview',
49-
functionCall: true,
50-
id: 'gpt-4-turbo-preview',
51-
tokens: 128_000,
52-
},
53-
{
54-
displayName: 'GPT-4 Turbo Preview (0125)',
55-
functionCall: true,
56-
id: 'gpt-4-0125-preview',
57-
tokens: 128_000,
58-
},
59-
{
60-
description: 'Currently points to gpt-4-1106-vision-preview', // Will be discontinued on December 6, 2024
61-
displayName: 'GPT-4 Turbo Vision Preview',
62-
id: 'gpt-4-vision-preview',
63-
tokens: 128_000,
64-
vision: true,
65-
},
66-
{
67-
displayName: 'GPT-4 Turbo Vision Preview (1106)', // Will be discontinued on December 6, 2024
68-
id: 'gpt-4-1106-vision-preview',
69-
tokens: 128_000,
70-
vision: true,
71-
},
72-
{
73-
displayName: 'GPT-4 Turbo Preview (1106)',
74-
functionCall: true,
75-
id: 'gpt-4-1106-preview',
76-
tokens: 128_000,
77-
},
57+
7858
{
7959
description: 'Currently points to gpt-4-0613',
8060
displayName: 'GPT-4',
8161
functionCall: true,
8262
id: 'gpt-4',
63+
maxOutput: 8192,
8364
tokens: 8192,
8465
},
85-
{
86-
displayName: 'GPT-4 (0613)',
87-
functionCall: true,
88-
id: 'gpt-4-0613',
89-
tokens: 8192,
90-
},
91-
{
92-
description: 'Currently points to gpt-4-32k-0613', // Will be discontinued on June 6, 2025
93-
displayName: 'GPT-4 32K',
94-
functionCall: true,
95-
id: 'gpt-4-32k',
96-
tokens: 32_768,
97-
},
98-
{
99-
displayName: 'GPT-4 32K (0613)', // Will be discontinued on June 6, 2025
100-
functionCall: true,
101-
id: 'gpt-4-32k-0613',
102-
tokens: 32_768,
103-
},
10466
{
10567
description:
10668
'GPT 3.5 Turbo,适用于各种文本生成和理解任务,Currently points to gpt-3.5-turbo-0125',
10769
displayName: 'GPT-3.5 Turbo',
10870
functionCall: true,
71+
maxOutput: 4096,
10972
id: 'gpt-3.5-turbo',
11073
tokens: 16_385,
11174
},
112-
{
113-
displayName: 'GPT-3.5 Turbo (0125)',
114-
functionCall: true,
115-
id: 'gpt-3.5-turbo-0125',
116-
tokens: 16_385,
117-
},
118-
{
119-
displayName: 'GPT-3.5 Turbo (1106)',
120-
functionCall: true,
121-
id: 'gpt-3.5-turbo-1106',
122-
tokens: 16_385,
123-
},
124-
{
125-
displayName: 'GPT-3.5 Turbo Instruct',
126-
id: 'gpt-3.5-turbo-instruct',
127-
tokens: 4096,
128-
},
129-
{
130-
description: 'Currently points to gpt-3.5-turbo-16k-0613', // Will be discontinued on September 13, 2024
131-
displayName: 'GPT-3.5 Turbo 16K',
132-
id: 'gpt-3.5-turbo-16k',
133-
legacy: true,
134-
tokens: 16_385,
135-
},
136-
{
137-
displayName: 'GPT-3.5 Turbo (0613)', // Will be discontinued on September 13, 2024
138-
id: 'gpt-3.5-turbo-0613',
139-
legacy: true,
140-
tokens: 4096,
141-
},
14275
];

0 commit comments

Comments
 (0)