@lobehub/chat 1.35.4 → 1.35.5
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 +25 -0
- package/README.md +8 -8
- package/README.zh-CN.md +2 -2
- package/changelog/v1.json +9 -0
- package/docs/usage/providers/giteeai.mdx +79 -0
- package/docs/usage/providers/giteeai.zh-CN.mdx +75 -0
- package/docs/usage/providers/internlm.mdx +70 -0
- package/docs/usage/providers/internlm.zh-CN.mdx +66 -0
- package/docs/usage/providers/sensenova.mdx +79 -0
- package/docs/usage/providers/sensenova.zh-CN.mdx +75 -0
- package/docs/usage/providers/xai.mdx +70 -0
- package/docs/usage/providers/xai.zh-CN.mdx +66 -0
- package/package.json +1 -1
- package/src/database/{client → _deprecated}/models/__DEBUG.ts +3 -3
- package/src/database/{client → _deprecated}/models/__tests__/session.test.ts +3 -3
- package/src/database/{client → _deprecated}/models/__tests__/sessionGroup.test.ts +1 -1
- package/src/database/{client → _deprecated}/models/__tests__/topic.test.ts +4 -4
- package/src/database/{client → _deprecated}/models/file.ts +2 -2
- package/src/database/{client → _deprecated}/models/message.ts +3 -3
- package/src/database/{client → _deprecated}/models/plugin.ts +1 -1
- package/src/database/{client → _deprecated}/models/session.ts +3 -3
- package/src/database/{client → _deprecated}/models/sessionGroup.ts +2 -2
- package/src/database/{client → _deprecated}/models/topic.ts +4 -4
- package/src/database/{client → _deprecated}/models/user.ts +1 -1
- package/src/database/{client → _deprecated}/schemas/user.ts +1 -1
- package/src/services/__tests__/sync.test.ts +2 -2
- package/src/services/debug.ts +1 -1
- package/src/services/file/client.test.ts +3 -3
- package/src/services/file/client.ts +2 -2
- package/src/services/import/client.ts +4 -4
- package/src/services/message/client.test.ts +2 -2
- package/src/services/message/client.ts +3 -3
- package/src/services/message/index.test.ts +2 -2
- package/src/services/message/type.ts +1 -1
- package/src/services/plugin/client.test.ts +3 -3
- package/src/services/plugin/client.ts +1 -1
- package/src/services/session/client.test.ts +4 -4
- package/src/services/session/client.ts +3 -3
- package/src/services/sync.ts +1 -1
- package/src/services/topic/client.test.ts +3 -3
- package/src/services/topic/client.ts +1 -1
- package/src/services/upload.ts +1 -1
- package/src/services/user/client.test.ts +2 -2
- package/src/services/user/client.ts +3 -3
- package/src/store/file/slices/chat/action.test.ts +1 -1
- package/src/types/sync.ts +1 -1
- /package/src/database/{client → _deprecated}/core/__tests__/db-upgrade.test.ts +0 -0
- /package/src/database/{client → _deprecated}/core/__tests__/db.test.ts +0 -0
- /package/src/database/{client → _deprecated}/core/__tests__/model.test.ts +0 -0
- /package/src/database/{client → _deprecated}/core/db.ts +0 -0
- /package/src/database/{client → _deprecated}/core/index.ts +0 -0
- /package/src/database/{client → _deprecated}/core/migrations/migrateSettingsToUser/fixtures/input.json +0 -0
- /package/src/database/{client → _deprecated}/core/migrations/migrateSettingsToUser/fixtures/output.json +0 -0
- /package/src/database/{client → _deprecated}/core/migrations/migrateSettingsToUser/index.test.ts +0 -0
- /package/src/database/{client → _deprecated}/core/migrations/migrateSettingsToUser/index.ts +0 -0
- /package/src/database/{client → _deprecated}/core/migrations/migrateSettingsToUser/type.ts +0 -0
- /package/src/database/{client → _deprecated}/core/model.ts +0 -0
- /package/src/database/{client → _deprecated}/core/schemas.ts +0 -0
- /package/src/database/{client → _deprecated}/core/sync.ts +0 -0
- /package/src/database/{client → _deprecated}/core/types/db.ts +0 -0
- /package/src/database/{client → _deprecated}/models/__tests__/file.test.ts +0 -0
- /package/src/database/{client → _deprecated}/models/__tests__/message.test.ts +0 -0
- /package/src/database/{client → _deprecated}/models/__tests__/plugin.test.ts +0 -0
- /package/src/database/{client → _deprecated}/models/__tests__/user.test.ts +0 -0
- /package/src/database/{client → _deprecated}/schemas/files.ts +0 -0
- /package/src/database/{client → _deprecated}/schemas/message.ts +0 -0
- /package/src/database/{client → _deprecated}/schemas/plugin.ts +0 -0
- /package/src/database/{client → _deprecated}/schemas/session.ts +0 -0
- /package/src/database/{client → _deprecated}/schemas/sessionGroup.ts +0 -0
- /package/src/database/{client → _deprecated}/schemas/topic.ts +0 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.35.5](https://github.com/lobehub/lobe-chat/compare/v1.35.4...v1.35.5)
|
6
|
+
|
7
|
+
<sup>Released on **2024-12-02**</sup>
|
8
|
+
|
9
|
+
#### ♻ Code Refactoring
|
10
|
+
|
11
|
+
- **misc**: Deprecated the current client mode code.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Code refactoring
|
19
|
+
|
20
|
+
- **misc**: Deprecated the current client mode code, closes [#4866](https://github.com/lobehub/lobe-chat/issues/4866) ([7dff458](https://github.com/lobehub/lobe-chat/commit/7dff458))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
5
30
|
### [Version 1.35.4](https://github.com/lobehub/lobe-chat/compare/v1.35.3...v1.35.4)
|
6
31
|
|
7
32
|
<sup>Released on **2024-12-02**</sup>
|
package/README.md
CHANGED
@@ -246,14 +246,14 @@ In addition, these plugins are not limited to news aggregation, but can also ext
|
|
246
246
|
|
247
247
|
<!-- PLUGIN LIST -->
|
248
248
|
|
249
|
-
| Recent Submits
|
250
|
-
|
|
251
|
-
| [
|
252
|
-
| [
|
253
|
-
| [
|
254
|
-
| [
|
255
|
-
|
256
|
-
> 📊 Total plugins: [<kbd>**
|
249
|
+
| Recent Submits | Description |
|
250
|
+
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
251
|
+
| [Google CSE](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **vsnthdev** on **2024-12-02**</sup> | Searches Google through their official CSE API.<br/>`web` `search` |
|
252
|
+
| [Google CSE](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **vsnthdev** on **2024-12-02**</sup> | Searches Google through their official CSE API.<br/>`web` `search` |
|
253
|
+
| [Speak](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **speak** on **2024-12-02**</sup> | Learn how to say anything in another language with Speak, your AI-powered language tutor.<br/>`education` `language` |
|
254
|
+
| [Speak](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **speak** on **2024-12-02**</sup> | Learn how to say anything in another language with Speak, your AI-powered language tutor.<br/>`education` `language` |
|
255
|
+
|
256
|
+
> 📊 Total plugins: [<kbd>**98**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
257
257
|
|
258
258
|
<!-- PLUGIN LIST -->
|
259
259
|
|
package/README.zh-CN.md
CHANGED
@@ -241,10 +241,10 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
241
241
|
|
242
242
|
| 最近新增 | 插件描述 |
|
243
243
|
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
244
|
+
| [谷歌自定义搜索引擎](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **vsnthdev** on **2024-12-02**</sup> | 通过他们的官方自定义搜索引擎 API 搜索谷歌。<br/>`网络` `搜索` |
|
245
|
+
| [Speak](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **speak** on **2024-12-02**</sup> | 使用 Speak,您的 AI 语言导师,学习如何用另一种语言说任何事情。<br/>`教育` `语言` |
|
244
246
|
| [通义万象图像生成器](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **YoungTx** on **2024-08-09**</sup> | 此插件使用阿里巴巴的通义万象模型根据文本提示生成图像。<br/>`图像` `通义` `万象` |
|
245
247
|
| [购物工具](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **shoppingtools** on **2024-07-19**</sup> | 在 eBay 和 AliExpress 上搜索产品,查找 eBay 活动和优惠券。获取快速示例。<br/>`购物` `e-bay` `ali-express` `优惠券` |
|
246
|
-
| [Savvy Trader AI](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **savvytrader** on **2024-06-27**</sup> | 实时股票、加密货币和其他投资数据。<br/>`股票` `分析` |
|
247
|
-
| [Search1API](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **fatwang2** on **2024-05-06**</sup> | 搜索聚合服务,专为 LLMs 设计<br/>`web` `search` |
|
248
248
|
|
249
249
|
> 📊 Total plugins: [<kbd>**49**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
250
250
|
|
package/changelog/v1.json
CHANGED
@@ -0,0 +1,79 @@
|
|
1
|
+
---
|
2
|
+
title: Using Gitee AI in LobeChat
|
3
|
+
description: >-
|
4
|
+
Learn how to configure and use Gitee AI's API Key in LobeChat to start
|
5
|
+
conversations and interactions.
|
6
|
+
tags:
|
7
|
+
- LobeChat
|
8
|
+
- Gitee AI
|
9
|
+
- API Key
|
10
|
+
- Web UI
|
11
|
+
---
|
12
|
+
|
13
|
+
# Using Gitee AI in LobeChat
|
14
|
+
|
15
|
+
<Image
|
16
|
+
cover
|
17
|
+
src={'https://github.com/user-attachments/assets/f9ccce84-4fd4-48ca-9450-40660112d0d7'}
|
18
|
+
/>
|
19
|
+
|
20
|
+
[Gitee AI](https://ai.gitee.com/) is an open-source platform based on Git code hosting technology, specifically designed for AI application scenarios. It aims to provide developers and businesses with a one-stop solution for AI application development services, including model experience, inference, fine-tuning, and deployment.
|
21
|
+
|
22
|
+
This article will guide you on how to use Gitee AI in LobeChat.
|
23
|
+
|
24
|
+
<Steps>
|
25
|
+
|
26
|
+
### Step 1: Obtain the Gitee AI API Key
|
27
|
+
|
28
|
+
- Register and log in to the [Gitee AI official website](https://ai.gitee.com/)
|
29
|
+
- Purchase and recharge `Serverless API` from your dashboard
|
30
|
+
|
31
|
+
<Image
|
32
|
+
alt={'Gitee Serverless API'}
|
33
|
+
inStep
|
34
|
+
src={'https://github.com/user-attachments/assets/c77fcf70-9039-49ff-86e4-f8eaa267bbf6'}
|
35
|
+
/>
|
36
|
+
|
37
|
+
- In `Settings`, click on the `Access Tokens` section
|
38
|
+
- Create a new access token
|
39
|
+
- Save the access token in the pop-up window
|
40
|
+
|
41
|
+
<Image
|
42
|
+
alt={'Gitee Serverless API'}
|
43
|
+
inStep
|
44
|
+
src={'https://github.com/user-attachments/assets/0af85438-ac99-4c95-b888-a17e88ede043'}
|
45
|
+
/>
|
46
|
+
|
47
|
+
<Callout type={'warning'}>
|
48
|
+
Please keep the access token safe as it will only appear once. If you accidentally lose it, you
|
49
|
+
will need to create a new one.
|
50
|
+
</Callout>
|
51
|
+
|
52
|
+
### Step 2: Configure Gitee AI in LobeChat
|
53
|
+
|
54
|
+
- Access the `Settings` page in LobeChat
|
55
|
+
- Under `Language Models`, find the settings for `Gitee AI`
|
56
|
+
|
57
|
+
<Image
|
58
|
+
alt={'Enter API Key'}
|
59
|
+
inStep
|
60
|
+
src={'https://github.com/user-attachments/assets/eaa2a1fb-41ad-473d-ac10-a39c05886425'}
|
61
|
+
/>
|
62
|
+
|
63
|
+
- Enter the obtained API key
|
64
|
+
- Select a Gitee AI model for your AI assistant to begin chatting
|
65
|
+
|
66
|
+
<Image
|
67
|
+
alt={'Select Gitee AI Model and Start Chatting'}
|
68
|
+
inStep
|
69
|
+
src={'https://github.com/user-attachments/assets/ab87120c-15ff-4bc7-bb28-4b0b43cfe91a'}
|
70
|
+
/>
|
71
|
+
|
72
|
+
<Callout type={'warning'}>
|
73
|
+
During usage, you may need to make payments to the API service provider; please refer to Gitee
|
74
|
+
AI's relevant pricing policy.
|
75
|
+
</Callout>
|
76
|
+
|
77
|
+
</Steps>
|
78
|
+
|
79
|
+
Now you can start having conversations using the models provided by Gitee AI in LobeChat!
|
@@ -0,0 +1,75 @@
|
|
1
|
+
---
|
2
|
+
title: 在 LobeChat 中使用 Gitee AI
|
3
|
+
description: 学习如何在 LobeChat 中配置和使用 Gitee AI 的 API Key,以便开始对话和交互。
|
4
|
+
tags:
|
5
|
+
- LobeChat
|
6
|
+
- Gitee AI
|
7
|
+
- API密钥
|
8
|
+
- Web UI
|
9
|
+
---
|
10
|
+
|
11
|
+
# 在 LobeChat 中使用 Gitee AI
|
12
|
+
|
13
|
+
<Image
|
14
|
+
cover
|
15
|
+
src={'https://github.com/user-attachments/assets/f9ccce84-4fd4-48ca-9450-40660112d0d7'}
|
16
|
+
/>
|
17
|
+
|
18
|
+
[Gitee AI](https://ai.gitee.com/) 是一个基于 Git 代码托管技术的开源平台,专为人工智能(AI)应用场景设计。它旨在为开发者和企业提供一站式的 AI 应用开发服务,包括模型体验、推理、微调和部署等功能。
|
19
|
+
|
20
|
+
本文将指导你如何在 LobeChat 中使用 Gitee AI。
|
21
|
+
|
22
|
+
<Steps>
|
23
|
+
|
24
|
+
### 步骤一: 获取 Gitee AI 的 API 密钥
|
25
|
+
|
26
|
+
- 注册并登录 [Gitee AI 官网](https://ai.gitee.com/)
|
27
|
+
- 在工作台中购买并充值 `Serverless API`
|
28
|
+
|
29
|
+
<Image
|
30
|
+
alt={'Gitee Serverless API'}
|
31
|
+
inStep
|
32
|
+
src={'https://github.com/user-attachments/assets/c77fcf70-9039-49ff-86e4-f8eaa267bbf6'}
|
33
|
+
/>
|
34
|
+
|
35
|
+
- 在 `设置` 中点击 `访问令牌` 界面
|
36
|
+
- 创建一个新的访问令牌
|
37
|
+
- 在弹出窗口中保存访问令牌
|
38
|
+
|
39
|
+
<Image
|
40
|
+
alt={'Gitee Serverless API'}
|
41
|
+
inStep
|
42
|
+
src={'https://github.com/user-attachments/assets/0af85438-ac99-4c95-b888-a17e88ede043'}
|
43
|
+
/>
|
44
|
+
|
45
|
+
<Callout type={'warning'}>
|
46
|
+
妥善保存弹窗中的访问令牌,它只会出现一次,如果不小心丢失了,你需要重新创建一个访问令牌。
|
47
|
+
</Callout>
|
48
|
+
|
49
|
+
### 步骤二:在 LobeChat 中配置 Gitee AI
|
50
|
+
|
51
|
+
- 访问 LobeChat 的`设置`界面
|
52
|
+
- 在`语言模型`下找到 `Gitee AI` 的设置项
|
53
|
+
|
54
|
+
<Image
|
55
|
+
alt={'填入 API 密钥'}
|
56
|
+
inStep
|
57
|
+
src={'https://github.com/user-attachments/assets/eaa2a1fb-41ad-473d-ac10-a39c05886425'}
|
58
|
+
/>
|
59
|
+
|
60
|
+
- 填入获得的 API 密钥
|
61
|
+
- 为你的 AI 助手选择一个 Gitee AI 的模型即可开始对话
|
62
|
+
|
63
|
+
<Image
|
64
|
+
alt={'选择 Gitee AI 模型并开始对话'}
|
65
|
+
inStep
|
66
|
+
src={'https://github.com/user-attachments/assets/ab87120c-15ff-4bc7-bb28-4b0b43cfe91a'}
|
67
|
+
/>
|
68
|
+
|
69
|
+
<Callout type={'warning'}>
|
70
|
+
在使用过程中你可能需要向 API 服务提供商付费,请参考 Gitee AI 的相关费用政策。
|
71
|
+
</Callout>
|
72
|
+
|
73
|
+
</Steps>
|
74
|
+
|
75
|
+
至此你已经可以在 LobeChat 中使用 Gitee AI 提供的模型进行对话了。
|
@@ -0,0 +1,70 @@
|
|
1
|
+
---
|
2
|
+
title: Using InternLM in LobeChat
|
3
|
+
description: >-
|
4
|
+
Learn how to configure and use SenseNova's API Key in LobeChat to start
|
5
|
+
conversations and interactions.
|
6
|
+
tags:
|
7
|
+
- LobeChat
|
8
|
+
- InternLM
|
9
|
+
- API Key
|
10
|
+
- Web UI
|
11
|
+
---
|
12
|
+
|
13
|
+
# Using InternLM in LobeChat
|
14
|
+
|
15
|
+
<Image
|
16
|
+
cover
|
17
|
+
src={'https://github.com/user-attachments/assets/be7dcd49-0165-4f7b-bf90-0739cc9dd212'}
|
18
|
+
/>
|
19
|
+
|
20
|
+
[InternLM](https://platform.sensenova.cn/home) is a large pre-trained language model jointly launched by the Shanghai Artificial Intelligence Laboratory and Shusheng Group. This model focuses on natural language processing, aimed at understanding and generating human language, boasting powerful semantic comprehension and text generation capabilities.
|
21
|
+
|
22
|
+
This article will guide you on how to use InternLM in LobeChat.
|
23
|
+
|
24
|
+
<Steps>
|
25
|
+
|
26
|
+
### Step 1: Obtain the InternLM API Key
|
27
|
+
|
28
|
+
- Register and log in to [InternLM API](https://InternLM.intern-ai.org.cn/api/tokens)
|
29
|
+
- Create an API token
|
30
|
+
- Save the API token in the pop-up window
|
31
|
+
|
32
|
+
<Image
|
33
|
+
alt={'Save API Token'}
|
34
|
+
inStep
|
35
|
+
src={'https://github.com/user-attachments/assets/0e2fdc5d-9623-4a74-a7f6-dcb802d52297'}
|
36
|
+
/>
|
37
|
+
|
38
|
+
<Callout type={'warning'}>
|
39
|
+
Please store the API token shown in the pop-up securely; it will only appear once. If you lose it,
|
40
|
+
you will need to create a new API token.
|
41
|
+
</Callout>
|
42
|
+
|
43
|
+
### Step 2: Configure InternLM in LobeChat
|
44
|
+
|
45
|
+
- Go to the `Settings` interface in LobeChat
|
46
|
+
- Find the settings option for `InternLM` under `Language Models`
|
47
|
+
|
48
|
+
<Image
|
49
|
+
alt={'Enter API Key'}
|
50
|
+
inStep
|
51
|
+
src={'https://github.com/user-attachments/assets/8ec7656e-1e3d-41e0-95a0-f6883135c2fc'}
|
52
|
+
/>
|
53
|
+
|
54
|
+
- Enter the obtained `AccessKey ID` and `AccessKey Secret`
|
55
|
+
- Choose a InternLM model for your AI assistant to start a conversation
|
56
|
+
|
57
|
+
<Image
|
58
|
+
alt={'Select InternLM Model and Start Conversation'}
|
59
|
+
inStep
|
60
|
+
src={'https://github.com/user-attachments/assets/76ad163e-ee19-4f95-a712-85bea764d3ec'}
|
61
|
+
/>
|
62
|
+
|
63
|
+
<Callout type={'warning'}>
|
64
|
+
During usage, you may need to pay the API service provider; please refer to the pricing policy
|
65
|
+
regarding InternLM.
|
66
|
+
</Callout>
|
67
|
+
|
68
|
+
</Steps>
|
69
|
+
|
70
|
+
You are now ready to engage in conversations using the models provided by InternLM in LobeChat.
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
title: 在 LobeChat 中使用书生浦语
|
3
|
+
description: 学习如何在 LobeChat 中配置和使用书生浦语的 API Key,以便开始对话和交互。
|
4
|
+
tags:
|
5
|
+
- LobeChat
|
6
|
+
- 书生浦语
|
7
|
+
- API密钥
|
8
|
+
- Web UI
|
9
|
+
---
|
10
|
+
|
11
|
+
# 在 LobeChat 中使用书生浦语
|
12
|
+
|
13
|
+
<Image
|
14
|
+
cover
|
15
|
+
src={'https://github.com/user-attachments/assets/be7dcd49-0165-4f7b-bf90-0739cc9dd212'}
|
16
|
+
/>
|
17
|
+
|
18
|
+
[书生浦语(InternLM)](https://platform.sensenova.cn/home) 是由上海人工智能实验室与书生集团联合推出的一款大型预训练语言模型。该模型专注于自然语言处理,旨在理解和生成自然语言,具备强大的语义理解和文本生成能力。
|
19
|
+
|
20
|
+
本文将指导你如何在 LobeChat 中使用书生浦语。
|
21
|
+
|
22
|
+
<Steps>
|
23
|
+
|
24
|
+
### 步骤一: 获取书生浦语的 API 密钥
|
25
|
+
|
26
|
+
- 注册并登录 [浦语 API](https://internlm.intern-ai.org.cn/api/tokens)
|
27
|
+
- 创建一个 API 令牌
|
28
|
+
- 在弹出窗口中保存 API 令牌
|
29
|
+
|
30
|
+
<Image
|
31
|
+
alt={'保存 API Token'}
|
32
|
+
inStep
|
33
|
+
src={'https://github.com/user-attachments/assets/0e2fdc5d-9623-4a74-a7f6-dcb802d52297'}
|
34
|
+
/>
|
35
|
+
|
36
|
+
<Callout type={'warning'}>
|
37
|
+
妥善保存弹窗中的 API 令牌,它只会出现一次,如果不小心丢失了,你需要重新创建一个 API 令牌。
|
38
|
+
</Callout>
|
39
|
+
|
40
|
+
### 步骤二:在 LobeChat 中配置书生浦语
|
41
|
+
|
42
|
+
- 访问 LobeChat 的`设置`界面
|
43
|
+
- 在`语言模型`下找到 `书生浦语` 的设置项
|
44
|
+
|
45
|
+
<Image
|
46
|
+
alt={'填入 API 密钥'}
|
47
|
+
inStep
|
48
|
+
src={'https://github.com/user-attachments/assets/8ec7656e-1e3d-41e0-95a0-f6883135c2fc'}
|
49
|
+
/>
|
50
|
+
|
51
|
+
- 填入获得的 `AccessKey ID` 和 `AccessKey Secret`
|
52
|
+
- 为你的 AI 助手选择一个书生浦语的模型即可开始对话
|
53
|
+
|
54
|
+
<Image
|
55
|
+
alt={'选择书生浦语模型并开始对话'}
|
56
|
+
inStep
|
57
|
+
src={'https://github.com/user-attachments/assets/76ad163e-ee19-4f95-a712-85bea764d3ec'}
|
58
|
+
/>
|
59
|
+
|
60
|
+
<Callout type={'warning'}>
|
61
|
+
在使用过程中你可能需要向 API 服务提供商付费,请参考书生浦语的相关费用政策。
|
62
|
+
</Callout>
|
63
|
+
|
64
|
+
</Steps>
|
65
|
+
|
66
|
+
至此你已经可以在 LobeChat 中使用书生浦语提供的模型进行对话了。
|
@@ -0,0 +1,79 @@
|
|
1
|
+
---
|
2
|
+
title: Using SenseNova in LobeChat
|
3
|
+
description: >-
|
4
|
+
Learn how to configure and use SenseNova's API Key in LobeChat to start
|
5
|
+
conversations and interactions.
|
6
|
+
tags:
|
7
|
+
- LobeChat
|
8
|
+
- SenseNova
|
9
|
+
- API Key
|
10
|
+
- Web UI
|
11
|
+
---
|
12
|
+
|
13
|
+
# Using SenseNova in LobeChat
|
14
|
+
|
15
|
+
<Image
|
16
|
+
cover
|
17
|
+
src={'https://github.com/user-attachments/assets/420379cd-d8a4-4ab3-9a46-75dcc3d56920'}
|
18
|
+
/>
|
19
|
+
|
20
|
+
[SenseNova](https://platform.sensenova.cn/home) is a large model system introduced by SenseTime, aimed at promoting the rapid iteration and practical application of artificial intelligence (AI) technology.
|
21
|
+
|
22
|
+
This article will guide you on how to use SenseNova in LobeChat.
|
23
|
+
|
24
|
+
<Steps>
|
25
|
+
|
26
|
+
### Step 1: Obtain the API Key for SenseNova
|
27
|
+
|
28
|
+
- Register and log in to the [SenseCore Development Platform](https://www.sensecore.cn/product/aistudio).
|
29
|
+
- Locate the `SenseNova Large Model` in the product menu and activate the service.
|
30
|
+
|
31
|
+
<Image
|
32
|
+
alt={'Activate SenseNova Large Model'}
|
33
|
+
inStep
|
34
|
+
src={'https://github.com/user-attachments/assets/c6319e83-c4e7-48cf-9625-2edfc4aa77b3'}
|
35
|
+
/>
|
36
|
+
|
37
|
+
- Go to the [AccessKey Management](https://console.sensecore.cn/iam/Security/access-key) page.
|
38
|
+
- Create an access key.
|
39
|
+
- Save the Access Key ID and secret in the pop-up window.
|
40
|
+
|
41
|
+
<Image
|
42
|
+
alt={'Save Access Key'}
|
43
|
+
inStep
|
44
|
+
src={'https://github.com/user-attachments/assets/f9f7ed26-e506-4c52-a118-e0bb5e0918db'}
|
45
|
+
/>
|
46
|
+
|
47
|
+
<Callout type={'warning'}>
|
48
|
+
Please keep the access key from the pop-up window secure, as it will only appear once. If you lose
|
49
|
+
it, you will need to create a new access key.
|
50
|
+
</Callout>
|
51
|
+
|
52
|
+
### Step 2: Configure SenseNova in LobeChat
|
53
|
+
|
54
|
+
- Access the `Settings` interface on LobeChat.
|
55
|
+
- Find the setting for `SenseNova` under `Language Models`.
|
56
|
+
|
57
|
+
<Image
|
58
|
+
alt={'Enter Access Key'}
|
59
|
+
inStep
|
60
|
+
src={'https://github.com/user-attachments/assets/0c73c453-6ee3-4f90-bc5d-119c52c38fef'}
|
61
|
+
/>
|
62
|
+
|
63
|
+
- Input the obtained `Access Key ID` and `Access Key Secret`.
|
64
|
+
- Choose a SenseNova model for your AI assistant and start the conversation.
|
65
|
+
|
66
|
+
<Image
|
67
|
+
alt={'Choose SenseNova model and start conversation'}
|
68
|
+
inStep
|
69
|
+
src={'https://github.com/user-attachments/assets/aea782b1-27bd-4d9c-b521-c172c2095fe6'}
|
70
|
+
/>
|
71
|
+
|
72
|
+
<Callout type={'warning'}>
|
73
|
+
During usage, you may need to pay the API service provider, please refer to the relevant fee
|
74
|
+
policy for SenseNova.
|
75
|
+
</Callout>
|
76
|
+
|
77
|
+
</Steps>
|
78
|
+
|
79
|
+
You can now have conversations using the models provided by SenseNova in LobeChat.
|
@@ -0,0 +1,75 @@
|
|
1
|
+
---
|
2
|
+
title: 在 LobeChat 中使用商汤日日新
|
3
|
+
description: 学习如何在 LobeChat 中配置和使用商汤日日新的 API Key,以便开始对话和交互。
|
4
|
+
tags:
|
5
|
+
- LobeChat
|
6
|
+
- 商汤日日新
|
7
|
+
- API密钥
|
8
|
+
- Web UI
|
9
|
+
---
|
10
|
+
|
11
|
+
# 在 LobeChat 中使用商汤日日新
|
12
|
+
|
13
|
+
<Image
|
14
|
+
cover
|
15
|
+
src={'https://github.com/user-attachments/assets/420379cd-d8a4-4ab3-9a46-75dcc3d56920'}
|
16
|
+
/>
|
17
|
+
|
18
|
+
[商汤日日新](https://platform.sensenova.cn/home) 是商汤科技(SenseTime)推出的一个大模型体系,旨在推动人工智能(AI)技术的快速迭代和应用落地。
|
19
|
+
|
20
|
+
本文将指导你如何在 LobeChat 中使用商汤日日新。
|
21
|
+
|
22
|
+
<Steps>
|
23
|
+
|
24
|
+
### 步骤一: 获取商汤日日新的 API 密钥
|
25
|
+
|
26
|
+
- 注册并登录 [万象模型开发平台](https://www.sensecore.cn/product/aistudio)
|
27
|
+
- 在产品菜单中找到 `日日新大模型` 并开通服务
|
28
|
+
|
29
|
+
<Image
|
30
|
+
alt={'开通日日新大模型'}
|
31
|
+
inStep
|
32
|
+
src={'https://github.com/user-attachments/assets/c6319e83-c4e7-48cf-9625-2edfc4aa77b3'}
|
33
|
+
/>
|
34
|
+
|
35
|
+
- 进入 [AccessKey 访问密钥](https://console.sensecore.cn/iam/Security/access-key) 页面
|
36
|
+
- 创建一个访问密钥
|
37
|
+
- 在弹出窗口中保存访问密钥 ID 和令牌
|
38
|
+
|
39
|
+
<Image
|
40
|
+
alt={'保存访问密钥'}
|
41
|
+
inStep
|
42
|
+
src={'https://github.com/user-attachments/assets/f9f7ed26-e506-4c52-a118-e0bb5e0918db'}
|
43
|
+
/>
|
44
|
+
|
45
|
+
<Callout type={'warning'}>
|
46
|
+
妥善保存弹窗中的访问密钥,它只会出现一次,如果不小心丢失了,你需要重新创建一个访问密钥。
|
47
|
+
</Callout>
|
48
|
+
|
49
|
+
### 步骤二:在 LobeChat 中配置商汤日日新
|
50
|
+
|
51
|
+
- 访问 LobeChat 的`设置`界面
|
52
|
+
- 在`语言模型`下找到 `商汤日日新` 的设置项
|
53
|
+
|
54
|
+
<Image
|
55
|
+
alt={'填入访问密钥'}
|
56
|
+
inStep
|
57
|
+
src={'https://github.com/user-attachments/assets/0c73c453-6ee3-4f90-bc5d-119c52c38fef'}
|
58
|
+
/>
|
59
|
+
|
60
|
+
- 填入获得的 `AccessKey ID` 和 `AccessKey Secret`
|
61
|
+
- 为你的 AI 助手选择一个商汤日日新的模型即可开始对话
|
62
|
+
|
63
|
+
<Image
|
64
|
+
alt={'选择商汤日日新模型并开始对话'}
|
65
|
+
inStep
|
66
|
+
src={'https://github.com/user-attachments/assets/aea782b1-27bd-4d9c-b521-c172c2095fe6'}
|
67
|
+
/>
|
68
|
+
|
69
|
+
<Callout type={'warning'}>
|
70
|
+
在使用过程中你可能需要向 API 服务提供商付费,请参考商汤日日新的相关费用政策。
|
71
|
+
</Callout>
|
72
|
+
|
73
|
+
</Steps>
|
74
|
+
|
75
|
+
至此你已经可以在 LobeChat 中使用商汤日日新提供的模型进行对话了。
|
@@ -0,0 +1,70 @@
|
|
1
|
+
---
|
2
|
+
title: Using xAI in LobeChat
|
3
|
+
description: >-
|
4
|
+
Learn how to configure and use xAI's API Key in LobeChat to start
|
5
|
+
conversations and interactions.
|
6
|
+
tags:
|
7
|
+
- LobeChat
|
8
|
+
- xAI
|
9
|
+
- API Key
|
10
|
+
- Web UI
|
11
|
+
---
|
12
|
+
|
13
|
+
# Using xAI in LobeChat
|
14
|
+
|
15
|
+
<Image
|
16
|
+
cover
|
17
|
+
src={'https://github.com/user-attachments/assets/cf3bfd44-9c13-4026-95cd-67f54f40ce6c'}
|
18
|
+
/>
|
19
|
+
|
20
|
+
[xAI](https://x.ai/) is an artificial intelligence company founded by Elon Musk in 2023, aimed at exploring and understanding the true nature of the universe. The company's mission is to solve complex scientific and mathematical problems using AI technology and to advance the field of artificial intelligence.
|
21
|
+
|
22
|
+
This article will guide you on how to use xAI in LobeChat.
|
23
|
+
|
24
|
+
<Steps>
|
25
|
+
|
26
|
+
### Step 1: Obtain an API Key from xAI
|
27
|
+
|
28
|
+
- Register and login to the [xAI console](https://console.x.ai/)
|
29
|
+
- Create an API token
|
30
|
+
- Copy and save the API token
|
31
|
+
|
32
|
+
<Image
|
33
|
+
alt={'xAI API'}
|
34
|
+
inStep
|
35
|
+
src={'https://github.com/user-attachments/assets/09c994cf-78f8-46ea-9fef-a06022c0f6d7'}
|
36
|
+
/>
|
37
|
+
|
38
|
+
<Callout type={'warning'}>
|
39
|
+
Make sure to securely save the API token displayed in the popup; it only appears once. If you
|
40
|
+
accidentally lose it, you will need to create a new API token.
|
41
|
+
</Callout>
|
42
|
+
|
43
|
+
### Step 2: Configure xAI in LobeChat
|
44
|
+
|
45
|
+
- Go to the `Settings` menu in LobeChat
|
46
|
+
- Locate the `xAI` settings under `Language Model`
|
47
|
+
|
48
|
+
<Image
|
49
|
+
alt={'Enter API Key'}
|
50
|
+
inStep
|
51
|
+
src={'https://github.com/user-attachments/assets/12863a0e-a1ee-406d-8dee-011b20701fd6'}
|
52
|
+
/>
|
53
|
+
|
54
|
+
- Enter the API key you obtained
|
55
|
+
- Select an xAI model for your AI assistant to start a conversation
|
56
|
+
|
57
|
+
<Image
|
58
|
+
alt={'Select xAI Model and Start Conversation'}
|
59
|
+
inStep
|
60
|
+
src={'https://github.com/user-attachments/assets/899a4393-db41-45a6-97ec-9813e1f9879d'}
|
61
|
+
/>
|
62
|
+
|
63
|
+
<Callout type={'warning'}>
|
64
|
+
During use, you may need to pay the API service provider, so please refer to xAI's relevant
|
65
|
+
pricing policies.
|
66
|
+
</Callout>
|
67
|
+
|
68
|
+
</Steps>
|
69
|
+
|
70
|
+
You are now ready to engage in conversations using the models provided by xAI in LobeChat.
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
title: 在 LobeChat 中使用 xAI
|
3
|
+
description: 学习如何在 LobeChat 中配置和使用 xAI 的 API Key,以便开始对话和交互。
|
4
|
+
tags:
|
5
|
+
- LobeChat
|
6
|
+
- xAI
|
7
|
+
- API密钥
|
8
|
+
- Web UI
|
9
|
+
---
|
10
|
+
|
11
|
+
# 在 LobeChat 中使用 xAI
|
12
|
+
|
13
|
+
<Image
|
14
|
+
cover
|
15
|
+
src={'https://github.com/user-attachments/assets/cf3bfd44-9c13-4026-95cd-67f54f40ce6c'}
|
16
|
+
/>
|
17
|
+
|
18
|
+
[xAI](https://x.ai/) 是由埃隆·马斯克于2023年成立的一家人工智能公司,旨在探索和理解宇宙的真实本质。该公司的目标是通过人工智能技术解决复杂的科学和数学问题,并推动人工智能的发展。
|
19
|
+
|
20
|
+
本文将指导你如何在 LobeChat 中使用 xAI。
|
21
|
+
|
22
|
+
<Steps>
|
23
|
+
|
24
|
+
### 步骤一: 获取 xAI 的 API 密钥
|
25
|
+
|
26
|
+
- 注册并登录 [xAI 控制台](https://console.x.ai/)
|
27
|
+
- 创建一个 API Token
|
28
|
+
- 复制并保存 API Token
|
29
|
+
|
30
|
+
<Image
|
31
|
+
alt={'xAI API'}
|
32
|
+
inStep
|
33
|
+
src={'https://github.com/user-attachments/assets/09c994cf-78f8-46ea-9fef-a06022c0f6d7'}
|
34
|
+
/>
|
35
|
+
|
36
|
+
<Callout type={'warning'}>
|
37
|
+
妥善保存弹窗中的 API 令牌,它只会出现一次,如果不小心丢失了,你需要重新创建一个 API 令牌。
|
38
|
+
</Callout>
|
39
|
+
|
40
|
+
### 步骤二:在 LobeChat 中配置 xAI
|
41
|
+
|
42
|
+
- 访问 LobeChat 的`设置`界面
|
43
|
+
- 在`语言模型`下找到 `xAI` 的设置项
|
44
|
+
|
45
|
+
<Image
|
46
|
+
alt={'填入 API 密钥'}
|
47
|
+
inStep
|
48
|
+
src={'https://github.com/user-attachments/assets/12863a0e-a1ee-406d-8dee-011b20701fd6'}
|
49
|
+
/>
|
50
|
+
|
51
|
+
- 填入获得的 API 密钥
|
52
|
+
- 为你的 AI 助手选择一个 xAI 的模型即可开始对话
|
53
|
+
|
54
|
+
<Image
|
55
|
+
alt={'选择 xAI 模型并开始对话'}
|
56
|
+
inStep
|
57
|
+
src={'https://github.com/user-attachments/assets/899a4393-db41-45a6-97ec-9813e1f9879d'}
|
58
|
+
/>
|
59
|
+
|
60
|
+
<Callout type={'warning'}>
|
61
|
+
在使用过程中你可能需要向 API 服务提供商付费,请参考 xAI 的相关费用政策。
|
62
|
+
</Callout>
|
63
|
+
|
64
|
+
</Steps>
|
65
|
+
|
66
|
+
至此你已经可以在 LobeChat 中使用 xAI 提供的模型进行对话了。
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.35.
|
3
|
+
"version": "1.35.5",
|
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,9 +1,9 @@
|
|
1
1
|
// This file is for debugging purposes only.
|
2
2
|
// DON'T USE IT IN PRODUCTION.
|
3
3
|
import { DEFAULT_AGENT_CONFIG } from '@/const/settings';
|
4
|
-
import { DBModel } from '@/database/
|
5
|
-
import { DB_Message } from '@/database/
|
6
|
-
import { DB_Topic } from '@/database/
|
4
|
+
import { DBModel } from '@/database/_deprecated/core/types/db';
|
5
|
+
import { DB_Message } from '@/database/_deprecated/schemas/message';
|
6
|
+
import { DB_Topic } from '@/database/_deprecated/schemas/topic';
|
7
7
|
|
8
8
|
import { BaseModel } from '../core';
|
9
9
|
import { DB_Session, DB_SessionSchema } from '../schemas/session';
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
2
2
|
|
3
3
|
import { DEFAULT_AGENT_CONFIG } from '@/const/settings';
|
4
|
-
import { CreateMessageParams, MessageModel } from '@/database/
|
5
|
-
import { SessionGroupModel } from '@/database/
|
6
|
-
import { TopicModel } from '@/database/
|
4
|
+
import { CreateMessageParams, MessageModel } from '@/database/_deprecated/models/message';
|
5
|
+
import { SessionGroupModel } from '@/database/_deprecated/models/sessionGroup';
|
6
|
+
import { TopicModel } from '@/database/_deprecated/models/topic';
|
7
7
|
import { LobeAgentConfig } from '@/types/agent';
|
8
8
|
import {
|
9
9
|
LobeAgentSession,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
2
2
|
|
3
|
-
import { SessionModel } from '@/database/
|
3
|
+
import { SessionModel } from '@/database/_deprecated/models/session';
|
4
4
|
import { SessionGroups } from '@/types/session';
|
5
5
|
|
6
6
|
import { DB_SessionGroup } from '../../schemas/sessionGroup';
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
2
2
|
|
3
|
-
import { DBModel } from '@/database/
|
4
|
-
import { CreateMessageParams, MessageModel } from '@/database/
|
5
|
-
import { DB_Message } from '@/database/
|
6
|
-
import { DB_Topic } from '@/database/
|
3
|
+
import { DBModel } from '@/database/_deprecated/core/types/db';
|
4
|
+
import { CreateMessageParams, MessageModel } from '@/database/_deprecated/models/message';
|
5
|
+
import { DB_Message } from '@/database/_deprecated/schemas/message';
|
6
|
+
import { DB_Topic } from '@/database/_deprecated/schemas/topic';
|
7
7
|
import { nanoid } from '@/utils/uuid';
|
8
8
|
import * as uuidUtils from '@/utils/uuid';
|
9
9
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { DBModel } from '@/database/
|
2
|
-
import { DB_File, DB_FileSchema } from '@/database/
|
1
|
+
import { DBModel } from '@/database/_deprecated/core/types/db';
|
2
|
+
import { DB_File, DB_FileSchema } from '@/database/_deprecated/schemas/files';
|
3
3
|
import { nanoid } from '@/utils/uuid';
|
4
4
|
|
5
5
|
import { BaseModel } from '../core';
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { DeepPartial } from 'utility-types';
|
2
2
|
|
3
|
-
import { BaseModel } from '@/database/
|
4
|
-
import { DBModel } from '@/database/
|
5
|
-
import { DB_Message, DB_MessageSchema } from '@/database/
|
3
|
+
import { BaseModel } from '@/database/_deprecated/core';
|
4
|
+
import { DBModel } from '@/database/_deprecated/core/types/db';
|
5
|
+
import { DB_Message, DB_MessageSchema } from '@/database/_deprecated/schemas/message';
|
6
6
|
import { ChatMessage } from '@/types/message';
|
7
7
|
import { nanoid } from '@/utils/uuid';
|
8
8
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { DeepPartial } from 'utility-types';
|
2
2
|
|
3
3
|
import { DEFAULT_AGENT_LOBE_SESSION } from '@/const/session';
|
4
|
-
import { BaseModel } from '@/database/
|
5
|
-
import { DBModel } from '@/database/
|
6
|
-
import { DB_Session, DB_SessionSchema } from '@/database/
|
4
|
+
import { BaseModel } from '@/database/_deprecated/core';
|
5
|
+
import { DBModel } from '@/database/_deprecated/core/types/db';
|
6
|
+
import { DB_Session, DB_SessionSchema } from '@/database/_deprecated/schemas/session';
|
7
7
|
import { LobeAgentConfig } from '@/types/agent';
|
8
8
|
import {
|
9
9
|
ChatSessionList,
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { BaseModel } from '@/database/
|
2
|
-
import { DB_SessionGroup, DB_SessionGroupSchema } from '@/database/
|
1
|
+
import { BaseModel } from '@/database/_deprecated/core';
|
2
|
+
import { DB_SessionGroup, DB_SessionGroupSchema } from '@/database/_deprecated/schemas/sessionGroup';
|
3
3
|
import { SessionGroups } from '@/types/session';
|
4
4
|
import { nanoid } from '@/utils/uuid';
|
5
5
|
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { BaseModel } from '@/database/
|
2
|
-
import { DBModel } from '@/database/
|
3
|
-
import { MessageModel } from '@/database/
|
4
|
-
import { DB_Topic, DB_TopicSchema } from '@/database/
|
1
|
+
import { BaseModel } from '@/database/_deprecated/core';
|
2
|
+
import { DBModel } from '@/database/_deprecated/core/types/db';
|
3
|
+
import { MessageModel } from '@/database/_deprecated/models/message';
|
4
|
+
import { DB_Topic, DB_TopicSchema } from '@/database/_deprecated/schemas/topic';
|
5
5
|
import { ChatTopic } from '@/types/topic';
|
6
6
|
import { nanoid } from '@/utils/uuid';
|
7
7
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
2
2
|
|
3
|
-
import { dataSync } from '@/database/
|
3
|
+
import { dataSync } from '@/database/_deprecated/core';
|
4
4
|
import { StartDataSyncParams } from '@/types/sync';
|
5
5
|
|
6
6
|
import { syncService } from '../sync';
|
7
7
|
|
8
|
-
vi.mock('@/database/
|
8
|
+
vi.mock('@/database/_deprecated/core', () => ({
|
9
9
|
dataSync: {
|
10
10
|
startDataSync: vi.fn(),
|
11
11
|
disconnect: vi.fn(),
|
package/src/services/debug.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { Mock, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
|
2
2
|
|
3
3
|
import { fileEnv } from '@/config/file';
|
4
|
-
import { FileModel } from '@/database/
|
5
|
-
import { DB_File } from '@/database/
|
4
|
+
import { FileModel } from '@/database/_deprecated/models/file';
|
5
|
+
import { DB_File } from '@/database/_deprecated/schemas/files';
|
6
6
|
import { serverConfigSelectors } from '@/store/serverConfig/selectors';
|
7
7
|
import { createServerConfigStore } from '@/store/serverConfig/store';
|
8
8
|
|
@@ -14,7 +14,7 @@ beforeAll(() => {
|
|
14
14
|
createServerConfigStore();
|
15
15
|
});
|
16
16
|
// Mocks for the FileModel
|
17
|
-
vi.mock('@/database/
|
17
|
+
vi.mock('@/database/_deprecated/models/file', () => ({
|
18
18
|
FileModel: {
|
19
19
|
create: vi.fn(),
|
20
20
|
delete: vi.fn(),
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { FileModel } from '@/database/
|
2
|
-
import { DB_File } from '@/database/
|
1
|
+
import { FileModel } from '@/database/_deprecated/models/file';
|
2
|
+
import { DB_File } from '@/database/_deprecated/schemas/files';
|
3
3
|
import { FileItem } from '@/types/files';
|
4
4
|
|
5
5
|
import { IFileService } from './type';
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { MessageModel } from '@/database/
|
2
|
-
import { SessionModel } from '@/database/
|
3
|
-
import { SessionGroupModel } from '@/database/
|
4
|
-
import { TopicModel } from '@/database/
|
1
|
+
import { MessageModel } from '@/database/_deprecated/models/message';
|
2
|
+
import { SessionModel } from '@/database/_deprecated/models/session';
|
3
|
+
import { SessionGroupModel } from '@/database/_deprecated/models/sessionGroup';
|
4
|
+
import { TopicModel } from '@/database/_deprecated/models/topic';
|
5
5
|
import { ImportResult, ImportResults } from '@/services/config';
|
6
6
|
import { useUserStore } from '@/store/user';
|
7
7
|
import { ImportStage, ImporterEntryData, OnImportCallbacks } from '@/types/importer';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import dayjs from 'dayjs';
|
2
2
|
import { Mock, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { CreateMessageParams, MessageModel } from '@/database/
|
4
|
+
import { CreateMessageParams, MessageModel } from '@/database/_deprecated/models/message';
|
5
5
|
import {
|
6
6
|
ChatMessage,
|
7
7
|
ChatMessageError,
|
@@ -15,7 +15,7 @@ import { ClientService } from './client';
|
|
15
15
|
const messageService = new ClientService();
|
16
16
|
|
17
17
|
// Mock the MessageModel
|
18
|
-
vi.mock('@/database/
|
18
|
+
vi.mock('@/database/_deprecated/models/message', () => {
|
19
19
|
return {
|
20
20
|
MessageModel: {
|
21
21
|
create: vi.fn(),
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import dayjs from 'dayjs';
|
2
2
|
|
3
|
-
import { FileModel } from '@/database/
|
4
|
-
import { MessageModel } from '@/database/
|
5
|
-
import { DB_Message } from '@/database/
|
3
|
+
import { FileModel } from '@/database/_deprecated/models/file';
|
4
|
+
import { MessageModel } from '@/database/_deprecated/models/message';
|
5
|
+
import { DB_Message } from '@/database/_deprecated/schemas/message';
|
6
6
|
import {
|
7
7
|
ChatFileItem,
|
8
8
|
ChatMessage,
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { Mock, describe, expect, it, vi } from 'vitest';
|
2
2
|
|
3
|
-
import { CreateMessageParams, MessageModel } from '@/database/
|
3
|
+
import { CreateMessageParams, MessageModel } from '@/database/_deprecated/models/message';
|
4
4
|
import { ChatMessage, ChatMessageError, ChatPluginPayload } from '@/types/message';
|
5
5
|
|
6
6
|
import { messageService } from './index';
|
7
7
|
|
8
8
|
// Mock the MessageModel
|
9
|
-
vi.mock('@/database/
|
9
|
+
vi.mock('@/database/_deprecated/models/message', () => {
|
10
10
|
return {
|
11
11
|
MessageModel: {
|
12
12
|
count: vi.fn(),
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk';
|
2
2
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { PluginModel } from '@/database/
|
5
|
-
import { DB_Plugin } from '@/database/
|
4
|
+
import { PluginModel } from '@/database/_deprecated/models/plugin';
|
5
|
+
import { DB_Plugin } from '@/database/_deprecated/schemas/plugin';
|
6
6
|
import { LobeTool } from '@/types/tool';
|
7
7
|
import { LobeToolCustomPlugin } from '@/types/tool/plugin';
|
8
8
|
|
@@ -13,7 +13,7 @@ const pluginService = new ClientService();
|
|
13
13
|
|
14
14
|
// Mocking modules and functions
|
15
15
|
|
16
|
-
vi.mock('@/database/
|
16
|
+
vi.mock('@/database/_deprecated/models/plugin', () => ({
|
17
17
|
PluginModel: {
|
18
18
|
getList: vi.fn(),
|
19
19
|
create: vi.fn(),
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk';
|
2
2
|
|
3
|
-
import { PluginModel } from '@/database/
|
3
|
+
import { PluginModel } from '@/database/_deprecated/models/plugin';
|
4
4
|
import { LobeTool } from '@/types/tool';
|
5
5
|
import { LobeToolCustomPlugin } from '@/types/tool/plugin';
|
6
6
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Mock, beforeEach, describe, expect, it, vi } from 'vitest';
|
2
2
|
|
3
|
-
import { SessionModel } from '@/database/
|
4
|
-
import { SessionGroupModel } from '@/database/
|
3
|
+
import { SessionModel } from '@/database/_deprecated/models/session';
|
4
|
+
import { SessionGroupModel } from '@/database/_deprecated/models/sessionGroup';
|
5
5
|
import { LobeAgentConfig } from '@/types/agent';
|
6
6
|
import { LobeAgentSession, LobeSessionType, SessionGroups } from '@/types/session';
|
7
7
|
|
@@ -10,7 +10,7 @@ import { ClientService } from './client';
|
|
10
10
|
const sessionService = new ClientService();
|
11
11
|
|
12
12
|
// Mock the SessionModel
|
13
|
-
vi.mock('@/database/
|
13
|
+
vi.mock('@/database/_deprecated/models/session', () => {
|
14
14
|
return {
|
15
15
|
SessionModel: {
|
16
16
|
create: vi.fn(),
|
@@ -33,7 +33,7 @@ vi.mock('@/database/client/models/session', () => {
|
|
33
33
|
});
|
34
34
|
|
35
35
|
// Mock the SessionGroupModel
|
36
|
-
vi.mock('@/database/
|
36
|
+
vi.mock('@/database/_deprecated/models/sessionGroup', () => {
|
37
37
|
return {
|
38
38
|
SessionGroupModel: {
|
39
39
|
create: vi.fn(),
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { DeepPartial } from 'utility-types';
|
2
2
|
|
3
3
|
import { INBOX_SESSION_ID } from '@/const/session';
|
4
|
-
import { SessionModel } from '@/database/
|
5
|
-
import { SessionGroupModel } from '@/database/
|
6
|
-
import { UserModel } from '@/database/
|
4
|
+
import { SessionModel } from '@/database/_deprecated/models/session';
|
5
|
+
import { SessionGroupModel } from '@/database/_deprecated/models/sessionGroup';
|
6
|
+
import { UserModel } from '@/database/_deprecated/models/user';
|
7
7
|
import { useUserStore } from '@/store/user';
|
8
8
|
import { LobeAgentChatConfig, LobeAgentConfig } from '@/types/agent';
|
9
9
|
import { MetaData } from '@/types/meta';
|
package/src/services/sync.ts
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
import { Mock, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
|
2
2
|
|
3
|
-
import { SessionModel } from '@/database/
|
4
|
-
import { CreateTopicParams, TopicModel } from '@/database/
|
3
|
+
import { SessionModel } from '@/database/_deprecated/models/session';
|
4
|
+
import { CreateTopicParams, TopicModel } from '@/database/_deprecated/models/topic';
|
5
5
|
import { ChatTopic } from '@/types/topic';
|
6
6
|
|
7
7
|
import { ClientService } from './client';
|
8
8
|
|
9
9
|
const topicService = new ClientService();
|
10
10
|
// Mock the TopicModel
|
11
|
-
vi.mock('@/database/
|
11
|
+
vi.mock('@/database/_deprecated/models/topic', () => {
|
12
12
|
return {
|
13
13
|
TopicModel: {
|
14
14
|
create: vi.fn(),
|
package/src/services/upload.ts
CHANGED
@@ -67,7 +67,7 @@ class UploadService {
|
|
67
67
|
};
|
68
68
|
|
69
69
|
uploadToClientDB = async (params: UploadFileParams, file: File) => {
|
70
|
-
const { FileModel } = await import('@/database/
|
70
|
+
const { FileModel } = await import('@/database/_deprecated/models/file');
|
71
71
|
const fileArrayBuffer = await file.arrayBuffer();
|
72
72
|
|
73
73
|
// save to local storage
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { DeepPartial } from 'utility-types';
|
2
2
|
import { Mock, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { UserModel } from '@/database/
|
4
|
+
import { UserModel } from '@/database/_deprecated/models/user';
|
5
5
|
import { UserPreference } from '@/types/user';
|
6
6
|
import { UserSettings } from '@/types/user/settings';
|
7
7
|
import { AsyncLocalStorage } from '@/utils/localStorage';
|
8
8
|
|
9
9
|
import { ClientService } from './client';
|
10
10
|
|
11
|
-
vi.mock('@/database/
|
11
|
+
vi.mock('@/database/_deprecated/models/user', () => ({
|
12
12
|
UserModel: {
|
13
13
|
getUser: vi.fn(),
|
14
14
|
updateSettings: vi.fn(),
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { DeepPartial } from 'utility-types';
|
2
2
|
|
3
|
-
import { MessageModel } from '@/database/
|
4
|
-
import { SessionModel } from '@/database/
|
5
|
-
import { UserModel } from '@/database/
|
3
|
+
import { MessageModel } from '@/database/_deprecated/models/message';
|
4
|
+
import { SessionModel } from '@/database/_deprecated/models/session';
|
5
|
+
import { UserModel } from '@/database/_deprecated/models/user';
|
6
6
|
import { UserGuide, UserInitializationState, UserPreference } from '@/types/user';
|
7
7
|
import { UserSettings } from '@/types/user/settings';
|
8
8
|
import { AsyncLocalStorage } from '@/utils/localStorage';
|
@@ -3,7 +3,7 @@ import useSWR from 'swr';
|
|
3
3
|
import { Mock, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
5
|
import { notification } from '@/components/AntdStaticMethods';
|
6
|
-
import { DB_File } from '@/database/
|
6
|
+
import { DB_File } from '@/database/_deprecated/schemas/files';
|
7
7
|
import { fileService } from '@/services/file';
|
8
8
|
import { uploadService } from '@/services/upload';
|
9
9
|
|
package/src/types/sync.ts
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/src/database/{client → _deprecated}/core/migrations/migrateSettingsToUser/index.test.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|