@lobehub/chat 1.21.7 → 1.21.8
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
CHANGED
@@ -2,6 +2,39 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.21.8](https://github.com/lobehub/lobe-chat/compare/v1.21.7...v1.21.8)
|
6
|
+
|
7
|
+
<sup>Released on **2024-10-08**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Fix auto rewrite query when user message is too long.
|
12
|
+
|
13
|
+
#### 💄 Styles
|
14
|
+
|
15
|
+
- **misc**: Support yml in file chunk.
|
16
|
+
|
17
|
+
<br/>
|
18
|
+
|
19
|
+
<details>
|
20
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
21
|
+
|
22
|
+
#### What's fixed
|
23
|
+
|
24
|
+
- **misc**: Fix auto rewrite query when user message is too long, closes [#4288](https://github.com/lobehub/lobe-chat/issues/4288) ([a2d3d32](https://github.com/lobehub/lobe-chat/commit/a2d3d32))
|
25
|
+
|
26
|
+
#### Styles
|
27
|
+
|
28
|
+
- **misc**: Support yml in file chunk, closes [#4283](https://github.com/lobehub/lobe-chat/issues/4283) ([cec7ec0](https://github.com/lobehub/lobe-chat/commit/cec7ec0))
|
29
|
+
|
30
|
+
</details>
|
31
|
+
|
32
|
+
<div align="right">
|
33
|
+
|
34
|
+
[](#readme-top)
|
35
|
+
|
36
|
+
</div>
|
37
|
+
|
5
38
|
### [Version 1.21.7](https://github.com/lobehub/lobe-chat/compare/v1.21.6...v1.21.7)
|
6
39
|
|
7
40
|
<sup>Released on **2024-10-08**</sup>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.21.
|
3
|
+
"version": "1.21.8",
|
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",
|
package/src/middleware.ts
CHANGED
@@ -9,7 +9,7 @@ import { OAUTH_AUTHORIZED } from './const/auth';
|
|
9
9
|
export const config = {
|
10
10
|
matcher: [
|
11
11
|
// include any files in the api or trpc folders that might have an extension
|
12
|
-
'/(api|trpc)(.*)',
|
12
|
+
'/(api|trpc|webapi)(.*)',
|
13
13
|
// include the /
|
14
14
|
'/',
|
15
15
|
'/chat(.*)',
|
@@ -67,9 +67,10 @@ export const chatRag: StateCreator<ChatStore, [['zustand/devtools', never]], [],
|
|
67
67
|
// 1. get the rewrite query
|
68
68
|
let rewriteQuery = message?.ragQuery || userQuery;
|
69
69
|
|
70
|
+
// only rewrite query length is less than 10 characters
|
70
71
|
// if there is no ragQuery and there is a chat history
|
71
72
|
// we need to rewrite the user message to get better results
|
72
|
-
if (!message?.ragQuery && messages.length > 0) {
|
73
|
+
if (rewriteQuery.length < 10 && !message?.ragQuery && messages.length > 0) {
|
73
74
|
rewriteQuery = await get().internal_rewriteQuery(id, userQuery, messages);
|
74
75
|
}
|
75
76
|
|