Skip to content

Commit adcce07

Browse files
committed
💄 style: improve detail design
1 parent 4a305e9 commit adcce07

File tree

3 files changed

+19
-37
lines changed

3 files changed

+19
-37
lines changed

src/app/settings/llm/TogetherAI/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const TogetherAIProvider = memo(() => {
1010
return (
1111
<ProviderConfig
1212
checkModel={'togethercomputer/alpaca-7b'}
13-
modelList={{ showModelFetcher: true }}
1413
provider={'togetherai'}
1514
title={
1615
<Together.Combine

src/libs/agent-runtime/openai/__snapshots__/index.test.ts.snap

-36
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
exports[`LobeOpenAI > models > should get models 1`] = `
44
[
5-
{
6-
"id": "whisper-1",
7-
},
8-
{
9-
"id": "davinci-002",
10-
},
115
{
126
"description": "GPT 3.5 Turbo,适用于各种文本生成和理解任务",
137
"displayName": "GPT-3.5 Turbo",
@@ -16,29 +10,17 @@ exports[`LobeOpenAI > models > should get models 1`] = `
1610
"id": "gpt-3.5-turbo",
1711
"tokens": 16385,
1812
},
19-
{
20-
"id": "dall-e-2",
21-
},
2213
{
2314
"displayName": "GPT-3.5 Turbo 16K",
2415
"id": "gpt-3.5-turbo-16k",
2516
"tokens": 16385,
2617
},
27-
{
28-
"id": "tts-1-hd-1106",
29-
},
30-
{
31-
"id": "tts-1-hd",
32-
},
3318
{
3419
"displayName": "GPT-3.5 Turbo 16K (0613)",
3520
"id": "gpt-3.5-turbo-16k-0613",
3621
"legacy": true,
3722
"tokens": 4096,
3823
},
39-
{
40-
"id": "text-embedding-3-large",
41-
},
4224
{
4325
"displayName": "GPT-4 Turbo Vision Preview (1106)",
4426
"id": "gpt-4-1106-vision-preview",
@@ -75,12 +57,6 @@ exports[`LobeOpenAI > models > should get models 1`] = `
7557
"legacy": true,
7658
"tokens": 4096,
7759
},
78-
{
79-
"id": "tts-1",
80-
},
81-
{
82-
"id": "dall-e-3",
83-
},
8460
{
8561
"displayName": "GPT-3.5 Turbo (1106)",
8662
"functionCall": true,
@@ -93,12 +69,6 @@ exports[`LobeOpenAI > models > should get models 1`] = `
9369
"id": "gpt-4-1106-preview",
9470
"tokens": 128000,
9571
},
96-
{
97-
"id": "babbage-002",
98-
},
99-
{
100-
"id": "tts-1-1106",
101-
},
10272
{
10373
"description": "GPT-4 视觉预览版,支持视觉任务",
10474
"displayName": "GPT-4 Turbo Vision Preview",
@@ -107,18 +77,12 @@ exports[`LobeOpenAI > models > should get models 1`] = `
10777
"tokens": 128000,
10878
"vision": true,
10979
},
110-
{
111-
"id": "text-embedding-3-small",
112-
},
11380
{
11481
"displayName": "GPT-4",
11582
"functionCall": true,
11683
"id": "gpt-4",
11784
"tokens": 8192,
11885
},
119-
{
120-
"id": "text-embedding-ada-002",
121-
},
12286
{
12387
"displayName": "GPT-3.5 Turbo (0125)",
12488
"functionCall": true,

src/libs/agent-runtime/utils/openaiCompatibleFactory/index.ts

+19
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ import { debugStream } from '../debugStream';
1212
import { desensitizeUrl } from '../desensitizeUrl';
1313
import { handleOpenAIError } from '../handleOpenAIError';
1414

15+
// the model contains the following keywords is not a chat model, so we should filter them out
16+
const CHAT_MODELS_BLOCK_LIST = [
17+
'embedding',
18+
'davinci',
19+
'cuire',
20+
'moderation',
21+
'ada',
22+
'babbage',
23+
'tts',
24+
'whisper',
25+
'dall-e',
26+
];
27+
1528
interface OpenAICompatibleFactoryOptions {
1629
baseURL?: string;
1730
chatCompletion?: {
@@ -112,6 +125,11 @@ export const LobeOpenAICompatibleFactory = ({
112125
const list = await this.client.models.list();
113126

114127
return list.data
128+
.filter((model) => {
129+
return CHAT_MODELS_BLOCK_LIST.every(
130+
(keyword) => !model.id.toLowerCase().includes(keyword),
131+
);
132+
})
115133
.map((item) => {
116134
if (models?.transformModel) {
117135
return models.transformModel(item);
@@ -123,6 +141,7 @@ export const LobeOpenAICompatibleFactory = ({
123141

124142
return { id: item.id };
125143
})
144+
126145
.filter(Boolean) as ChatModelCard[];
127146
}
128147
};

0 commit comments

Comments
 (0)