@lobehub/chat 1.19.7 → 1.19.9

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.

Potentially problematic release.


This version of @lobehub/chat might be problematic. Click here for more details.

package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.19.9](https://github.com/lobehub/lobe-chat/compare/v1.19.8...v1.19.9)
6
+
7
+ <sup>Released on **2024-09-20**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix a bug with server agent config when user not exist.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix a bug with server agent config when user not exist, closes [#4034](https://github.com/lobehub/lobe-chat/issues/4034) ([f6a232b](https://github.com/lobehub/lobe-chat/commit/f6a232b))
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.19.8](https://github.com/lobehub/lobe-chat/compare/v1.19.7...v1.19.8)
31
+
32
+ <sup>Released on **2024-09-19**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Delete siliconflow outdated model & disable stepfun functioncall.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Delete siliconflow outdated model & disable stepfun functioncall, closes [#4033](https://github.com/lobehub/lobe-chat/issues/4033) ([08c53eb](https://github.com/lobehub/lobe-chat/commit/08c53eb))
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.19.7](https://github.com/lobehub/lobe-chat/compare/v1.19.6...v1.19.7)
6
56
 
7
57
  <sup>Released on **2024-09-19**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.19.7",
3
+ "version": "1.19.9",
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",
@@ -28,6 +28,7 @@ export const POST = async (req: Request): Promise<NextResponse> => {
28
28
  const userService = new UserService();
29
29
  switch (type) {
30
30
  case 'user.created': {
31
+ pino.info('creating user due to clerk webhook');
31
32
  return userService.createUser(data.id, data);
32
33
  }
33
34
  case 'user.deleted': {
@@ -43,41 +43,6 @@ const Qwen: ModelProviderCard = {
43
43
  },
44
44
  tokens: 32_768,
45
45
  },
46
- {
47
- description:
48
- '通义千问数学模型是专门用于数学解题的语言模型。',
49
- displayName: 'Qwen Math Turbo',
50
- id: 'qwen-math-turbo-latest',
51
- pricing: {
52
- currency: 'CNY',
53
- input: 2,
54
- output: 6,
55
- },
56
- tokens: 4096,
57
- },
58
- {
59
- description:
60
- '通义千问数学模型是专门用于数学解题的语言模型。',
61
- displayName: 'Qwen Math Plus',
62
- id: 'qwen-math-plus-latest',
63
- pricing: {
64
- currency: 'CNY',
65
- input: 4,
66
- output: 12,
67
- },
68
- tokens: 4096,
69
- },
70
- {
71
- description: '通义千问代码模型。',
72
- displayName: 'Qwen Coder Turbo',
73
- id: 'qwen-coder-turbo-latest',
74
- pricing: {
75
- currency: 'CNY',
76
- input: 2,
77
- output: 6,
78
- },
79
- tokens: 131_072,
80
- },
81
46
  {
82
47
  description:
83
48
  '通义千问超大规模语言模型,支持长文本上下文,以及基于长文档、多文档等多个场景的对话功能。',
@@ -118,6 +83,41 @@ const Qwen: ModelProviderCard = {
118
83
  tokens: 32_000,
119
84
  vision: true,
120
85
  },
86
+ {
87
+ description:
88
+ '通义千问数学模型是专门用于数学解题的语言模型。',
89
+ displayName: 'Qwen Math Turbo',
90
+ id: 'qwen-math-turbo-latest',
91
+ pricing: {
92
+ currency: 'CNY',
93
+ input: 2,
94
+ output: 6,
95
+ },
96
+ tokens: 4096,
97
+ },
98
+ {
99
+ description:
100
+ '通义千问数学模型是专门用于数学解题的语言模型。',
101
+ displayName: 'Qwen Math Plus',
102
+ id: 'qwen-math-plus-latest',
103
+ pricing: {
104
+ currency: 'CNY',
105
+ input: 4,
106
+ output: 12,
107
+ },
108
+ tokens: 4096,
109
+ },
110
+ {
111
+ description: '通义千问代码模型。',
112
+ displayName: 'Qwen Coder Turbo',
113
+ id: 'qwen-coder-turbo-latest',
114
+ pricing: {
115
+ currency: 'CNY',
116
+ input: 2,
117
+ output: 6,
118
+ },
119
+ tokens: 131_072,
120
+ },
121
121
  {
122
122
  description: '通义千问2.5对外开源的7B规模的模型。',
123
123
  displayName: 'Qwen2.5 7B',
@@ -15,39 +15,6 @@ const SiliconCloud: ModelProviderCard = {
15
15
  },
16
16
  tokens: 32_768,
17
17
  },
18
- {
19
- description: 'DeepSeek V2 具备67亿参数,支持英中文本处理。',
20
- displayName: 'DeepSeek V2 Chat',
21
- id: 'deepseek-ai/DeepSeek-V2-Chat',
22
- pricing: {
23
- currency: 'CNY',
24
- input: 1.33,
25
- output: 1.33,
26
- },
27
- tokens: 32_768,
28
- },
29
- {
30
- description: 'DeepSeek Coder V2 为代码任务设计, 专注于高效的代码生成。',
31
- displayName: 'DeepSeek V2 Coder',
32
- id: 'deepseek-ai/DeepSeek-Coder-V2-Instruct',
33
- pricing: {
34
- currency: 'CNY',
35
- input: 1.33,
36
- output: 1.33,
37
- },
38
- tokens: 32_768,
39
- },
40
- {
41
- description: 'DeepSeek 67B 是为高复杂性对话训练的先进模型。',
42
- displayName: 'DeepSeek LLM 67B',
43
- id: 'deepseek-ai/deepseek-llm-67b-chat',
44
- pricing: {
45
- currency: 'CNY',
46
- input: 1,
47
- output: 1,
48
- },
49
- tokens: 32_768,
50
- },
51
18
  {
52
19
  description: 'Qwen2.5 是全新的大型语言模型系列,旨在优化指令式任务的处理。',
53
20
  displayName: 'Qwen2.5 7B',
@@ -8,14 +8,12 @@ const Stepfun: ModelProviderCard = {
8
8
  description: '支持大规模上下文交互,适合复杂对话场景。',
9
9
  displayName: 'Step 2 16K',
10
10
  enabled: true,
11
- functionCall: true,
12
11
  id: 'step-2-16k',
13
12
  tokens: 16_000,
14
13
  },
15
14
  {
16
15
  description: '具备超长上下文处理能力,尤其适合长文档分析。',
17
16
  displayName: 'Step 1 256K',
18
- functionCall: true,
19
17
  id: 'step-1-256k',
20
18
  tokens: 256_000,
21
19
  },
@@ -23,7 +21,6 @@ const Stepfun: ModelProviderCard = {
23
21
  description: '平衡性能与成本,适合一般场景。',
24
22
  displayName: 'Step 1 128K',
25
23
  enabled: true,
26
- functionCall: true,
27
24
  id: 'step-1-128k',
28
25
  tokens: 128_000,
29
26
  },
@@ -31,7 +28,6 @@ const Stepfun: ModelProviderCard = {
31
28
  description: '支持中等长度的对话,适用于多种应用场景。',
32
29
  displayName: 'Step 1 32K',
33
30
  enabled: true,
34
- functionCall: true,
35
31
  id: 'step-1-32k',
36
32
  tokens: 32_000,
37
33
  },
@@ -39,7 +35,6 @@ const Stepfun: ModelProviderCard = {
39
35
  description: '小型模型,适合轻量级任务。',
40
36
  displayName: 'Step 1 8K',
41
37
  enabled: true,
42
- functionCall: true,
43
38
  id: 'step-1-8k',
44
39
  tokens: 8000,
45
40
  },
@@ -47,7 +42,6 @@ const Stepfun: ModelProviderCard = {
47
42
  description: '高速模型,适合实时对话。',
48
43
  displayName: 'Step 1 Flash',
49
44
  enabled: true,
50
- functionCall: true,
51
45
  id: 'step-1-flash',
52
46
  tokens: 8000,
53
47
  },
@@ -55,7 +49,6 @@ const Stepfun: ModelProviderCard = {
55
49
  description: '支持视觉输入,增强多模态交互体验。',
56
50
  displayName: 'Step 1V 32K',
57
51
  enabled: true,
58
- functionCall: true,
59
52
  id: 'step-1v-32k',
60
53
  tokens: 32_000,
61
54
  vision: true,
@@ -64,7 +57,6 @@ const Stepfun: ModelProviderCard = {
64
57
  description: '小型视觉模型,适合基本的图文任务。',
65
58
  displayName: 'Step 1V 8K',
66
59
  enabled: true,
67
- functionCall: true,
68
60
  id: 'step-1v-8k',
69
61
  tokens: 8000,
70
62
  vision: true,
@@ -1,10 +1,12 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  import { INBOX_SESSION_ID } from '@/const/session';
4
+ import { DEFAULT_AGENT_CONFIG } from '@/const/settings';
4
5
  import { AgentModel } from '@/database/server/models/agent';
5
6
  import { FileModel } from '@/database/server/models/file';
6
7
  import { KnowledgeBaseModel } from '@/database/server/models/knowledgeBase';
7
8
  import { SessionModel } from '@/database/server/models/session';
9
+ import { UserModel } from '@/database/server/models/user';
8
10
  import { pino } from '@/libs/logger';
9
11
  import { authedProcedure, router } from '@/libs/trpc';
10
12
  import { KnowledgeItem, KnowledgeType } from '@/types/knowledgeBase';
@@ -84,6 +86,10 @@ export const agentRouter = router({
84
86
  const item = await ctx.sessionModel.findByIdOrSlug(INBOX_SESSION_ID);
85
87
  // if there is no session for user, create one
86
88
  if (!item) {
89
+ // if there is no user, return default config
90
+ const user = await UserModel.findById(ctx.userId);
91
+ if (!user) return DEFAULT_AGENT_CONFIG;
92
+
87
93
  const res = await ctx.sessionModel.createInbox();
88
94
  pino.info('create inbox session', res);
89
95
  }
@@ -6,8 +6,6 @@ import { pino } from '@/libs/logger';
6
6
 
7
7
  export class UserService {
8
8
  createUser = async (id: string, params: UserJSON) => {
9
- pino.info('creating user due to clerk webhook');
10
-
11
9
  // Check if user already exists
12
10
  const res = await UserModel.findById(id);
13
11