@lobehub/chat 1.36.11 → 1.36.13

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,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.36.13](https://github.com/lobehub/lobe-chat/compare/v1.36.12...v1.36.13)
6
+
7
+ <sup>Released on **2024-12-11**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Add Gemini 2.0 Flash Exp model.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Add Gemini 2.0 Flash Exp model, closes [#4981](https://github.com/lobehub/lobe-chat/issues/4981) ([aab0c53](https://github.com/lobehub/lobe-chat/commit/aab0c53))
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
+
30
+ ### [Version 1.36.12](https://github.com/lobehub/lobe-chat/compare/v1.36.11...v1.36.12)
31
+
32
+ <sup>Released on **2024-12-11**</sup>
33
+
34
+ #### ♻ Code Refactoring
35
+
36
+ - **misc**: Update sql and types.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Code refactoring
44
+
45
+ - **misc**: Update sql and types, closes [#4979](https://github.com/lobehub/lobe-chat/issues/4979) ([8243f01](https://github.com/lobehub/lobe-chat/commit/8243f01))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 1.36.11](https://github.com/lobehub/lobe-chat/compare/v1.36.10...v1.36.11)
6
56
 
7
57
  <sup>Released on **2024-12-11**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,22 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Add Gemini 2.0 Flash Exp model."
6
+ ]
7
+ },
8
+ "date": "2024-12-11",
9
+ "version": "1.36.13"
10
+ },
11
+ {
12
+ "children": {
13
+ "improvements": [
14
+ "Update sql and types."
15
+ ]
16
+ },
17
+ "date": "2024-12-11",
18
+ "version": "1.36.12"
19
+ },
2
20
  {
3
21
  "children": {
4
22
  "improvements": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.36.11",
3
+ "version": "1.36.13",
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",
@@ -3,6 +3,23 @@ import { ModelProviderCard } from '@/types/llm';
3
3
  // ref: https://ai.google.dev/gemini-api/docs/models/gemini
4
4
  const Google: ModelProviderCard = {
5
5
  chatModels: [
6
+ {
7
+ description:
8
+ 'Gemini 2.0 Flash Exp 是 Google 最新的实验性多模态AI模型,拥有下一代特性,卓越的速度,原生工具调用以及多模态生成。',
9
+ displayName: 'Gemini 2.0 Flash Experimental',
10
+ enabled: true,
11
+ functionCall: true,
12
+ id: 'gemini-2.0-flash-exp',
13
+ maxOutput: 8192,
14
+ pricing: {
15
+ cachedInput: 0,
16
+ input: 0,
17
+ output: 0,
18
+ },
19
+ releasedAt: '2024-12-11',
20
+ tokens: 1_048_576 + 8192,
21
+ vision: true,
22
+ },
6
23
  {
7
24
  description:
8
25
  'Gemini Exp 1206 是 Google 最新的实验性多模态AI模型,与历史版本相比有一定的质量提升。',
@@ -121,7 +121,7 @@ CREATE TABLE IF NOT EXISTS "unstructured_chunks" (
121
121
  "file_id" varchar
122
122
  );
123
123
  --> statement-breakpoint
124
- ALTER TABLE "files_to_messages" RENAME TO "messages_files";
124
+ ALTER TABLE "files_to_messages" RENAME TO "messages_files";--> statement-breakpoint
125
125
  DROP TABLE "files_to_agents";--> statement-breakpoint
126
126
  ALTER TABLE "files" ADD COLUMN "file_hash" varchar(64);--> statement-breakpoint
127
127
  ALTER TABLE "files" ADD COLUMN "chunk_task_id" uuid;--> statement-breakpoint
@@ -3,16 +3,20 @@ CREATE TEMP TABLE embeddings_temp AS
3
3
  SELECT DISTINCT ON (chunk_id) *
4
4
  FROM embeddings
5
5
  ORDER BY chunk_id, random();
6
+ --> statement-breakpoint
6
7
 
7
8
  -- step 2: delete all rows from the original table
8
9
  DELETE FROM embeddings;
10
+ --> statement-breakpoint
9
11
 
10
12
  -- step 3: insert the rows we want to keep back into the original table
11
13
  INSERT INTO embeddings
12
14
  SELECT * FROM embeddings_temp;
15
+ --> statement-breakpoint
13
16
 
14
17
  -- step 4: drop the temporary table
15
18
  DROP TABLE embeddings_temp;
19
+ --> statement-breakpoint
16
20
 
17
21
  -- step 5: now it's safe to add the unique constraint
18
22
  ALTER TABLE "embeddings" ADD CONSTRAINT "embeddings_chunk_id_unique" UNIQUE("chunk_id");
@@ -2,9 +2,9 @@ import { Column, count, inArray, sql } from 'drizzle-orm';
2
2
  import { and, desc, eq, exists, isNull, like, or } from 'drizzle-orm/expressions';
3
3
 
4
4
  import { LobeChatDatabase } from '@/database/type';
5
+ import { idGenerator } from '@/database/utils/idGenerator';
5
6
 
6
7
  import { NewMessage, TopicItem, messages, topics } from '../../schemas';
7
- import { idGenerator } from '@/database/utils/idGenerator';
8
8
 
9
9
  export interface CreateTopicParams {
10
10
  favorite?: boolean;
@@ -32,7 +32,7 @@ export class ClientService {
32
32
  }
33
33
 
34
34
  if (sessionGroups.length > 0) {
35
- const res = await SessionGroupModel.batchCreate(sessionGroups);
35
+ const res = await SessionGroupModel.batchCreate(sessionGroups as any);
36
36
  sessionGroupResult = this.mapImportResult(res);
37
37
  }
38
38
 
@@ -8,7 +8,7 @@ import {
8
8
  MessageRoleType,
9
9
  } from '@/types/message';
10
10
  import { MetaData } from '@/types/meta';
11
- import { SessionGroupId, SessionGroupItem } from '@/types/session';
11
+ import { SessionGroupId } from '@/types/session';
12
12
  import { ChatTopic } from '@/types/topic';
13
13
 
14
14
  interface ImportSession {
@@ -64,9 +64,17 @@ interface ImportMessage {
64
64
  updatedAt: number;
65
65
  }
66
66
 
67
+ interface ImportSessionGroup {
68
+ createdAt: number;
69
+ id: string;
70
+ name: string;
71
+ sort?: number | null;
72
+ updatedAt: number;
73
+ }
74
+
67
75
  export interface ImporterEntryData {
68
76
  messages?: ImportMessage[];
69
- sessionGroups?: SessionGroupItem[];
77
+ sessionGroups?: ImportSessionGroup[];
70
78
  sessions?: ImportSession[];
71
79
  topics?: ChatTopic[];
72
80
  version: number;