@lobehub/chat 1.134.1 → 1.134.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,7 @@ jobs:
30
30
 
31
31
  steps:
32
32
  - name: Checkout repository
33
- uses: actions/checkout@v4
33
+ uses: actions/checkout@v5
34
34
  with:
35
35
  fetch-depth: 1
36
36
 
@@ -16,7 +16,7 @@ jobs:
16
16
  runs-on: ubuntu-latest
17
17
  steps:
18
18
  - name: Checkout repository
19
- uses: actions/checkout@v4
19
+ uses: actions/checkout@v5
20
20
 
21
21
  - name: Lock closed issues after 7 days of inactivity
22
22
  uses: actions/github-script@v7
@@ -45,7 +45,7 @@ jobs:
45
45
  run: bun run --filter @lobechat/${{ matrix.package }} test:coverage
46
46
 
47
47
  - name: Upload ${{ matrix.package }} coverage to Codecov
48
- uses: codecov/codecov-action@v4
48
+ uses: codecov/codecov-action@v5
49
49
  with:
50
50
  token: ${{ secrets.CODECOV_TOKEN }}
51
51
  files: ./packages/${{ matrix.package }}/coverage/lcov.info
@@ -80,7 +80,7 @@ jobs:
80
80
  run: bun run --filter ${{ matrix.package }} test:coverage
81
81
 
82
82
  - name: Upload ${{ matrix.package }} coverage to Codecov
83
- uses: codecov/codecov-action@v4
83
+ uses: codecov/codecov-action@v5
84
84
  with:
85
85
  token: ${{ secrets.CODECOV_TOKEN }}
86
86
  files: ./packages/${{ matrix.package }}/coverage/lcov.info
@@ -113,7 +113,7 @@ jobs:
113
113
  run: bun run test-app:coverage
114
114
 
115
115
  - name: Upload App Coverage to Codecov
116
- uses: codecov/codecov-action@v4
116
+ uses: codecov/codecov-action@v5
117
117
  with:
118
118
  token: ${{ secrets.CODECOV_TOKEN }}
119
119
  files: ./coverage/app/lcov.info
@@ -174,7 +174,7 @@ jobs:
174
174
  APP_URL: https://home.com
175
175
 
176
176
  - name: Upload Database coverage to Codecov
177
- uses: codecov/codecov-action@v4
177
+ uses: codecov/codecov-action@v5
178
178
  with:
179
179
  token: ${{ secrets.CODECOV_TOKEN }}
180
180
  files: ./packages/database/coverage/lcov.info
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.134.2](https://github.com/lobehub/lobe-chat/compare/v1.134.1...v1.134.2)
6
+
7
+ <sup>Released on **2025-10-05**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Allow switching model `type`.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Allow switching model `type`, closes [#9529](https://github.com/lobehub/lobe-chat/issues/9529) ([9b62685](https://github.com/lobehub/lobe-chat/commit/9b62685))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 1.134.1](https://github.com/lobehub/lobe-chat/compare/v1.134.0...v1.134.1)
6
31
 
7
32
  <sup>Released on **2025-10-05**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Allow switching model type."
6
+ ]
7
+ },
8
+ "date": "2025-10-05",
9
+ "version": "1.134.2"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "improvements": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.134.1",
3
+ "version": "1.134.2",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -128,7 +128,7 @@ export class AiInfraRepos {
128
128
  providerId: provider.id,
129
129
  settings: item.settings,
130
130
  sort: user.sort || undefined,
131
- type: item.type,
131
+ type: user.type || item.type,
132
132
  };
133
133
  })
134
134
  .filter((item) => (filterEnabled ? item.enabled : true));
@@ -327,6 +327,7 @@ export const CreateAiModelSchema = z.object({
327
327
  id: z.string(),
328
328
  providerId: z.string(),
329
329
  releasedAt: z.string().optional(),
330
+ type: AiModelTypeSchema.optional(),
330
331
 
331
332
  // checkModel: z.string().optional(),
332
333
  // homeUrl: z.string().optional(),
@@ -362,6 +363,7 @@ export const UpdateAiModelSchema = z.object({
362
363
  .optional(),
363
364
  contextWindowTokens: z.number().nullable().optional(),
364
365
  displayName: z.string().nullable().optional(),
366
+ type: AiModelTypeSchema.optional(),
365
367
  });
366
368
 
367
369
  export type UpdateAiModelParams = z.infer<typeof UpdateAiModelSchema>;
@@ -1,13 +1,14 @@
1
1
  import { Input } from '@lobehub/ui';
2
- import { Checkbox, Form, FormInstance } from 'antd';
3
- import { memo, useEffect } from 'react';
2
+ import { Checkbox, Form, FormInstance, Select } from 'antd';
3
+ import { memo, useEffect, useMemo } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
 
6
6
  import MaxTokenSlider from '@/components/MaxTokenSlider';
7
7
  import { useIsMobile } from '@/hooks/useIsMobile';
8
- import { AiModelType } from '../../../../../../../../../packages/model-bank/src/types/aiModel';
9
8
  import { ChatModelCard } from '@/types/llm';
10
9
 
10
+ import { AiModelType } from '../../../../../../../../../packages/model-bank/src/types/aiModel';
11
+
11
12
  interface ModelConfigFormProps {
12
13
  idEditable?: boolean;
13
14
  initialValues?: ChatModelCard;
@@ -24,6 +25,30 @@ const ModelConfigForm = memo<ModelConfigFormProps>(
24
25
 
25
26
  const isMobile = useIsMobile();
26
27
 
28
+ const modelTypeOptions = useMemo(
29
+ () =>
30
+ (
31
+ [
32
+ 'chat',
33
+ 'embedding',
34
+ 'tts',
35
+ 'stt',
36
+ 'image',
37
+ // 'text2video',
38
+ // 'text2music',
39
+ 'realtime',
40
+ ] as AiModelType[]
41
+ ).map((value) => {
42
+ const label = t(`providerModels.item.modelConfig.type.options.${value}`);
43
+
44
+ return {
45
+ label: label !== value ? `${label} (${value})` : label,
46
+ value,
47
+ };
48
+ }),
49
+ [t],
50
+ );
51
+
27
52
  useEffect(() => {
28
53
  onFormInstanceReady(formInstance);
29
54
  }, []);
@@ -102,6 +127,16 @@ const ModelConfigForm = memo<ModelConfigFormProps>(
102
127
  >
103
128
  <Checkbox />
104
129
  </Form.Item>
130
+ <Form.Item
131
+ extra={t('providerModels.item.modelConfig.type.extra')}
132
+ label={t('providerModels.item.modelConfig.type.title')}
133
+ name={'type'}
134
+ >
135
+ <Select
136
+ options={modelTypeOptions}
137
+ placeholder={t('providerModels.item.modelConfig.type.placeholder')}
138
+ />
139
+ </Form.Item>
105
140
  {/*<Form.Item*/}
106
141
  {/* extra={t('providerModels.item.modelConfig.files.extra')}*/}
107
142
  {/* label={t('providerModels.item.modelConfig.files.title')}*/}
@@ -299,6 +299,21 @@ export default {
299
299
  title: '最大上下文窗口',
300
300
  unlimited: '无限制',
301
301
  },
302
+ type: {
303
+ extra: '不同模型类型拥有差异化的使用场景与能力',
304
+ options: {
305
+ chat: '对话',
306
+ embedding: '向量化',
307
+ image: '图片生成',
308
+ realtime: '实时对话',
309
+ stt: '语音转文本',
310
+ text2music: '文本转音乐',
311
+ text2video: '文本转视频',
312
+ tts: '语音合成',
313
+ },
314
+ placeholder: '请选择模型类型',
315
+ title: '模型类型',
316
+ },
302
317
  vision: {
303
318
  extra:
304
319
  '此配置将仅开启应用中的图片上传配置,是否支持识别完全取决于模型本身,请自行测试该模型的视觉识别能力可用性',
@@ -160,7 +160,10 @@ export const createAiProviderSlice: StateCreator<
160
160
  await get().refreshAiProviderRuntimeState();
161
161
  },
162
162
  refreshAiProviderRuntimeState: async () => {
163
- await mutate([AiProviderSwrKey.fetchAiProviderRuntimeState, true]);
163
+ await Promise.all([
164
+ mutate([AiProviderSwrKey.fetchAiProviderRuntimeState, true]),
165
+ mutate([AiProviderSwrKey.fetchAiProviderRuntimeState, false]),
166
+ ]);
164
167
  },
165
168
  removeAiProvider: async (id) => {
166
169
  await aiProviderService.deleteAiProvider(id);