@lobehub/chat 1.50.5 → 1.51.1
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.
- package/CHANGELOG.md +51 -0
- package/changelog/v1.json +17 -0
- package/locales/ar/modelProvider.json +4 -0
- package/locales/bg-BG/modelProvider.json +4 -0
- package/locales/de-DE/modelProvider.json +4 -0
- package/locales/en-US/modelProvider.json +4 -0
- package/locales/es-ES/modelProvider.json +4 -0
- package/locales/fa-IR/modelProvider.json +4 -0
- package/locales/fr-FR/modelProvider.json +4 -0
- package/locales/it-IT/modelProvider.json +4 -0
- package/locales/ja-JP/modelProvider.json +4 -0
- package/locales/ko-KR/modelProvider.json +4 -0
- package/locales/nl-NL/modelProvider.json +4 -0
- package/locales/pl-PL/modelProvider.json +4 -0
- package/locales/pt-BR/modelProvider.json +4 -0
- package/locales/ru-RU/modelProvider.json +4 -0
- package/locales/tr-TR/modelProvider.json +4 -0
- package/locales/vi-VN/modelProvider.json +4 -0
- package/locales/zh-CN/modelProvider.json +4 -0
- package/locales/zh-TW/modelProvider.json +4 -0
- package/next.config.ts +6 -0
- package/package.json +1 -1
- package/src/app/(main)/_layout/Desktop/SideBar/Avatar.tsx +7 -4
- package/src/app/(main)/settings/provider/features/ModelList/CreateNewModelModal/Form.tsx +8 -0
- package/src/features/User/UserInfo.tsx +3 -2
- package/src/features/User/UserPanel/PanelContent.tsx +1 -3
- package/src/hooks/useModelSupportReasoning.ts +15 -0
- package/src/libs/agent-runtime/siliconcloud/index.ts +3 -2
- package/src/locales/default/modelProvider.ts +5 -0
- package/src/store/aiInfra/slices/aiModel/action.ts +1 -0
- package/src/store/aiInfra/slices/aiModel/selectors.ts +7 -0
- package/src/store/user/slices/modelList/selectors/modelProvider.ts +4 -0
- package/src/types/aiModel.ts +5 -0
- package/src/types/llm.ts +9 -0
- package/src/utils/_deprecated/parseModels.test.ts +11 -0
- package/src/utils/_deprecated/parseModels.ts +4 -0
- package/src/utils/merge.test.ts +56 -0
- package/src/utils/merge.ts +3 -2
- package/src/utils/parseModels.test.ts +14 -0
- package/src/utils/parseModels.ts +4 -0
- package/src/app/(main)/repos/page.tsx +0 -5
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,57 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.51.1](https://github.com/lobehub/lobe-chat/compare/v1.51.0...v1.51.1)
|
6
|
+
|
7
|
+
<sup>Released on **2025-02-05**</sup>
|
8
|
+
|
9
|
+
<br/>
|
10
|
+
|
11
|
+
<details>
|
12
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
13
|
+
|
14
|
+
</details>
|
15
|
+
|
16
|
+
<div align="right">
|
17
|
+
|
18
|
+
[](#readme-top)
|
19
|
+
|
20
|
+
</div>
|
21
|
+
|
22
|
+
## [Version 1.51.0](https://github.com/lobehub/lobe-chat/compare/v1.50.5...v1.51.0)
|
23
|
+
|
24
|
+
<sup>Released on **2025-02-05**</sup>
|
25
|
+
|
26
|
+
#### ✨ Features
|
27
|
+
|
28
|
+
- **misc**: Add reasoning tag support for custom models via UI or ENV.
|
29
|
+
|
30
|
+
#### 🐛 Bug Fixes
|
31
|
+
|
32
|
+
- **misc**: Fix deepseek-v3 & qvq model tag fetch error from SiliconCloud, fix model ability missing.
|
33
|
+
|
34
|
+
<br/>
|
35
|
+
|
36
|
+
<details>
|
37
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
38
|
+
|
39
|
+
#### What's improved
|
40
|
+
|
41
|
+
- **misc**: Add reasoning tag support for custom models via UI or ENV, closes [#5684](https://github.com/lobehub/lobe-chat/issues/5684) ([3499403](https://github.com/lobehub/lobe-chat/commit/3499403))
|
42
|
+
|
43
|
+
#### What's fixed
|
44
|
+
|
45
|
+
- **misc**: Fix deepseek-v3 & qvq model tag fetch error from SiliconCloud, closes [#5741](https://github.com/lobehub/lobe-chat/issues/5741) ([ee61653](https://github.com/lobehub/lobe-chat/commit/ee61653))
|
46
|
+
- **misc**: Fix model ability missing, closes [#5739](https://github.com/lobehub/lobe-chat/issues/5739) ([0e1a022](https://github.com/lobehub/lobe-chat/commit/0e1a022))
|
47
|
+
|
48
|
+
</details>
|
49
|
+
|
50
|
+
<div align="right">
|
51
|
+
|
52
|
+
[](#readme-top)
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
5
56
|
### [Version 1.50.5](https://github.com/lobehub/lobe-chat/compare/v1.50.4...v1.50.5)
|
6
57
|
|
7
58
|
<sup>Released on **2025-02-04**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,21 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {},
|
4
|
+
"date": "2025-02-05",
|
5
|
+
"version": "1.51.1"
|
6
|
+
},
|
7
|
+
{
|
8
|
+
"children": {
|
9
|
+
"features": [
|
10
|
+
"Add reasoning tag support for custom models via UI or ENV."
|
11
|
+
],
|
12
|
+
"fixes": [
|
13
|
+
"Fix deepseek-v3 & qvq model tag fetch error from SiliconCloud, fix model ability missing."
|
14
|
+
]
|
15
|
+
},
|
16
|
+
"date": "2025-02-05",
|
17
|
+
"version": "1.51.0"
|
18
|
+
},
|
2
19
|
{
|
3
20
|
"children": {
|
4
21
|
"improvements": [
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "معرف النموذج"
|
230
230
|
},
|
231
231
|
"modalTitle": "تكوين النموذج المخصص",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "هذا الإعداد سيفتح فقط قدرة النموذج على التفكير العميق، التأثير الفعلي يعتمد بالكامل على النموذج نفسه، يرجى اختبار ما إذا كان هذا النموذج يمتلك القدرة على التفكير العميق القابل للاستخدام",
|
234
|
+
"title": "يدعم التفكير العميق"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "تعيين الحد الأقصى لعدد الرموز المدعومة من قبل النموذج",
|
234
238
|
"title": "أقصى نافذة سياق",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "ID на модела"
|
230
230
|
},
|
231
231
|
"modalTitle": "Конфигурация на персонализиран модел",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "Тази конфигурация ще активира само способността на модела за дълбоко мислене, конкретният ефект зависи изцяло от самия модел, моля, тествайте сами дали моделът притежава налична способност за дълбоко мислене",
|
234
|
+
"title": "Поддръжка на дълбоко мислене"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "Настройте максималния брой токени, поддържани от модела",
|
234
238
|
"title": "Максимален контекстуален прозорец",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "Modell-ID"
|
230
230
|
},
|
231
231
|
"modalTitle": "Benutzerdefinierte Modellkonfiguration",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "Diese Konfiguration aktiviert nur die Fähigkeit des Modells zu tiefem Denken. Die tatsächlichen Ergebnisse hängen vollständig vom Modell selbst ab. Bitte testen Sie selbst, ob das Modell über die Fähigkeit zum tiefen Denken verfügt.",
|
234
|
+
"title": "Unterstützung für tiefes Denken"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "Maximale Token-Anzahl für das Modell festlegen",
|
234
238
|
"title": "Maximales Kontextfenster",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "Model ID"
|
230
230
|
},
|
231
231
|
"modalTitle": "Custom Model Configuration",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "This configuration will enable the model's deep thinking capabilities, and the specific effects depend entirely on the model itself. Please test whether this model has usable deep thinking abilities.",
|
234
|
+
"title": "Support Deep Thinking"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "Set the maximum number of tokens supported by the model",
|
234
238
|
"title": "Maximum Context Window",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "ID del modelo"
|
230
230
|
},
|
231
231
|
"modalTitle": "Configuración del modelo personalizado",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "Esta configuración solo activará la capacidad de pensamiento profundo del modelo, el efecto específico depende completamente del modelo en sí, por favor, pruebe si este modelo tiene la capacidad de pensamiento profundo utilizable",
|
234
|
+
"title": "Soporte para pensamiento profundo"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "Establecer el número máximo de tokens que el modelo puede soportar",
|
234
238
|
"title": "Máximo de ventana de contexto",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "شناسه مدل"
|
230
230
|
},
|
231
231
|
"modalTitle": "پیکربندی مدل سفارشی",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "این تنظیم فقط قابلیت تفکر عمیق مدل را فعال میکند و تأثیر دقیق آن کاملاً به خود مدل بستگی دارد، لطفاً خودتان آزمایش کنید که آیا این مدل قابلیت تفکر عمیق قابل استفاده را دارد یا خیر",
|
234
|
+
"title": "پشتیبانی از تفکر عمیق"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "حداکثر تعداد توکنهای پشتیبانی شده توسط مدل را تنظیم کنید",
|
234
238
|
"title": "حداکثر پنجره زمینه",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "ID du modèle"
|
230
230
|
},
|
231
231
|
"modalTitle": "Configuration du modèle personnalisé",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "Cette configuration activera uniquement la capacité de réflexion approfondie du modèle. Les résultats dépendent entièrement du modèle lui-même, veuillez tester si ce modèle possède une capacité de réflexion approfondie utilisable.",
|
234
|
+
"title": "Support de la réflexion approfondie"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "Définir le nombre maximal de tokens pris en charge par le modèle",
|
234
238
|
"title": "Fenêtre de contexte maximale",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "ID del modello"
|
230
230
|
},
|
231
231
|
"modalTitle": "Configurazione modello personalizzato",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "Questa configurazione attiverà solo la capacità di pensiero profondo del modello; l'effetto specifico dipende interamente dal modello stesso. Si prega di testare autonomamente se il modello possiede una capacità di pensiero profondo utilizzabile.",
|
234
|
+
"title": "Supporto per il pensiero profondo"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "Imposta il numero massimo di token supportati dal modello",
|
234
238
|
"title": "Finestra di contesto massima",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "モデル ID"
|
230
230
|
},
|
231
231
|
"modalTitle": "カスタムモデル設定",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "この設定は、モデルの深い思考能力を有効にするだけです。具体的な効果はモデル自体に依存しますので、このモデルが利用可能な深い思考能力を持っているかどうかはご自身でテストしてください。",
|
234
|
+
"title": "深い思考をサポート"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "モデルがサポートする最大トークン数を設定する",
|
234
238
|
"title": "最大コンテキストウィンドウ",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "모델 ID"
|
230
230
|
},
|
231
231
|
"modalTitle": "사용자 정의 모델 구성",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "이 설정은 모델의 심층 사고 능력만을 활성화합니다. 구체적인 효과는 모델 자체에 따라 다르므로, 해당 모델이 사용 가능한 심층 사고 능력을 갖추고 있는지 직접 테스트해 보시기 바랍니다.",
|
234
|
+
"title": "심층 사고 지원"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "모델이 지원하는 최대 토큰 수 설정",
|
234
238
|
"title": "최대 컨텍스트 창",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "Model ID"
|
230
230
|
},
|
231
231
|
"modalTitle": "Configuratie van aangepast model",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "Deze configuratie schakelt alleen de mogelijkheid voor diepgaand denken van het model in. Het specifieke effect hangt volledig af van het model zelf, test zelf of dit model in staat is tot bruikbaar diepgaand denken.",
|
234
|
+
"title": "Ondersteuning voor diepgaand denken"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "Stel het maximale aantal tokens in dat door het model wordt ondersteund",
|
234
238
|
"title": "Maximale contextvenster",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "ID modelu"
|
230
230
|
},
|
231
231
|
"modalTitle": "Konfiguracja niestandardowego modelu",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "Ta konfiguracja włączy jedynie zdolność modelu do głębokiego myślenia, a konkretne efekty w pełni zależą od samego modelu. Proszę samodzielnie przetestować, czy model ma zdolność do głębokiego myślenia.",
|
234
|
+
"title": "Wsparcie dla głębokiego myślenia"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "Ustaw maksymalną liczbę tokenów wspieranych przez model",
|
234
238
|
"title": "Maksymalne okno kontekstu",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "ID do Modelo"
|
230
230
|
},
|
231
231
|
"modalTitle": "Configuração do Modelo Personalizado",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "Esta configuração ativará apenas a capacidade de pensamento profundo do modelo, e o efeito específico depende totalmente do próprio modelo. Por favor, teste se este modelo possui a capacidade de pensamento profundo utilizável.",
|
234
|
+
"title": "Suporte a Pensamento Profundo"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "Configurar o número máximo de tokens suportados pelo modelo",
|
234
238
|
"title": "Janela de contexto máxima",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "ID модели"
|
230
230
|
},
|
231
231
|
"modalTitle": "Настройка пользовательской модели",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "Эта настройка активирует возможность глубокого мышления модели, конкретный эффект полностью зависит от самой модели, пожалуйста, протестируйте, обладает ли модель доступной способностью к глубокому мышлению",
|
234
|
+
"title": "Поддержка глубокого мышления"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "Установите максимальное количество токенов, поддерживаемое моделью",
|
234
238
|
"title": "Максимальное окно контекста",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "Model ID"
|
230
230
|
},
|
231
231
|
"modalTitle": "Özel Model Yapılandırması",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "Bu yapılandırma yalnızca modelin derin düşünme yeteneğini açacaktır, belirli etkiler tamamen modelin kendisine bağlıdır, lütfen bu modelin kullanılabilir derin düşünme yeteneğine sahip olup olmadığını kendiniz test edin",
|
234
|
+
"title": "Derin düşünmeyi destekler"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "Modelin desteklediği maksimum Token sayısını ayarlayın",
|
234
238
|
"title": "Maksimum bağlam penceresi",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "ID mô hình"
|
230
230
|
},
|
231
231
|
"modalTitle": "Cấu hình mô hình tùy chỉnh",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "Cấu hình này sẽ chỉ kích hoạt khả năng suy nghĩ sâu của mô hình, hiệu quả cụ thể hoàn toàn phụ thuộc vào chính mô hình, vui lòng tự kiểm tra xem mô hình này có khả năng suy nghĩ sâu có thể sử dụng hay không",
|
234
|
+
"title": "Hỗ trợ suy nghĩ sâu"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "Cài đặt số Token tối đa mà mô hình hỗ trợ",
|
234
238
|
"title": "Cửa sổ ngữ cảnh tối đa",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "模型 ID"
|
230
230
|
},
|
231
231
|
"modalTitle": "自定义模型配置",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "此配置将仅开启模型深度思考的能力,具体效果完全取决于模型本身,请自行测试该模型是否具备可用的深度思考能力",
|
234
|
+
"title": "支持深度思考"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "设置模型支持的最大 Token 数",
|
234
238
|
"title": "最大上下文窗口",
|
@@ -229,6 +229,10 @@
|
|
229
229
|
"title": "模型 ID"
|
230
230
|
},
|
231
231
|
"modalTitle": "自定義模型配置",
|
232
|
+
"reasoning": {
|
233
|
+
"extra": "此配置將僅開啟模型深度思考的能力,具體效果完全取決於模型本身,請自行測試該模型是否具備可用的深度思考能力",
|
234
|
+
"title": "支持深度思考"
|
235
|
+
},
|
232
236
|
"tokens": {
|
233
237
|
"extra": "設定模型支持的最大 Token 數",
|
234
238
|
"title": "最大上下文窗口",
|
package/next.config.ts
CHANGED
@@ -164,6 +164,12 @@ const nextConfig: NextConfig = {
|
|
164
164
|
permanent: true,
|
165
165
|
source: '/welcome',
|
166
166
|
},
|
167
|
+
// we need back /repos url in the further
|
168
|
+
{
|
169
|
+
destination: '/files',
|
170
|
+
permanent: false,
|
171
|
+
source: '/repos',
|
172
|
+
},
|
167
173
|
],
|
168
174
|
// when external packages in dev mode with turbopack, this config will lead to bundle error
|
169
175
|
serverExternalPackages: isProd ? ['@electric-sql/pglite'] : undefined,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.51.1",
|
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",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ActionIcon } from '@lobehub/ui';
|
2
2
|
import { Tooltip } from 'antd';
|
3
3
|
import { LucideX } from 'lucide-react';
|
4
|
-
import { memo } from 'react';
|
4
|
+
import { Suspense, memo } from 'react';
|
5
5
|
import { useTranslation } from 'react-i18next';
|
6
6
|
import { Flexbox } from 'react-layout-kit';
|
7
7
|
|
@@ -14,10 +14,13 @@ const Avatar = memo(() => {
|
|
14
14
|
const { t } = useTranslation('common');
|
15
15
|
const hideSettingsMoveGuide = useUserStore(preferenceSelectors.hideSettingsMoveGuide);
|
16
16
|
const updateGuideState = useUserStore((s) => s.updateGuideState);
|
17
|
+
|
17
18
|
const content = (
|
18
|
-
<
|
19
|
-
<
|
20
|
-
|
19
|
+
<Suspense fallback={<UserAvatar />}>
|
20
|
+
<UserPanel>
|
21
|
+
<UserAvatar clickable />
|
22
|
+
</UserPanel>
|
23
|
+
</Suspense>
|
21
24
|
);
|
22
25
|
|
23
26
|
return hideSettingsMoveGuide ? (
|
@@ -95,6 +95,14 @@ const ModelConfigForm = memo<ModelConfigFormProps>(
|
|
95
95
|
>
|
96
96
|
<Checkbox />
|
97
97
|
</Form.Item>
|
98
|
+
<Form.Item
|
99
|
+
extra={t('providerModels.item.modelConfig.reasoning.extra')}
|
100
|
+
label={t('providerModels.item.modelConfig.reasoning.title')}
|
101
|
+
name={['abilities', 'reasoning']}
|
102
|
+
valuePropName={'checked'}
|
103
|
+
>
|
104
|
+
<Checkbox />
|
105
|
+
</Form.Item>
|
98
106
|
{/*<Form.Item*/}
|
99
107
|
{/* extra={t('providerModels.item.modelConfig.files.extra')}*/}
|
100
108
|
{/* label={t('providerModels.item.modelConfig.files.title')}*/}
|
@@ -24,9 +24,10 @@ const useStyles = createStyles(({ css, token }) => ({
|
|
24
24
|
|
25
25
|
export interface UserInfoProps extends FlexboxProps {
|
26
26
|
avatarProps?: Partial<UserAvatarProps>;
|
27
|
+
onClick?: () => void;
|
27
28
|
}
|
28
29
|
|
29
|
-
const UserInfo = memo<UserInfoProps>(({ avatarProps, ...rest }) => {
|
30
|
+
const UserInfo = memo<UserInfoProps>(({ avatarProps, onClick, ...rest }) => {
|
30
31
|
const { styles, theme } = useStyles();
|
31
32
|
const isSignedIn = useUserStore(authSelectors.isLogin);
|
32
33
|
const [nickname, username] = useUserStore((s) => [
|
@@ -44,7 +45,7 @@ const UserInfo = memo<UserInfoProps>(({ avatarProps, ...rest }) => {
|
|
44
45
|
paddingInline={12}
|
45
46
|
{...rest}
|
46
47
|
>
|
47
|
-
<Flexbox align={'center'} gap={12} horizontal>
|
48
|
+
<Flexbox align={'center'} gap={12} horizontal onClick={onClick}>
|
48
49
|
<UserAvatar background={theme.colorFill} size={48} {...avatarProps} />
|
49
50
|
<Flexbox flex={1} gap={6}>
|
50
51
|
<div className={styles.nickname}>{nickname}</div>
|
@@ -44,9 +44,7 @@ const PanelContent = memo<{ closePopover: () => void }>(({ closePopover }) => {
|
|
44
44
|
<Flexbox gap={2} style={{ minWidth: 300 }}>
|
45
45
|
{!enableAuth || (enableAuth && isLoginWithAuth) ? (
|
46
46
|
<>
|
47
|
-
<
|
48
|
-
<UserInfo />
|
49
|
-
</Link>
|
47
|
+
<UserInfo avatarProps={{ clickable: false }} />
|
50
48
|
{!isDeprecatedEdition && (
|
51
49
|
<Link href={'/profile/stats'} style={{ color: 'inherit' }}>
|
52
50
|
<DataStatistics />
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { isDeprecatedEdition } from '@/const/version';
|
2
|
+
import { aiModelSelectors, useAiInfraStore } from '@/store/aiInfra';
|
3
|
+
import { useUserStore } from '@/store/user';
|
4
|
+
import { modelProviderSelectors } from '@/store/user/selectors';
|
5
|
+
|
6
|
+
export const useModelSupportReasoning = (model: string, provider: string) => {
|
7
|
+
const newValue = useAiInfraStore(aiModelSelectors.isModelSupportReasoning(model, provider));
|
8
|
+
|
9
|
+
// TODO: remove this in V2.0
|
10
|
+
const oldValue = useUserStore(modelProviderSelectors.isModelEnabledReasoning(model));
|
11
|
+
if (isDeprecatedEdition) return oldValue;
|
12
|
+
//
|
13
|
+
|
14
|
+
return newValue;
|
15
|
+
};
|
@@ -57,7 +57,7 @@ export const LobeSiliconCloudAI = LobeOpenAICompatibleFactory({
|
|
57
57
|
const functionCallKeywords = [
|
58
58
|
'qwen/qwen2.5',
|
59
59
|
'thudm/glm-4',
|
60
|
-
'deepseek-ai/
|
60
|
+
'deepseek-ai/deepseek',
|
61
61
|
'internlm/internlm2_5',
|
62
62
|
'meta-llama/meta-llama-3.1',
|
63
63
|
'meta-llama/meta-llama-3.3',
|
@@ -65,6 +65,7 @@ export const LobeSiliconCloudAI = LobeOpenAICompatibleFactory({
|
|
65
65
|
|
66
66
|
const visionKeywords = [
|
67
67
|
'opengvlab/internvl',
|
68
|
+
'qwen/qvq',
|
68
69
|
'qwen/qwen2-vl',
|
69
70
|
'teleai/telemm',
|
70
71
|
'deepseek-ai/deepseek-vl',
|
@@ -74,7 +75,7 @@ export const LobeSiliconCloudAI = LobeOpenAICompatibleFactory({
|
|
74
75
|
|
75
76
|
return {
|
76
77
|
enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
|
77
|
-
functionCall: functionCallKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
|
78
|
+
functionCall: functionCallKeywords.some(keyword => model.id.toLowerCase().includes(keyword)) && !model.id.toLowerCase().includes('deepseek-r1'),
|
78
79
|
id: model.id,
|
79
80
|
vision: visionKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
|
80
81
|
};
|
@@ -231,6 +231,11 @@ export default {
|
|
231
231
|
title: '模型 ID',
|
232
232
|
},
|
233
233
|
modalTitle: '自定义模型配置',
|
234
|
+
reasoning: {
|
235
|
+
extra:
|
236
|
+
'此配置将仅开启模型深度思考的能力,具体效果完全取决于模型本身,请自行测试该模型是否具备可用的深度思考能力',
|
237
|
+
title: '支持深度思考',
|
238
|
+
},
|
234
239
|
tokens: {
|
235
240
|
extra: '设置模型支持的最大 Token 数',
|
236
241
|
title: '最大上下文窗口',
|
@@ -48,6 +48,12 @@ const isModelSupportVision = (id: string, provider: string) => (s: AIProviderSto
|
|
48
48
|
return model?.abilities?.vision;
|
49
49
|
};
|
50
50
|
|
51
|
+
const isModelSupportReasoning = (id: string, provider: string) => (s: AIProviderStoreState) => {
|
52
|
+
const model = getEnabledModelById(id, provider)(s);
|
53
|
+
|
54
|
+
return model?.abilities?.reasoning;
|
55
|
+
};
|
56
|
+
|
51
57
|
const isModelHasContextWindowToken =
|
52
58
|
(id: string, provider: string) => (s: AIProviderStoreState) => {
|
53
59
|
const model = getEnabledModelById(id, provider)(s);
|
@@ -71,6 +77,7 @@ export const aiModelSelectors = {
|
|
71
77
|
isModelEnabled,
|
72
78
|
isModelHasContextWindowToken,
|
73
79
|
isModelLoading,
|
80
|
+
isModelSupportReasoning,
|
74
81
|
isModelSupportToolUse,
|
75
82
|
isModelSupportVision,
|
76
83
|
modelContextWindowTokens,
|
@@ -122,6 +122,9 @@ const isModelEnabledFunctionCall = (id: string) => (s: UserStore) =>
|
|
122
122
|
const isModelEnabledVision = (id: string) => (s: UserStore) =>
|
123
123
|
getModelCardById(id)(s)?.vision || id.includes('vision');
|
124
124
|
|
125
|
+
const isModelEnabledReasoning = (id: string) => (s: UserStore) =>
|
126
|
+
getModelCardById(id)(s)?.reasoning || false;
|
127
|
+
|
125
128
|
const isModelEnabledFiles = (id: string) => (s: UserStore) => getModelCardById(id)(s)?.files;
|
126
129
|
|
127
130
|
const isModelEnabledUpload = (id: string) => (s: UserStore) =>
|
@@ -144,6 +147,7 @@ export const modelProviderSelectors = {
|
|
144
147
|
getModelCardsById,
|
145
148
|
isModelEnabledFiles,
|
146
149
|
isModelEnabledFunctionCall,
|
150
|
+
isModelEnabledReasoning,
|
147
151
|
isModelEnabledUpload,
|
148
152
|
isModelEnabledVision,
|
149
153
|
isModelHasMaxToken,
|
package/src/types/aiModel.ts
CHANGED
@@ -43,6 +43,7 @@ export interface ModelAbilities {
|
|
43
43
|
const AiModelAbilitiesSchema = z.object({
|
44
44
|
// files: z.boolean().optional(),
|
45
45
|
functionCall: z.boolean().optional(),
|
46
|
+
reasoning: z.boolean().optional(),
|
46
47
|
vision: z.boolean().optional(),
|
47
48
|
});
|
48
49
|
|
@@ -205,6 +206,10 @@ export interface AIRealtimeModelCard extends AIBaseModelCard {
|
|
205
206
|
* whether model supports function call
|
206
207
|
*/
|
207
208
|
functionCall?: boolean;
|
209
|
+
/**
|
210
|
+
* whether model supports reasoning
|
211
|
+
*/
|
212
|
+
reasoning?: boolean;
|
208
213
|
/**
|
209
214
|
* whether model supports vision
|
210
215
|
*/
|
package/src/types/llm.ts
CHANGED
@@ -42,6 +42,15 @@ export interface ChatModelCard {
|
|
42
42
|
legacy?: boolean;
|
43
43
|
maxOutput?: number;
|
44
44
|
pricing?: ChatModelPricing;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* whether model supports reasoning
|
48
|
+
*/
|
49
|
+
reasoning?: boolean;
|
50
|
+
|
51
|
+
/**
|
52
|
+
* whether model is legacy (deprecated but not removed yet)
|
53
|
+
*/
|
45
54
|
releasedAt?: string;
|
46
55
|
|
47
56
|
/**
|
@@ -52,6 +52,17 @@ describe('parseModelString', () => {
|
|
52
52
|
});
|
53
53
|
});
|
54
54
|
|
55
|
+
it('token and reasoning', () => {
|
56
|
+
const result = parseModelString('deepseek-r1=Deepseek R1<65536:reasoning>');
|
57
|
+
|
58
|
+
expect(result.add[0]).toEqual({
|
59
|
+
displayName: 'Deepseek R1',
|
60
|
+
reasoning: true,
|
61
|
+
id: 'deepseek-r1',
|
62
|
+
contextWindowTokens: 65_536,
|
63
|
+
});
|
64
|
+
});
|
65
|
+
|
55
66
|
it('multi models', () => {
|
56
67
|
const result = parseModelString(
|
57
68
|
'gemini-1.5-flash-latest=Gemini 1.5 Flash<16000:vision>,gpt-4-all=ChatGPT Plus<128000:fc:vision:file>',
|
@@ -60,6 +60,10 @@ export const parseModelString = (modelString: string = '', withDeploymentName =
|
|
60
60
|
|
61
61
|
for (const capability of capabilityList) {
|
62
62
|
switch (capability) {
|
63
|
+
case 'reasoning': {
|
64
|
+
model.reasoning = true;
|
65
|
+
break;
|
66
|
+
}
|
63
67
|
case 'vision': {
|
64
68
|
model.vision = true;
|
65
69
|
break;
|
package/src/utils/merge.test.ts
CHANGED
@@ -45,4 +45,60 @@ describe('mergeArrayById', () => {
|
|
45
45
|
},
|
46
46
|
]);
|
47
47
|
});
|
48
|
+
|
49
|
+
it('should merge data with objects', () => {
|
50
|
+
const data = mergeArrayById(
|
51
|
+
[
|
52
|
+
{
|
53
|
+
contextWindowTokens: 128_000,
|
54
|
+
description:
|
55
|
+
'o1-mini是一款针对编程、数学和科学应用场景而设计的快速、经济高效的推理模型。该模型具有128K上下文和2023年10月的知识截止日期。',
|
56
|
+
displayName: 'OpenAI o1-mini',
|
57
|
+
enabled: true,
|
58
|
+
id: 'o3-mini',
|
59
|
+
abilities: {
|
60
|
+
functionCall: true,
|
61
|
+
},
|
62
|
+
maxOutput: 65_536,
|
63
|
+
pricing: {
|
64
|
+
input: 3,
|
65
|
+
output: 12,
|
66
|
+
},
|
67
|
+
releasedAt: '2024-09-12',
|
68
|
+
type: 'chat',
|
69
|
+
},
|
70
|
+
],
|
71
|
+
[
|
72
|
+
{
|
73
|
+
id: 'o3-mini',
|
74
|
+
contextWindowTokens: null,
|
75
|
+
displayName: 'OpenAI o1-mini ABC',
|
76
|
+
type: 'chat',
|
77
|
+
abilities: {},
|
78
|
+
enabled: false,
|
79
|
+
},
|
80
|
+
],
|
81
|
+
);
|
82
|
+
|
83
|
+
expect(data).toEqual([
|
84
|
+
{
|
85
|
+
contextWindowTokens: 128_000,
|
86
|
+
description:
|
87
|
+
'o1-mini是一款针对编程、数学和科学应用场景而设计的快速、经济高效的推理模型。该模型具有128K上下文和2023年10月的知识截止日期。',
|
88
|
+
displayName: 'OpenAI o1-mini ABC',
|
89
|
+
enabled: false,
|
90
|
+
id: 'o3-mini',
|
91
|
+
maxOutput: 65_536,
|
92
|
+
pricing: {
|
93
|
+
input: 3,
|
94
|
+
output: 12,
|
95
|
+
},
|
96
|
+
abilities: {
|
97
|
+
functionCall: true,
|
98
|
+
},
|
99
|
+
releasedAt: '2024-09-12',
|
100
|
+
type: 'chat',
|
101
|
+
},
|
102
|
+
]);
|
103
|
+
});
|
48
104
|
});
|
package/src/utils/merge.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { merge as _merge, mergeWith } from 'lodash-es';
|
1
|
+
import { merge as _merge, isEmpty, mergeWith } from 'lodash-es';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* 用于合并对象,如果是数组则直接替换
|
@@ -33,7 +33,8 @@ export const mergeArrayById = <T extends MergeableItem>(defaultItems: T[], userI
|
|
33
33
|
const mergedItem: T = { ...defaultItem };
|
34
34
|
Object.entries(userItem).forEach(([key, value]) => {
|
35
35
|
// Only use user value if it's not null and not undefined
|
36
|
-
|
36
|
+
// and not empty object
|
37
|
+
if (value !== null && value !== undefined && !(typeof value === 'object' && isEmpty(value))) {
|
37
38
|
// @ts-expect-error
|
38
39
|
mergedItem[key] = value;
|
39
40
|
}
|
@@ -58,6 +58,20 @@ describe('parseModelString', () => {
|
|
58
58
|
});
|
59
59
|
});
|
60
60
|
|
61
|
+
it('token and reasoning', () => {
|
62
|
+
const result = parseModelString('deepseek-r1=Deepseek R1<65536:reasoning>');
|
63
|
+
|
64
|
+
expect(result.add[0]).toEqual({
|
65
|
+
displayName: 'Deepseek R1',
|
66
|
+
abilities: {
|
67
|
+
reasoning: true,
|
68
|
+
},
|
69
|
+
id: 'deepseek-r1',
|
70
|
+
contextWindowTokens: 65_536,
|
71
|
+
type: 'chat',
|
72
|
+
});
|
73
|
+
});
|
74
|
+
|
61
75
|
it('multi models', () => {
|
62
76
|
const result = parseModelString(
|
63
77
|
'gemini-1.5-flash-latest=Gemini 1.5 Flash<16000:vision>,gpt-4-all=ChatGPT Plus<128000:fc:vision:file>',
|
package/src/utils/parseModels.ts
CHANGED
@@ -64,6 +64,10 @@ export const parseModelString = (modelString: string = '', withDeploymentName =
|
|
64
64
|
|
65
65
|
for (const capability of capabilityList) {
|
66
66
|
switch (capability) {
|
67
|
+
case 'reasoning': {
|
68
|
+
model.abilities!.reasoning = true;
|
69
|
+
break;
|
70
|
+
}
|
67
71
|
case 'vision': {
|
68
72
|
model.abilities!.vision = true;
|
69
73
|
break;
|