@lobehub/chat 1.12.0 → 1.12.1

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.12.1](https://github.com/lobehub/lobe-chat/compare/v1.12.0...v1.12.1)
6
+
7
+ <sup>Released on **2024-08-21**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix embeddings multi-insert when there is issues with async task.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix embeddings multi-insert when there is issues with async task, closes [#3530](https://github.com/lobehub/lobe-chat/issues/3530) ([e2cfff7](https://github.com/lobehub/lobe-chat/commit/e2cfff7))
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.12.0](https://github.com/lobehub/lobe-chat/compare/v1.11.9...v1.12.0)
6
31
 
7
32
  <sup>Released on **2024-08-21**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
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",
@@ -0,0 +1,18 @@
1
+ -- step 1: create a temporary table to store the rows we want to keep
2
+ CREATE TEMP TABLE embeddings_temp AS
3
+ SELECT DISTINCT ON (chunk_id) *
4
+ FROM embeddings
5
+ ORDER BY chunk_id, random();
6
+
7
+ -- step 2: delete all rows from the original table
8
+ DELETE FROM embeddings;
9
+
10
+ -- step 3: insert the rows we want to keep back into the original table
11
+ INSERT INTO embeddings
12
+ SELECT * FROM embeddings_temp;
13
+
14
+ -- step 4: drop the temporary table
15
+ DROP TABLE embeddings_temp;
16
+
17
+ -- step 5: now it's safe to add the unique constraint
18
+ ALTER TABLE "embeddings" ADD CONSTRAINT "embeddings_chunk_id_unique" UNIQUE("chunk_id");