@lobehub/chat 1.132.4 → 1.132.6
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 +42 -0
- package/apps/desktop/electron-builder.js +11 -2
- package/apps/desktop/src/main/controllers/__tests__/BrowserWindowsCtr.test.ts +36 -14
- package/changelog/v1.json +14 -0
- package/next.config.ts +5 -5
- package/package.json +1 -1
- package/packages/const/src/auth.ts +2 -4
- package/packages/const/src/settings/genUserLLMConfig.test.ts +1 -1
- package/packages/const/src/settings/genUserLLMConfig.ts +1 -1
- package/packages/context-engine/package.json +3 -11
- package/packages/database/src/models/__tests__/aiProvider.test.ts +1 -1
- package/packages/database/src/models/aiProvider.ts +2 -2
- package/packages/database/src/repositories/aiInfra/index.ts +1 -1
- package/packages/model-bank/src/index.ts +1 -0
- package/packages/model-runtime/package.json +1 -2
- package/packages/model-runtime/src/const/type.test.ts +1 -1
- package/packages/model-runtime/src/core/ModelRuntime.test.ts +2 -1
- package/packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts +7 -7
- package/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts +5 -6
- package/packages/model-runtime/src/providers/ai21/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/ai21/index.ts +2 -1
- package/packages/model-runtime/src/providers/ai302/index.ts +3 -1
- package/packages/model-runtime/src/providers/ai360/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/ai360/index.ts +2 -1
- package/packages/model-runtime/src/providers/aihubmix/index.ts +1 -2
- package/packages/model-runtime/src/providers/akashchat/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/akashchat/index.ts +3 -4
- package/packages/model-runtime/src/providers/anthropic/index.ts +2 -6
- package/packages/model-runtime/src/providers/azureOpenai/index.ts +1 -1
- package/packages/model-runtime/src/providers/azureai/index.ts +2 -1
- package/packages/model-runtime/src/providers/baichuan/index.test.ts +2 -1
- package/packages/model-runtime/src/providers/baichuan/index.ts +3 -2
- package/packages/model-runtime/src/providers/bedrock/index.test.ts +2 -1
- package/packages/model-runtime/src/providers/bedrock/index.ts +1 -1
- package/packages/model-runtime/src/providers/cloudflare/index.ts +3 -2
- package/packages/model-runtime/src/providers/cohere/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/cohere/index.ts +2 -1
- package/packages/model-runtime/src/providers/cometapi/index.test.ts +2 -1
- package/packages/model-runtime/src/providers/cometapi/index.ts +2 -1
- package/packages/model-runtime/src/providers/deepseek/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/deepseek/index.ts +2 -1
- package/packages/model-runtime/src/providers/fireworksai/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/fireworksai/index.ts +2 -2
- package/packages/model-runtime/src/providers/giteeai/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/giteeai/index.ts +2 -1
- package/packages/model-runtime/src/providers/github/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/github/index.ts +2 -1
- package/packages/model-runtime/src/providers/groq/index.ts +2 -1
- package/packages/model-runtime/src/providers/higress/index.ts +1 -1
- package/packages/model-runtime/src/providers/huggingface/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/huggingface/index.ts +2 -3
- package/packages/model-runtime/src/providers/hunyuan/index.test.ts +3 -2
- package/packages/model-runtime/src/providers/hunyuan/index.ts +2 -2
- package/packages/model-runtime/src/providers/infiniai/index.ts +3 -2
- package/packages/model-runtime/src/providers/internlm/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/internlm/index.ts +2 -2
- package/packages/model-runtime/src/providers/jina/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/jina/index.ts +2 -2
- package/packages/model-runtime/src/providers/lmstudio/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/lmstudio/index.ts +2 -2
- package/packages/model-runtime/src/providers/minimax/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/minimax/index.ts +1 -2
- package/packages/model-runtime/src/providers/mistral/index.ts +2 -2
- package/packages/model-runtime/src/providers/modelscope/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/modelscope/index.ts +2 -1
- package/packages/model-runtime/src/providers/moonshot/index.ts +3 -1
- package/packages/model-runtime/src/providers/nebius/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/nebius/index.ts +2 -1
- package/packages/model-runtime/src/providers/newapi/index.ts +1 -2
- package/packages/model-runtime/src/providers/novita/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/novita/index.ts +2 -1
- package/packages/model-runtime/src/providers/nvidia/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/nvidia/index.ts +2 -1
- package/packages/model-runtime/src/providers/ollama/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/ollama/index.ts +2 -3
- package/packages/model-runtime/src/providers/openai/index.ts +2 -1
- package/packages/model-runtime/src/providers/openrouter/index.ts +1 -2
- package/packages/model-runtime/src/providers/perplexity/index.test.ts +3 -2
- package/packages/model-runtime/src/providers/perplexity/index.ts +2 -1
- package/packages/model-runtime/src/providers/ppio/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/ppio/index.ts +2 -1
- package/packages/model-runtime/src/providers/qiniu/index.test.ts +2 -1
- package/packages/model-runtime/src/providers/qiniu/index.ts +2 -1
- package/packages/model-runtime/src/providers/qwen/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/qwen/index.ts +2 -1
- package/packages/model-runtime/src/providers/sambanova/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/sambanova/index.ts +2 -1
- package/packages/model-runtime/src/providers/search1api/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/search1api/index.ts +3 -3
- package/packages/model-runtime/src/providers/sensenova/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/sensenova/index.ts +2 -1
- package/packages/model-runtime/src/providers/siliconcloud/index.ts +3 -1
- package/packages/model-runtime/src/providers/spark/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/spark/index.ts +3 -1
- package/packages/model-runtime/src/providers/stepfun/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/stepfun/index.ts +2 -1
- package/packages/model-runtime/src/providers/taichu/index.test.ts +2 -6
- package/packages/model-runtime/src/providers/taichu/index.ts +2 -1
- package/packages/model-runtime/src/providers/tencentcloud/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/tencentcloud/index.ts +2 -1
- package/packages/model-runtime/src/providers/togetherai/index.ts +2 -2
- package/packages/model-runtime/src/providers/upstage/index.ts +2 -1
- package/packages/model-runtime/src/providers/v0/index.ts +2 -1
- package/packages/model-runtime/src/providers/vercelaigateway/index.ts +3 -2
- package/packages/model-runtime/src/providers/vllm/index.test.ts +2 -1
- package/packages/model-runtime/src/providers/vllm/index.ts +2 -1
- package/packages/model-runtime/src/providers/volcengine/index.ts +2 -1
- package/packages/model-runtime/src/providers/wenxin/index.test.ts +2 -1
- package/packages/model-runtime/src/providers/wenxin/index.ts +2 -1
- package/packages/model-runtime/src/providers/xai/index.test.ts +1 -1
- package/packages/model-runtime/src/providers/xai/index.ts +2 -1
- package/packages/model-runtime/src/providers/xinference/index.test.ts +2 -1
- package/packages/model-runtime/src/providers/xinference/index.ts +2 -2
- package/packages/model-runtime/src/providers/zeroone/index.ts +2 -1
- package/packages/model-runtime/src/providers/zhipu/index.ts +2 -1
- package/packages/model-runtime/src/types/index.ts +0 -1
- package/packages/model-runtime/src/types/type.ts +1 -1
- package/src/app/(backend)/webapi/chat/vertexai/route.ts +2 -1
- package/src/app/(backend)/webapi/models/[provider]/route.ts +2 -1
- package/src/app/[variants]/(main)/(mobile)/me/settings/features/useCategory.tsx +1 -3
- package/src/app/[variants]/(main)/(mobile)/me/settings/page.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Sidebar/ActionButton/ProviderConfig.tsx +5 -1
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ModelSelect.tsx +9 -3
- package/src/app/[variants]/(main)/profile/@category/features/CategoryContent.tsx +4 -3
- package/src/app/[variants]/(main)/profile/_layout/Desktop/index.tsx +6 -1
- package/src/app/[variants]/(main)/settings/_layout/CategoryContent.tsx +34 -0
- package/src/app/[variants]/(main)/settings/_layout/ContextProvider/index.tsx +32 -0
- package/src/app/[variants]/(main)/settings/_layout/Desktop/Header.tsx +6 -17
- package/src/app/[variants]/(main)/settings/_layout/Desktop/index.tsx +17 -18
- package/src/app/[variants]/(main)/settings/_layout/Mobile/Header.tsx +10 -19
- package/src/app/[variants]/(main)/settings/_layout/Mobile/index.tsx +12 -3
- package/src/app/[variants]/(main)/settings/_layout/SettingsContent.tsx +102 -0
- package/src/app/[variants]/(main)/settings/_layout/type.ts +2 -2
- package/src/app/[variants]/(main)/settings/about/features/Version.tsx +2 -2
- package/src/app/[variants]/(main)/settings/about/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/agent/_layout/Desktop.tsx +9 -1
- package/src/app/[variants]/(main)/settings/agent/index.tsx +16 -5
- package/src/app/[variants]/(main)/settings/common/features/{Common.tsx → Common/Common.tsx} +1 -1
- package/src/app/[variants]/(main)/settings/common/index.tsx +2 -2
- package/src/app/[variants]/(main)/settings/hooks/useCategory.tsx +11 -52
- package/src/app/[variants]/(main)/settings/hotkey/index.tsx +19 -0
- package/src/app/[variants]/(main)/settings/llm/ProviderList/Azure/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/llm/index.tsx +8 -4
- package/src/app/[variants]/(main)/settings/page.tsx +42 -0
- package/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/Card.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/(list)/index.tsx +12 -5
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/All.tsx +13 -7
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/Item.tsx +43 -38
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/List.tsx +8 -7
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/SearchResult.tsx +5 -2
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/index.tsx +12 -11
- package/src/app/[variants]/(main)/settings/provider/_layout/Desktop/Container.tsx +4 -5
- package/src/app/[variants]/(main)/settings/provider/_layout/Desktop/index.tsx +14 -3
- package/src/app/[variants]/(main)/settings/provider/_layout/Mobile.tsx +12 -4
- package/src/app/[variants]/(main)/settings/provider/{(detail)/azure/page.tsx → detail/azure/index.tsx} +2 -2
- package/src/app/[variants]/(main)/settings/provider/{(detail)/azureai/page.tsx → detail/azureai/index.tsx} +2 -2
- package/src/app/[variants]/(main)/settings/provider/{(detail)/bedrock/page.tsx → detail/bedrock/index.tsx} +1 -1
- package/src/app/[variants]/(main)/settings/provider/{(detail)/cloudflare/page.tsx → detail/cloudflare/index.tsx} +1 -1
- package/src/app/[variants]/(main)/settings/provider/{(detail)/[id] → detail/default}/ClientMode.tsx +1 -10
- package/src/app/[variants]/(main)/settings/provider/{(detail)/[id]/page.tsx → detail/default/ProviderDetialPage.tsx} +8 -8
- package/src/app/[variants]/(main)/settings/provider/{(detail)/github/page.tsx → detail/github/index.tsx} +1 -1
- package/src/app/[variants]/(main)/settings/provider/detail/index.tsx +49 -0
- package/src/app/[variants]/(main)/settings/provider/{(detail) → detail}/newapi/page.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/{(detail)/ollama/page.tsx → detail/ollama/index.tsx} +1 -1
- package/src/app/[variants]/(main)/settings/provider/{(detail)/openai/page.tsx → detail/openai/index.tsx} +4 -4
- package/src/app/[variants]/(main)/settings/provider/{(detail)/vertexai/page.tsx → detail/vertexai/index.tsx} +1 -1
- package/src/app/[variants]/(main)/settings/provider/features/CreateNewProvider/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/index.tsx +11 -0
- package/src/app/[variants]/(main)/settings/proxy/index.tsx +0 -6
- package/src/components/IndexCard/index.tsx +2 -0
- package/src/components/InvalidAPIKey/APIKeyForm/Bedrock.tsx +1 -1
- package/src/components/InvalidAPIKey/APIKeyForm/index.tsx +1 -1
- package/src/features/MobileTabBar/index.tsx +1 -1
- package/src/features/ModelSwitchPanel/index.tsx +9 -3
- package/src/features/Setting/Footer.tsx +3 -1
- package/src/features/Setting/SettingContainer.tsx +2 -6
- package/src/features/User/UserPanel/useMenu.tsx +1 -1
- package/src/hooks/useActiveTabKey.ts +5 -8
- package/src/hooks/useInterceptingRoutes.test.ts +1 -1
- package/src/hooks/useInterceptingRoutes.ts +1 -2
- package/src/libs/trpc/client/lambda.ts +1 -1
- package/src/server/globalConfig/_deprecated.test.ts +1 -1
- package/src/server/globalConfig/_deprecated.ts +1 -1
- package/src/server/globalConfig/genServerAiProviderConfig.test.ts +1 -1
- package/src/server/globalConfig/genServerAiProviderConfig.ts +1 -2
- package/src/server/modules/ModelRuntime/index.test.ts +1 -1
- package/src/server/modules/ModelRuntime/index.ts +2 -1
- package/src/server/routers/async/ragEval.ts +1 -1
- package/src/services/__tests__/_auth.test.ts +1 -1
- package/src/services/_auth.ts +1 -1
- package/src/services/chat/clientModelRuntime.test.ts +1 -1
- package/src/services/chat/helper.ts +1 -1
- package/src/services/chat/index.ts +2 -5
- package/src/services/textToImage.ts +1 -1
- package/src/store/chat/slices/aiChat/actions/__tests__/generateAIChat.test.ts +0 -1
- package/src/store/global/initialState.ts +0 -1
- package/src/store/image/slices/generationConfig/initialState.ts +1 -1
- package/src/store/user/slices/modelList/action.ts +1 -1
- package/src/app/[variants]/(main)/settings/@category/default.tsx +0 -19
- package/src/app/[variants]/(main)/settings/@category/features/CategoryContent.tsx +0 -31
- package/src/app/[variants]/(main)/settings/@category/features/UpgradeAlert.tsx +0 -37
- package/src/app/[variants]/(main)/settings/about/page.tsx +0 -22
- package/src/app/[variants]/(main)/settings/agent/layout.tsx +0 -23
- package/src/app/[variants]/(main)/settings/agent/page.tsx +0 -29
- package/src/app/[variants]/(main)/settings/common/page.tsx +0 -16
- package/src/app/[variants]/(main)/settings/hotkey/page.tsx +0 -33
- package/src/app/[variants]/(main)/settings/layout.ts +0 -11
- package/src/app/[variants]/(main)/settings/llm/page.tsx +0 -26
- package/src/app/[variants]/(main)/settings/provider/layout.tsx +0 -21
- package/src/app/[variants]/(main)/settings/provider/page.tsx +0 -20
- package/src/app/[variants]/(main)/settings/proxy/page.tsx +0 -28
- package/src/app/[variants]/(main)/settings/system-agent/page.tsx +0 -17
- package/src/app/[variants]/(main)/settings/tts/page.tsx +0 -15
- /package/packages/{model-runtime → model-bank}/src/const/modelProvider.ts +0 -0
- /package/src/app/[variants]/(main)/settings/provider/{(detail)/[id] → detail/default}/index.tsx +0 -0
- /package/src/app/[variants]/(main)/settings/provider/{(detail) → detail}/ollama/CheckError.tsx +0 -0
- /package/src/app/[variants]/(main)/settings/provider/{(detail) → detail}/ollama/Container.tsx +0 -0
- /package/src/app/[variants]/(main)/settings/storage/{page.tsx → index.tsx} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.132.6](https://github.com/lobehub/lobe-chat/compare/v1.132.5...v1.132.6)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2025-09-23**</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.132.5](https://github.com/lobehub/lobe-chat/compare/v1.132.4...v1.132.5)
|
|
23
|
+
|
|
24
|
+
<sup>Released on **2025-09-22**</sup>
|
|
25
|
+
|
|
26
|
+
#### ♻ Code Refactoring
|
|
27
|
+
|
|
28
|
+
- **misc**: Move the ModelProvider to model-bank.
|
|
29
|
+
|
|
30
|
+
<br/>
|
|
31
|
+
|
|
32
|
+
<details>
|
|
33
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
34
|
+
|
|
35
|
+
#### Code refactoring
|
|
36
|
+
|
|
37
|
+
- **misc**: Move the ModelProvider to model-bank, closes [#9374](https://github.com/lobehub/lobe-chat/issues/9374) ([d9a4361](https://github.com/lobehub/lobe-chat/commit/d9a4361))
|
|
38
|
+
|
|
39
|
+
</details>
|
|
40
|
+
|
|
41
|
+
<div align="right">
|
|
42
|
+
|
|
43
|
+
[](#readme-top)
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
|
|
5
47
|
### [Version 1.132.4](https://github.com/lobehub/lobe-chat/compare/v1.132.3...v1.132.4)
|
|
6
48
|
|
|
7
49
|
<sup>Released on **2025-09-22**</sup>
|
|
@@ -7,6 +7,7 @@ const packageJSON = require('./package.json');
|
|
|
7
7
|
|
|
8
8
|
const channel = process.env.UPDATE_CHANNEL;
|
|
9
9
|
const arch = os.arch();
|
|
10
|
+
const hasAppleCertificate = Boolean(process.env.APPLE_CERTIFICATE_BASE64);
|
|
10
11
|
|
|
11
12
|
console.log(`🚄 Build Version ${packageJSON.version}, Channel: ${channel}`);
|
|
12
13
|
console.log(`🏗️ Building for architecture: ${arch}`);
|
|
@@ -14,6 +15,13 @@ console.log(`🏗️ Building for architecture: ${arch}`);
|
|
|
14
15
|
const isNightly = channel === 'nightly';
|
|
15
16
|
const isBeta = packageJSON.name.includes('beta');
|
|
16
17
|
|
|
18
|
+
// https://www.electron.build/code-signing-mac?utm_source=openai#how-to-disable-code-signing-during-the-build-process-on-macos
|
|
19
|
+
if (!hasAppleCertificate) {
|
|
20
|
+
// Disable auto discovery to keep electron-builder from searching unavailable signing identities
|
|
21
|
+
process.env.CSC_IDENTITY_AUTO_DISCOVERY = 'false';
|
|
22
|
+
console.log('⚠️ Apple certificate not found, macOS artifacts will be unsigned.');
|
|
23
|
+
}
|
|
24
|
+
|
|
17
25
|
// 根据版本类型确定协议 scheme
|
|
18
26
|
const getProtocolScheme = () => {
|
|
19
27
|
if (isNightly) return 'lobehub-nightly';
|
|
@@ -87,8 +95,9 @@ const config = {
|
|
|
87
95
|
NSMicrophoneUsageDescription: "Application requests access to the device's microphone.",
|
|
88
96
|
},
|
|
89
97
|
gatekeeperAssess: false,
|
|
90
|
-
hardenedRuntime:
|
|
91
|
-
notarize:
|
|
98
|
+
hardenedRuntime: hasAppleCertificate,
|
|
99
|
+
notarize: hasAppleCertificate,
|
|
100
|
+
...(hasAppleCertificate ? {} : { identity: null }),
|
|
92
101
|
target:
|
|
93
102
|
// 降低构建时间,nightly 只打 dmg
|
|
94
103
|
// 根据当前机器架构只构建对应架构的包
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, it, vi, Mock } from 'vitest';
|
|
2
1
|
import { InterceptRouteParams } from '@lobechat/electron-client-ipc';
|
|
2
|
+
import { Mock, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
3
|
|
|
4
|
+
import { AppBrowsersIdentifiers, BrowsersIdentifiers } from '@/appBrowsers';
|
|
4
5
|
import type { App } from '@/core/App';
|
|
5
6
|
import type { IpcClientEventSender } from '@/types/ipcClientEvent';
|
|
6
|
-
import { BrowsersIdentifiers, AppBrowsersIdentifiers } from '@/appBrowsers';
|
|
7
7
|
|
|
8
8
|
import BrowserWindowsCtr from '../BrowserWindowsCtr';
|
|
9
9
|
|
|
@@ -33,12 +33,14 @@ const mockApp = {
|
|
|
33
33
|
closeWindow: mockCloseWindow,
|
|
34
34
|
minimizeWindow: mockMinimizeWindow,
|
|
35
35
|
maximizeWindow: mockMaximizeWindow,
|
|
36
|
-
retrieveByIdentifier: mockRetrieveByIdentifier.mockImplementation(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
retrieveByIdentifier: mockRetrieveByIdentifier.mockImplementation(
|
|
37
|
+
(identifier: AppBrowsersIdentifiers | string) => {
|
|
38
|
+
if (identifier === BrowsersIdentifiers.settings || identifier === 'some-other-window') {
|
|
39
|
+
return { show: mockShow };
|
|
40
|
+
}
|
|
41
|
+
return { show: mockShow }; // Default mock for other identifiers
|
|
42
|
+
},
|
|
43
|
+
),
|
|
42
44
|
},
|
|
43
45
|
} as unknown as App;
|
|
44
46
|
|
|
@@ -104,7 +106,11 @@ describe('BrowserWindowsCtr', () => {
|
|
|
104
106
|
const baseParams = { source: 'link-click' as const };
|
|
105
107
|
|
|
106
108
|
it('should not intercept if no matching route is found', async () => {
|
|
107
|
-
const params: InterceptRouteParams = {
|
|
109
|
+
const params: InterceptRouteParams = {
|
|
110
|
+
...baseParams,
|
|
111
|
+
path: '/unknown/route',
|
|
112
|
+
url: 'app://host/unknown/route',
|
|
113
|
+
};
|
|
108
114
|
(findMatchingRoute as Mock).mockReturnValue(undefined);
|
|
109
115
|
const result = await browserWindowsCtr.interceptRoute(params);
|
|
110
116
|
expect(findMatchingRoute).toHaveBeenCalledWith(params.path);
|
|
@@ -112,7 +118,11 @@ describe('BrowserWindowsCtr', () => {
|
|
|
112
118
|
});
|
|
113
119
|
|
|
114
120
|
it('should show settings window if matched route target is settings', async () => {
|
|
115
|
-
const params: InterceptRouteParams = {
|
|
121
|
+
const params: InterceptRouteParams = {
|
|
122
|
+
...baseParams,
|
|
123
|
+
path: '/settings?active=common',
|
|
124
|
+
url: 'app://host/settings?active=common',
|
|
125
|
+
};
|
|
116
126
|
const matchedRoute = { targetWindow: BrowsersIdentifiers.settings, pathPrefix: '/settings' };
|
|
117
127
|
const subPath = 'common';
|
|
118
128
|
(findMatchingRoute as Mock).mockReturnValue(matchedRoute);
|
|
@@ -134,7 +144,11 @@ describe('BrowserWindowsCtr', () => {
|
|
|
134
144
|
});
|
|
135
145
|
|
|
136
146
|
it('should open target window if matched route target is not settings', async () => {
|
|
137
|
-
const params: InterceptRouteParams = {
|
|
147
|
+
const params: InterceptRouteParams = {
|
|
148
|
+
...baseParams,
|
|
149
|
+
path: '/other/page',
|
|
150
|
+
url: 'app://host/other/page',
|
|
151
|
+
};
|
|
138
152
|
const targetWindowIdentifier = 'some-other-window' as AppBrowsersIdentifiers;
|
|
139
153
|
const matchedRoute = { targetWindow: targetWindowIdentifier, pathPrefix: '/other' };
|
|
140
154
|
(findMatchingRoute as Mock).mockReturnValue(matchedRoute);
|
|
@@ -154,7 +168,11 @@ describe('BrowserWindowsCtr', () => {
|
|
|
154
168
|
});
|
|
155
169
|
|
|
156
170
|
it('should return error if processing route interception fails for settings', async () => {
|
|
157
|
-
const params: InterceptRouteParams = {
|
|
171
|
+
const params: InterceptRouteParams = {
|
|
172
|
+
...baseParams,
|
|
173
|
+
path: '/settings?active=general',
|
|
174
|
+
url: 'app://host/settings?active=general',
|
|
175
|
+
};
|
|
158
176
|
const matchedRoute = { targetWindow: BrowsersIdentifiers.settings, pathPrefix: '/settings' };
|
|
159
177
|
const subPath = 'general';
|
|
160
178
|
const errorMessage = 'Processing error for settings';
|
|
@@ -173,7 +191,11 @@ describe('BrowserWindowsCtr', () => {
|
|
|
173
191
|
});
|
|
174
192
|
|
|
175
193
|
it('should return error if processing route interception fails for other window', async () => {
|
|
176
|
-
const params: InterceptRouteParams = {
|
|
194
|
+
const params: InterceptRouteParams = {
|
|
195
|
+
...baseParams,
|
|
196
|
+
path: '/another/custom',
|
|
197
|
+
url: 'app://host/another/custom',
|
|
198
|
+
};
|
|
177
199
|
const targetWindowIdentifier = 'another-custom-window' as AppBrowsersIdentifiers;
|
|
178
200
|
const matchedRoute = { targetWindow: targetWindowIdentifier, pathPrefix: '/another' };
|
|
179
201
|
const errorMessage = 'Processing error for other window';
|
|
@@ -192,4 +214,4 @@ describe('BrowserWindowsCtr', () => {
|
|
|
192
214
|
});
|
|
193
215
|
});
|
|
194
216
|
});
|
|
195
|
-
});
|
|
217
|
+
});
|
package/changelog/v1.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"children": {},
|
|
4
|
+
"date": "2025-09-23",
|
|
5
|
+
"version": "1.132.6"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"children": {
|
|
9
|
+
"improvements": [
|
|
10
|
+
"Move the ModelProvider to model-bank."
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"date": "2025-09-22",
|
|
14
|
+
"version": "1.132.5"
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"children": {
|
|
4
18
|
"improvements": [
|
package/next.config.ts
CHANGED
|
@@ -244,11 +244,11 @@ const nextConfig: NextConfig = {
|
|
|
244
244
|
permanent: true,
|
|
245
245
|
source: '/discover/providers',
|
|
246
246
|
},
|
|
247
|
-
{
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
},
|
|
247
|
+
// {
|
|
248
|
+
// destination: '/settings/common',
|
|
249
|
+
// permanent: true,
|
|
250
|
+
// source: '/settings',
|
|
251
|
+
// },
|
|
252
252
|
{
|
|
253
253
|
destination: '/chat',
|
|
254
254
|
permanent: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "1.132.
|
|
3
|
+
"version": "1.132.6",
|
|
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,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const enableClerk = authEnv.NEXT_PUBLIC_ENABLE_CLERK_AUTH;
|
|
4
|
-
export const enableNextAuth = authEnv.NEXT_PUBLIC_ENABLE_NEXT_AUTH;
|
|
1
|
+
export const enableClerk = !!process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY;
|
|
2
|
+
export const enableNextAuth = process.env.NEXT_PUBLIC_ENABLE_NEXT_AUTH === '1';
|
|
5
3
|
export const enableAuth = enableClerk || enableNextAuth || false;
|
|
6
4
|
|
|
7
5
|
export const LOBE_CHAT_AUTH_HEADER = 'X-lobe-chat-auth';
|
|
@@ -4,7 +4,7 @@ import { describe, expect, it, vi } from 'vitest';
|
|
|
4
4
|
import { genUserLLMConfig } from './genUserLLMConfig';
|
|
5
5
|
|
|
6
6
|
// Mock ModelProvider enum
|
|
7
|
-
vi.mock('
|
|
7
|
+
vi.mock('model-bank', () => ({
|
|
8
8
|
ModelProvider: {
|
|
9
9
|
Ollama: 'ollama',
|
|
10
10
|
OpenAI: 'openai',
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"test:update": "vitest -u"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"@lobechat/prompts": "workspace:*",
|
|
22
|
+
"@lobechat/types": "workspace:*",
|
|
23
|
+
"@lobechat/utils": "workspace:*",
|
|
21
24
|
"debug": "^4.3.4",
|
|
22
25
|
"immer": "^10.0.3",
|
|
23
26
|
"lodash-es": "^4.17.21"
|
|
@@ -25,16 +28,5 @@
|
|
|
25
28
|
"devDependencies": {
|
|
26
29
|
"@types/debug": "^4.1.12",
|
|
27
30
|
"@types/lodash-es": "^4.17.12"
|
|
28
|
-
},
|
|
29
|
-
"peerDependencies": {
|
|
30
|
-
"@lobechat/const": "workspace:*",
|
|
31
|
-
"@lobechat/model-runtime": "workspace:*",
|
|
32
|
-
"@lobechat/prompts": "workspace:*",
|
|
33
|
-
"@lobechat/types": "workspace:*",
|
|
34
|
-
"@lobechat/utils": "workspace:*"
|
|
35
|
-
},
|
|
36
|
-
"publishConfig": {
|
|
37
|
-
"access": "public",
|
|
38
|
-
"registry": "https://registry.npmjs.org"
|
|
39
31
|
}
|
|
40
32
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @vitest-environment node
|
|
2
|
-
import { ModelProvider } from '@lobechat/model-runtime';
|
|
3
2
|
import { eq } from 'drizzle-orm';
|
|
3
|
+
import { ModelProvider } from 'model-bank';
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
5
|
|
|
6
6
|
import { sleep } from '@/utils/sleep';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ModelProvider } from '@lobechat/model-runtime';
|
|
2
1
|
import { and, asc, desc, eq } from 'drizzle-orm';
|
|
3
2
|
import { isEmpty } from 'lodash-es';
|
|
3
|
+
import { ModelProvider } from 'model-bank';
|
|
4
4
|
|
|
5
5
|
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
|
6
|
-
import { LobeChatDatabase } from '../type';
|
|
7
6
|
import {
|
|
8
7
|
AiProviderDetailItem,
|
|
9
8
|
AiProviderListItem,
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
import { merge } from '@/utils/merge';
|
|
15
14
|
|
|
16
15
|
import { AiProviderSelectItem, aiModels, aiProviders } from '../schemas';
|
|
16
|
+
import { LobeChatDatabase } from '../type';
|
|
17
17
|
|
|
18
18
|
type DecryptUserKeyVaults = (encryptKeyVaultsStr: string | null) => Promise<any>;
|
|
19
19
|
|
|
@@ -186,7 +186,7 @@ export class AiInfraRepos {
|
|
|
186
186
|
};
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
|
-
* use in the `/settings
|
|
189
|
+
* use in the `/settings?active=provider&provider=[id]` page
|
|
190
190
|
*/
|
|
191
191
|
getAiProviderDetail = async (id: string, decryptor?: DecryptUserKeyVaults) => {
|
|
192
192
|
const config = await this.aiProviderModel.getAiProviderById(id, decryptor);
|
|
@@ -3,12 +3,13 @@ import { TraceNameMap } from '@lobechat/types';
|
|
|
3
3
|
import { ClientSecretPayload } from '@lobechat/types';
|
|
4
4
|
import { Langfuse } from 'langfuse';
|
|
5
5
|
import { LangfuseGenerationClient, LangfuseTraceClient } from 'langfuse-core';
|
|
6
|
+
import { ModelProvider } from 'model-bank';
|
|
6
7
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
7
8
|
|
|
8
9
|
import * as langfuseCfg from '@/envs/langfuse';
|
|
9
10
|
import { createTraceOptions } from '@/server/modules/ModelRuntime';
|
|
10
11
|
|
|
11
|
-
import { ChatStreamPayload, LobeOpenAI,
|
|
12
|
+
import { ChatStreamPayload, LobeOpenAI, ModelRuntime } from '../index';
|
|
12
13
|
import { providerRuntimeMap } from '../runtimeMap';
|
|
13
14
|
import { CreateImagePayload } from '../types/image';
|
|
14
15
|
import { AgentChatOptions } from './ModelRuntime';
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
ChatStreamCallbacks,
|
|
5
5
|
ChatStreamPayload,
|
|
6
6
|
LobeOpenAICompatibleRuntime,
|
|
7
|
-
ModelProvider,
|
|
8
7
|
} from '@lobechat/model-runtime';
|
|
8
|
+
import { ModelProvider } from 'model-bank';
|
|
9
9
|
import OpenAI from 'openai';
|
|
10
10
|
import type { Stream } from 'openai/streaming';
|
|
11
11
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
@@ -62,7 +62,11 @@ describe('LobeOpenAICompatibleFactory', () => {
|
|
|
62
62
|
if (typeof File === 'undefined') {
|
|
63
63
|
// @ts-ignore
|
|
64
64
|
global.File = class MockFile {
|
|
65
|
-
constructor(
|
|
65
|
+
constructor(
|
|
66
|
+
public parts: any[],
|
|
67
|
+
public name: string,
|
|
68
|
+
public opts?: any,
|
|
69
|
+
) {}
|
|
66
70
|
};
|
|
67
71
|
}
|
|
68
72
|
|
|
@@ -166,11 +170,7 @@ describe('LobeOpenAICompatibleFactory', () => {
|
|
|
166
170
|
}
|
|
167
171
|
// Assert that all expected chunk patterns are present
|
|
168
172
|
expect(chunks).toEqual(
|
|
169
|
-
expect.arrayContaining([
|
|
170
|
-
'id: a\n',
|
|
171
|
-
'event: text\n',
|
|
172
|
-
'data: "hello"\n\n',
|
|
173
|
-
]),
|
|
173
|
+
expect.arrayContaining(['id: a\n', 'event: text\n', 'data: "hello"\n\n']),
|
|
174
174
|
);
|
|
175
175
|
});
|
|
176
176
|
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
Embeddings,
|
|
17
17
|
EmbeddingsOptions,
|
|
18
18
|
EmbeddingsPayload,
|
|
19
|
-
ModelProvider,
|
|
20
19
|
TextToImagePayload,
|
|
21
20
|
TextToSpeechOptions,
|
|
22
21
|
TextToSpeechPayload,
|
|
@@ -404,7 +403,7 @@ export const createOpenAICompatibleRuntime = <T extends Record<string, any> = an
|
|
|
404
403
|
endpoint: desensitizedEndpoint,
|
|
405
404
|
error: error as any,
|
|
406
405
|
errorType: ErrorType.invalidAPIKey,
|
|
407
|
-
provider: this.id
|
|
406
|
+
provider: this.id,
|
|
408
407
|
});
|
|
409
408
|
}
|
|
410
409
|
|
|
@@ -422,7 +421,7 @@ export const createOpenAICompatibleRuntime = <T extends Record<string, any> = an
|
|
|
422
421
|
endpoint: desensitizedEndpoint,
|
|
423
422
|
error: errorResult,
|
|
424
423
|
errorType: AgentRuntimeErrorType.InsufficientQuota,
|
|
425
|
-
provider: this.id
|
|
424
|
+
provider: this.id,
|
|
426
425
|
});
|
|
427
426
|
}
|
|
428
427
|
|
|
@@ -431,7 +430,7 @@ export const createOpenAICompatibleRuntime = <T extends Record<string, any> = an
|
|
|
431
430
|
endpoint: desensitizedEndpoint,
|
|
432
431
|
error: errorResult,
|
|
433
432
|
errorType: AgentRuntimeErrorType.ModelNotFound,
|
|
434
|
-
provider: this.id
|
|
433
|
+
provider: this.id,
|
|
435
434
|
});
|
|
436
435
|
}
|
|
437
436
|
|
|
@@ -442,7 +441,7 @@ export const createOpenAICompatibleRuntime = <T extends Record<string, any> = an
|
|
|
442
441
|
endpoint: desensitizedEndpoint,
|
|
443
442
|
error: errorResult,
|
|
444
443
|
errorType: AgentRuntimeErrorType.ExceededContextWindow,
|
|
445
|
-
provider: this.id
|
|
444
|
+
provider: this.id,
|
|
446
445
|
});
|
|
447
446
|
}
|
|
448
447
|
}
|
|
@@ -451,7 +450,7 @@ export const createOpenAICompatibleRuntime = <T extends Record<string, any> = an
|
|
|
451
450
|
endpoint: desensitizedEndpoint,
|
|
452
451
|
error: errorResult,
|
|
453
452
|
errorType: RuntimeError || ErrorType.bizError,
|
|
454
|
-
provider: this.id
|
|
453
|
+
provider: this.id,
|
|
455
454
|
});
|
|
456
455
|
}
|
|
457
456
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ModelProvider } from 'model-bank';
|
|
2
|
+
|
|
1
3
|
import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
|
|
2
|
-
import { ModelProvider } from '../../types';
|
|
3
4
|
|
|
4
5
|
export const LobeAi21AI = createOpenAICompatibleRuntime({
|
|
5
6
|
baseURL: 'https://api.ai21.com/studio/v1',
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { ModelProvider } from 'model-bank';
|
|
2
|
+
|
|
1
3
|
import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
|
|
2
|
-
import { ChatCompletionErrorPayload
|
|
4
|
+
import { ChatCompletionErrorPayload } from '../../types';
|
|
3
5
|
import { AgentRuntimeErrorType } from '../../types/error';
|
|
4
6
|
import { processMultiProviderModelList } from '../../utils/modelParse';
|
|
5
7
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { ModelProvider } from 'model-bank';
|
|
2
|
+
|
|
1
3
|
import type { ChatModelCard } from '@/types/llm';
|
|
2
4
|
|
|
3
5
|
import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
|
|
4
|
-
import { ModelProvider } from '../../types';
|
|
5
6
|
|
|
6
7
|
export interface Ai360ModelCard {
|
|
7
8
|
id: string;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { LOBE_DEFAULT_MODEL_LIST } from 'model-bank';
|
|
1
|
+
import { LOBE_DEFAULT_MODEL_LIST, ModelProvider } from 'model-bank';
|
|
2
2
|
import urlJoin from 'url-join';
|
|
3
3
|
|
|
4
4
|
import { responsesAPIModels } from '../../const/models';
|
|
5
5
|
import { createRouterRuntime } from '../../core/RouterRuntime';
|
|
6
|
-
import { ModelProvider } from '../../types';
|
|
7
6
|
import { ChatStreamPayload } from '../../types/chat';
|
|
8
7
|
import { detectModelProvider, processMultiProviderModelList } from '../../utils/modelParse';
|
|
9
8
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { ModelProvider } from 'model-bank';
|
|
2
|
+
|
|
1
3
|
import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
|
|
2
|
-
import { ModelProvider } from '../../types';
|
|
3
4
|
import { processMultiProviderModelList } from '../../utils/modelParse';
|
|
4
5
|
|
|
5
|
-
const THINKING_MODELS = [
|
|
6
|
-
'DeepSeek-V3-1',
|
|
7
|
-
];
|
|
6
|
+
const THINKING_MODELS = ['DeepSeek-V3-1'];
|
|
8
7
|
|
|
9
8
|
export interface AkashChatModelCard {
|
|
10
9
|
id: string;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import Anthropic, { ClientOptions } from '@anthropic-ai/sdk';
|
|
2
|
+
import { ModelProvider } from 'model-bank';
|
|
2
3
|
|
|
3
4
|
import { LobeRuntimeAI } from '../../core/BaseAI';
|
|
4
5
|
import { AnthropicStream } from '../../core/streams';
|
|
5
|
-
import {
|
|
6
|
-
type ChatCompletionErrorPayload,
|
|
7
|
-
ChatMethodOptions,
|
|
8
|
-
ChatStreamPayload,
|
|
9
|
-
ModelProvider,
|
|
10
|
-
} from '../../types';
|
|
6
|
+
import { type ChatCompletionErrorPayload, ChatMethodOptions, ChatStreamPayload } from '../../types';
|
|
11
7
|
import { AgentRuntimeErrorType } from '../../types/error';
|
|
12
8
|
import { buildAnthropicMessages, buildAnthropicTools } from '../../utils/anthropicHelpers';
|
|
13
9
|
import { AgentRuntimeError } from '../../utils/createError';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import debug from 'debug';
|
|
2
|
+
import { ModelProvider } from 'model-bank';
|
|
2
3
|
import OpenAI, { AzureOpenAI } from 'openai';
|
|
3
4
|
import type { Stream } from 'openai/streaming';
|
|
4
5
|
|
|
@@ -12,7 +13,6 @@ import {
|
|
|
12
13
|
Embeddings,
|
|
13
14
|
EmbeddingsOptions,
|
|
14
15
|
EmbeddingsPayload,
|
|
15
|
-
ModelProvider,
|
|
16
16
|
} from '../../types';
|
|
17
17
|
import { AgentRuntimeErrorType } from '../../types/error';
|
|
18
18
|
import { CreateImagePayload, CreateImageResponse } from '../../types/image';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import createClient, { ModelClient } from '@azure-rest/ai-inference';
|
|
2
2
|
import { AzureKeyCredential } from '@azure/core-auth';
|
|
3
|
+
import { ModelProvider } from 'model-bank';
|
|
3
4
|
import OpenAI from 'openai';
|
|
4
5
|
|
|
5
6
|
import { systemToUserModels } from '../../const/models';
|
|
6
7
|
import { LobeRuntimeAI } from '../../core/BaseAI';
|
|
7
8
|
import { transformResponseToStream } from '../../core/openaiCompatibleFactory';
|
|
8
9
|
import { OpenAIStream, createSSEDataExtractor } from '../../core/streams';
|
|
9
|
-
import { ChatMethodOptions, ChatStreamPayload
|
|
10
|
+
import { ChatMethodOptions, ChatStreamPayload } from '../../types';
|
|
10
11
|
import { AgentRuntimeErrorType } from '../../types/error';
|
|
11
12
|
import { AgentRuntimeError } from '../../utils/createError';
|
|
12
13
|
import { debugStream } from '../../utils/debugStream';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @vitest-environment node
|
|
2
|
-
import { LobeOpenAICompatibleRuntime
|
|
2
|
+
import { LobeOpenAICompatibleRuntime } from '@lobechat/model-runtime';
|
|
3
|
+
import { ModelProvider } from 'model-bank';
|
|
3
4
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
5
|
|
|
5
6
|
import { testProvider } from '../../providerTestUtils';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { ChatModelCard } from '
|
|
1
|
+
import type { ChatModelCard } from '@lobechat/types';
|
|
2
|
+
import { ModelProvider } from 'model-bank';
|
|
2
3
|
|
|
3
4
|
import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
|
|
4
|
-
import { ChatStreamPayload
|
|
5
|
+
import { ChatStreamPayload } from '../../types';
|
|
5
6
|
|
|
6
7
|
export interface BaichuanModelCard {
|
|
7
8
|
function_call: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @vitest-environment node
|
|
2
2
|
import { InvokeModelWithResponseStreamCommand } from '@aws-sdk/client-bedrock-runtime';
|
|
3
|
-
import { AgentRuntimeErrorType
|
|
3
|
+
import { AgentRuntimeErrorType } from '@lobechat/model-runtime';
|
|
4
|
+
import { ModelProvider } from 'model-bank';
|
|
4
5
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
6
|
|
|
6
7
|
import * as debugStreamModule from '../../utils/debugStream';
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
InvokeModelCommand,
|
|
4
4
|
InvokeModelWithResponseStreamCommand,
|
|
5
5
|
} from '@aws-sdk/client-bedrock-runtime';
|
|
6
|
+
import { ModelProvider } from 'model-bank';
|
|
6
7
|
|
|
7
8
|
import { LobeRuntimeAI } from '../../core/BaseAI';
|
|
8
9
|
import {
|
|
@@ -16,7 +17,6 @@ import {
|
|
|
16
17
|
Embeddings,
|
|
17
18
|
EmbeddingsOptions,
|
|
18
19
|
EmbeddingsPayload,
|
|
19
|
-
ModelProvider,
|
|
20
20
|
} from '../../types';
|
|
21
21
|
import { AgentRuntimeErrorType } from '../../types/error';
|
|
22
22
|
import { buildAnthropicMessages, buildAnthropicTools } from '../../utils/anthropicHelpers';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ChatModelCard } from '
|
|
1
|
+
import type { ChatModelCard } from '@lobechat/types';
|
|
2
|
+
import { ModelProvider } from 'model-bank';
|
|
2
3
|
|
|
3
4
|
import { LobeRuntimeAI } from '../../core/BaseAI';
|
|
4
5
|
import { createCallbacksTransformer } from '../../core/streams';
|
|
5
|
-
import { ChatMethodOptions, ChatStreamPayload
|
|
6
|
+
import { ChatMethodOptions, ChatStreamPayload } from '../../types';
|
|
6
7
|
import { AgentRuntimeErrorType } from '../../types/error';
|
|
7
8
|
import {
|
|
8
9
|
CloudflareStreamTransformer,
|