Skip to content

Commit

Permalink
♻️ refactor: refactor the server config to migrate model provider env
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Apr 10, 2024
1 parent 1ff1aef commit e4f110e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 93 deletions.
97 changes: 5 additions & 92 deletions src/app/api/config/__snapshots__/route.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -110,104 +110,17 @@ exports[`GET /api/config > Model Provider env > OPENAI_MODEL_LIST > should work
exports[`GET /api/config > Model Provider env > OPENROUTER_MODEL_LIST > custom deletion, addition, and renaming of models 1`] = `
[
{
"description": "GPT 3.5 Turbo,适用于各种文本生成和理解任务",
"displayName": "GPT-3.5 Turbo",
"displayName": "google/gemma-7b-it",
"enabled": true,
"functionCall": true,
"id": "gpt-3.5-turbo",
"tokens": 16385,
},
{
"displayName": "GPT-3.5 Turbo (0125)",
"functionCall": true,
"id": "gpt-3.5-turbo-0125",
"tokens": 16385,
},
{
"displayName": "GPT-3.5 Turbo (1106)",
"functionCall": true,
"id": "gpt-3.5-turbo-1106",
"tokens": 16385,
},
{
"displayName": "GPT-3.5 Turbo Instruct",
"id": "gpt-3.5-turbo-instruct",
"tokens": 4096,
},
{
"displayName": "GPT-3.5 Turbo 16K",
"id": "gpt-3.5-turbo-16k",
"tokens": 16385,
},
{
"displayName": "GPT-3.5 Turbo (0613)",
"id": "gpt-3.5-turbo-0613",
"legacy": true,
"tokens": 4096,
},
{
"displayName": "GPT-3.5 Turbo 16K (0613)",
"id": "gpt-3.5-turbo-16k-0613",
"legacy": true,
"tokens": 4096,
},
{
"displayName": "GPT-4 Turbo Preview",
"enabled": true,
"functionCall": true,
"id": "gpt-4-turbo-preview",
"tokens": 128000,
},
{
"displayName": "GPT-4 Turbo Preview (0125)",
"functionCall": true,
"id": "gpt-4-0125-preview",
"tokens": 128000,
},
{
"description": "GPT-4 视觉预览版,支持视觉任务",
"displayName": "GPT-4 Turbo Vision Preview",
"enabled": true,
"id": "gpt-4-vision-preview",
"tokens": 128000,
"id": "google/gemma-7b-it",
"vision": true,
},
{
"displayName": "GPT-4 Turbo Preview (1106)",
"functionCall": true,
"id": "gpt-4-1106-preview",
"tokens": 128000,
},
{
"displayName": "GPT-4",
"functionCall": true,
"id": "gpt-4",
"tokens": 8192,
},
{
"displayName": "GPT-4 (0613)",
"functionCall": true,
"id": "gpt-4-0613",
"tokens": 8192,
},
{
"displayName": "GPT-4 32K",
"functionCall": true,
"id": "gpt-4-32k",
"tokens": 32768,
},
{
"displayName": "GPT-4 32K (0613)",
"functionCall": true,
"id": "gpt-4-32k-0613",
"tokens": 32768,
},
{
"displayName": "GPT-4 ALL",
"files": true,
"displayName": "Mistral-7B-Instruct",
"enabled": true,
"functionCall": true,
"id": "gpt-4-all",
"tokens": 32768,
"id": "mistralai/mistral-7b-instruct",
"vision": true,
},
]
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/config/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ describe('GET /api/config', () => {
const res = await GET();
const data: GlobalServerConfig = await res.json();

const result = data.languageModel?.openai?.serverModelCards;
const result = data.languageModel?.openrouter?.serverModelCards;

expect(result).toMatchSnapshot();

Expand Down

0 comments on commit e4f110e

Please sign in to comment.