@lobehub/chat 1.14.9 → 1.14.10

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,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.14.10](https://github.com/lobehub/lobe-chat/compare/v1.14.9...v1.14.10)
6
+
7
+ <sup>Released on **2024-08-30**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix file relative chunks.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix file relative chunks, closes [#3676](https://github.com/lobehub/lobe-chat/issues/3676) ([afe1906](https://github.com/lobehub/lobe-chat/commit/afe1906))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 1.14.9](https://github.com/lobehub/lobe-chat/compare/v1.14.8...v1.14.9)
6
31
 
7
32
  <sup>Released on **2024-08-29**</sup>
@@ -59,7 +59,7 @@
59
59
  "status": {
60
60
  "error": "Chunking failed",
61
61
  "errorResult": "Chunking failed, please check and try again. Error detail:",
62
- "processing": "Chunking in progress.",
62
+ "processing": "Chunking",
63
63
  "processingTip": "The server is splitting text chunks; closing the page will not affect the chunking progress."
64
64
  }
65
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.14.9",
3
+ "version": "1.14.10",
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",
@@ -171,6 +171,10 @@ export class ChunkModel {
171
171
  }) {
172
172
  const similarity = sql<number>`1 - (${cosineDistance(embeddings.embeddings, embedding)})`;
173
173
 
174
+ const hasFiles = fileIds && fileIds.length > 0;
175
+
176
+ if (!hasFiles) return [];
177
+
174
178
  const result = await serverDB
175
179
  .select({
176
180
  fileId: files.id,
@@ -186,7 +190,7 @@ export class ChunkModel {
186
190
  .leftJoin(embeddings, eq(chunks.id, embeddings.chunkId))
187
191
  .leftJoin(fileChunks, eq(chunks.id, fileChunks.chunkId))
188
192
  .leftJoin(files, eq(files.id, fileChunks.fileId))
189
- .where(and(fileIds && fileIds.length > 0 ? inArray(fileChunks.fileId, fileIds) : undefined))
193
+ .where(inArray(fileChunks.fileId, fileIds))
190
194
  .orderBy((t) => desc(t.similarity))
191
195
  .limit(5);
192
196