Skip to content

Commit e4f110e

Browse files
committed
♻️ refactor: refactor the server config to migrate model provider env
1 parent 1ff1aef commit e4f110e

File tree

2 files changed

+6
-93
lines changed

2 files changed

+6
-93
lines changed

src/app/api/config/__snapshots__/route.test.ts.snap

+5-92
Original file line numberDiff line numberDiff line change
@@ -110,104 +110,17 @@ exports[`GET /api/config > Model Provider env > OPENAI_MODEL_LIST > should work
110110
exports[`GET /api/config > Model Provider env > OPENROUTER_MODEL_LIST > custom deletion, addition, and renaming of models 1`] = `
111111
[
112112
{
113-
"description": "GPT 3.5 Turbo,适用于各种文本生成和理解任务",
114-
"displayName": "GPT-3.5 Turbo",
113+
"displayName": "google/gemma-7b-it",
115114
"enabled": true,
116115
"functionCall": true,
117-
"id": "gpt-3.5-turbo",
118-
"tokens": 16385,
119-
},
120-
{
121-
"displayName": "GPT-3.5 Turbo (0125)",
122-
"functionCall": true,
123-
"id": "gpt-3.5-turbo-0125",
124-
"tokens": 16385,
125-
},
126-
{
127-
"displayName": "GPT-3.5 Turbo (1106)",
128-
"functionCall": true,
129-
"id": "gpt-3.5-turbo-1106",
130-
"tokens": 16385,
131-
},
132-
{
133-
"displayName": "GPT-3.5 Turbo Instruct",
134-
"id": "gpt-3.5-turbo-instruct",
135-
"tokens": 4096,
136-
},
137-
{
138-
"displayName": "GPT-3.5 Turbo 16K",
139-
"id": "gpt-3.5-turbo-16k",
140-
"tokens": 16385,
141-
},
142-
{
143-
"displayName": "GPT-3.5 Turbo (0613)",
144-
"id": "gpt-3.5-turbo-0613",
145-
"legacy": true,
146-
"tokens": 4096,
147-
},
148-
{
149-
"displayName": "GPT-3.5 Turbo 16K (0613)",
150-
"id": "gpt-3.5-turbo-16k-0613",
151-
"legacy": true,
152-
"tokens": 4096,
153-
},
154-
{
155-
"displayName": "GPT-4 Turbo Preview",
156-
"enabled": true,
157-
"functionCall": true,
158-
"id": "gpt-4-turbo-preview",
159-
"tokens": 128000,
160-
},
161-
{
162-
"displayName": "GPT-4 Turbo Preview (0125)",
163-
"functionCall": true,
164-
"id": "gpt-4-0125-preview",
165-
"tokens": 128000,
166-
},
167-
{
168-
"description": "GPT-4 视觉预览版,支持视觉任务",
169-
"displayName": "GPT-4 Turbo Vision Preview",
170-
"enabled": true,
171-
"id": "gpt-4-vision-preview",
172-
"tokens": 128000,
116+
"id": "google/gemma-7b-it",
173117
"vision": true,
174118
},
175119
{
176-
"displayName": "GPT-4 Turbo Preview (1106)",
177-
"functionCall": true,
178-
"id": "gpt-4-1106-preview",
179-
"tokens": 128000,
180-
},
181-
{
182-
"displayName": "GPT-4",
183-
"functionCall": true,
184-
"id": "gpt-4",
185-
"tokens": 8192,
186-
},
187-
{
188-
"displayName": "GPT-4 (0613)",
189-
"functionCall": true,
190-
"id": "gpt-4-0613",
191-
"tokens": 8192,
192-
},
193-
{
194-
"displayName": "GPT-4 32K",
195-
"functionCall": true,
196-
"id": "gpt-4-32k",
197-
"tokens": 32768,
198-
},
199-
{
200-
"displayName": "GPT-4 32K (0613)",
201-
"functionCall": true,
202-
"id": "gpt-4-32k-0613",
203-
"tokens": 32768,
204-
},
205-
{
206-
"displayName": "GPT-4 ALL",
207-
"files": true,
120+
"displayName": "Mistral-7B-Instruct",
121+
"enabled": true,
208122
"functionCall": true,
209-
"id": "gpt-4-all",
210-
"tokens": 32768,
123+
"id": "mistralai/mistral-7b-instruct",
211124
"vision": true,
212125
},
213126
]

src/app/api/config/route.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ describe('GET /api/config', () => {
161161
const res = await GET();
162162
const data: GlobalServerConfig = await res.json();
163163

164-
const result = data.languageModel?.openai?.serverModelCards;
164+
const result = data.languageModel?.openrouter?.serverModelCards;
165165

166166
expect(result).toMatchSnapshot();
167167

0 commit comments

Comments
 (0)