@lobehub/chat 1.20.2 → 1.20.3
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/docs/self-hosting/advanced/feature-flags.mdx +1 -0
- package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +1 -0
- package/docs/self-hosting/environment-variables/model-provider.mdx +16 -0
- package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +16 -0
- package/package.json +1 -1
- package/src/database/server/models/chunk.ts +10 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.20.3](https://github.com/lobehub/lobe-chat/compare/v1.20.2...v1.20.3)
|
6
|
+
|
7
|
+
<sup>Released on **2024-09-28**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Improve delete orphan chunks when delete files.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### What's fixed
|
19
|
+
|
20
|
+
- **misc**: Improve delete orphan chunks when delete files, closes [#4179](https://github.com/lobehub/lobe-chat/issues/4179) ([f3e0ffe](https://github.com/lobehub/lobe-chat/commit/f3e0ffe))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
5
30
|
### [Version 1.20.2](https://github.com/lobehub/lobe-chat/compare/v1.20.1...v1.20.2)
|
6
31
|
|
7
32
|
<sup>Released on **2024-09-27**</sup>
|
@@ -46,5 +46,6 @@ You can achieve various feature combinations using the above configuration synta
|
|
46
46
|
| `market` | Enables the assistant market functionality. | Enabled |
|
47
47
|
| `speech_to_text` | Enables speech-to-text functionality. | Enabled |
|
48
48
|
| `knowledge_base` | Enables the knowledge base functionality. | Enabled |
|
49
|
+
| `clerk_sign_up` | Enables the Clerk SignUp functionality. | Enabled |
|
49
50
|
|
50
51
|
You can always check the [featureFlags](https://github.com/lobehub/lobe-chat/blob/main/src/config/featureFlags/schema.ts) to get the latest list of feature flags.
|
@@ -42,5 +42,6 @@ tags:
|
|
42
42
|
| `market` | 启用助手市场功能。 | 开启 |
|
43
43
|
| `speech_to_text` | 启用语音转文本功能。 | 开启 |
|
44
44
|
| `knowledge_base` | 启用知识库功能。 | 开启 |
|
45
|
+
| `clerk_sign_up` | 启用Clerk注册功能。 | 开启 |
|
45
46
|
|
46
47
|
你可以随时检查 [featureFlags](https://github.com/lobehub/lobe-chat/blob/main/src/config/featureFlags/schema.ts) 以获取最新的特性标志列表。
|
@@ -479,4 +479,20 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
|
479
479
|
- Default: -
|
480
480
|
- Example: `xxxxxx...xxxxxx`
|
481
481
|
|
482
|
+
## HUNYUAN
|
483
|
+
|
484
|
+
### `HUNYUAN_API_KEY`
|
485
|
+
|
486
|
+
- Type: Required
|
487
|
+
- Description: This is the API key you applied from HUNYUAN service
|
488
|
+
- Default: -
|
489
|
+
- Example: `xxxxxx...xxxxxx`
|
490
|
+
|
491
|
+
### `HUNYUAN_MODEL_LIST`
|
492
|
+
|
493
|
+
- Type: Optional
|
494
|
+
- Description: Used to control the model list, use `+` to add a model, use `-` to hide a model, use `model_name=display_name` to customize the display name of a model, separated by commas. Definition syntax rules see [model-list][model-list]
|
495
|
+
- Default: `-`
|
496
|
+
- Example: `-all,+hunyuan-lite,+hunyuan-standard`
|
497
|
+
|
482
498
|
[model-list]: /docs/self-hosting/advanced/model-list
|
@@ -477,4 +477,20 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
|
477
477
|
- 默认值:-
|
478
478
|
- 示例:`xxxxxx...xxxxxx`
|
479
479
|
|
480
|
+
## 腾讯混元
|
481
|
+
|
482
|
+
### `HUNYUAN_API_KEY`
|
483
|
+
|
484
|
+
- 类型:必选
|
485
|
+
- 描述:这是你在 腾讯混元 服务中申请的 API 密钥
|
486
|
+
- 默认值:-
|
487
|
+
- 示例:`xxxxxx...xxxxxx`
|
488
|
+
|
489
|
+
### `HUNYUAN_MODEL_LIST`
|
490
|
+
|
491
|
+
- 类型:可选
|
492
|
+
- 描述:用来控制模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名<扩展配置>` 来自定义模型的展示名,用英文逗号隔开。模型定义语法规则见 [模型列表][model-list]
|
493
|
+
- 默认值:`-`
|
494
|
+
- 示例:`-all,+hunyuan-lite,+hunyuan-standard`
|
495
|
+
|
480
496
|
[model-list]: /zh/docs/self-hosting/advanced/model-list
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.20.
|
3
|
+
"version": "1.20.3",
|
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,5 +1,6 @@
|
|
1
1
|
import { asc, cosineDistance, count, eq, inArray, sql } from 'drizzle-orm';
|
2
2
|
import { and, desc, isNull } from 'drizzle-orm/expressions';
|
3
|
+
import { chunk } from 'lodash-es';
|
3
4
|
|
4
5
|
import { serverDB } from '@/database/server';
|
5
6
|
import { ChunkMetadata, FileChunk, SemanticSearchChunk } from '@/types/chunk';
|
@@ -53,7 +54,15 @@ export class ChunkModel {
|
|
53
54
|
const ids = orphanedChunks.map((chunk) => chunk.chunkId);
|
54
55
|
if (ids.length === 0) return;
|
55
56
|
|
56
|
-
|
57
|
+
const list = chunk(ids, 500);
|
58
|
+
|
59
|
+
await serverDB.transaction(async (trx) => {
|
60
|
+
await Promise.all(
|
61
|
+
list.map(async (chunkIds) => {
|
62
|
+
await trx.delete(chunks).where(inArray(chunks.id, chunkIds));
|
63
|
+
}),
|
64
|
+
);
|
65
|
+
});
|
57
66
|
};
|
58
67
|
|
59
68
|
findById = async (id: string) => {
|