@lobehub/chat 1.36.4 → 1.36.6

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,57 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.36.6](https://github.com/lobehub/lobe-chat/compare/v1.36.5...v1.36.6)
6
+
7
+ <sup>Released on **2024-12-10**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Update groq, add llama3.3, Upgrade lobe-ui.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Update groq, add llama3.3, closes [#4942](https://github.com/lobehub/lobe-chat/issues/4942) ([68e4379](https://github.com/lobehub/lobe-chat/commit/68e4379))
21
+ - **misc**: Upgrade lobe-ui, closes [#4950](https://github.com/lobehub/lobe-chat/issues/4950) ([54ce087](https://github.com/lobehub/lobe-chat/commit/54ce087))
22
+
23
+ </details>
24
+
25
+ <div align="right">
26
+
27
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
28
+
29
+ </div>
30
+
31
+ ### [Version 1.36.5](https://github.com/lobehub/lobe-chat/compare/v1.36.4...v1.36.5)
32
+
33
+ <sup>Released on **2024-12-09**</sup>
34
+
35
+ #### 🐛 Bug Fixes
36
+
37
+ - **misc**: Fix wrong email linking in next-auth db adapter.
38
+
39
+ <br/>
40
+
41
+ <details>
42
+ <summary><kbd>Improvements and Fixes</kbd></summary>
43
+
44
+ #### What's fixed
45
+
46
+ - **misc**: Fix wrong email linking in next-auth db adapter, closes [#4919](https://github.com/lobehub/lobe-chat/issues/4919) ([af45a28](https://github.com/lobehub/lobe-chat/commit/af45a28))
47
+
48
+ </details>
49
+
50
+ <div align="right">
51
+
52
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
53
+
54
+ </div>
55
+
5
56
  ### [Version 1.36.4](https://github.com/lobehub/lobe-chat/compare/v1.36.3...v1.36.4)
6
57
 
7
58
  <sup>Released on **2024-12-09**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,22 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Update groq, add llama3.3, Upgrade lobe-ui."
6
+ ]
7
+ },
8
+ "date": "2024-12-10",
9
+ "version": "1.36.6"
10
+ },
11
+ {
12
+ "children": {
13
+ "fixes": [
14
+ "Fix wrong email linking in next-auth db adapter."
15
+ ]
16
+ },
17
+ "date": "2024-12-09",
18
+ "version": "1.36.5"
19
+ },
2
20
  {
3
21
  "children": {},
4
22
  "date": "2024-12-09",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.36.4",
3
+ "version": "1.36.6",
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",
@@ -4,8 +4,10 @@ import dynamic from 'next/dynamic';
4
4
  import { memo } from 'react';
5
5
  import { Center } from 'react-layout-kit';
6
6
 
7
- const LogoThree = dynamic(() => import('@lobehub/ui/es/LogoThree'), { ssr: false });
8
- const LogoSpline = dynamic(() => import('@lobehub/ui/es/LogoThree/LogoSpline'), { ssr: false });
7
+ const LogoThree = dynamic(() => import('@lobehub/ui/es/brand/LogoThree'), { ssr: false });
8
+ const LogoSpline = dynamic(() => import('@lobehub/ui/es/brand/LogoThree/LogoSpline'), {
9
+ ssr: false,
10
+ });
9
11
 
10
12
  const WelcomeLogo = memo<{ mobile?: boolean }>(({ mobile }) => {
11
13
  return mobile ? (
@@ -4,6 +4,20 @@ import { ModelProviderCard } from '@/types/llm';
4
4
  const Groq: ModelProviderCard = {
5
5
  chatModels: [
6
6
  // TODO: During preview launch, Groq is limiting 3.2 models to max_tokens of 8k.
7
+ {
8
+ description:
9
+ 'Meta Llama 3.3 多语言大语言模型 ( LLM ) 是 70B(文本输入/文本输出)中的预训练和指令调整生成模型。 Llama 3.3 指令调整的纯文本模型针对多语言对话用例进行了优化,并且在常见行业基准上优于许多可用的开源和封闭式聊天模型。',
10
+ displayName: 'Llama 3.3 70B',
11
+ enabled: true,
12
+ functionCall: true,
13
+ id: 'llama-3.3-70b-versatile',
14
+ maxOutput: 8192,
15
+ pricing: {
16
+ input: 0.05,
17
+ output: 0.08,
18
+ },
19
+ tokens: 131_072,
20
+ },
7
21
  {
8
22
  description:
9
23
  'Llama 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。',
@@ -159,6 +173,7 @@ const Groq: ModelProviderCard = {
159
173
  description:
160
174
  'Groq 的 LPU 推理引擎在最新的独立大语言模型(LLM)基准测试中表现卓越,以其惊人的速度和效率重新定义了 AI 解决方案的标准。Groq 是一种即时推理速度的代表,在基于云的部署中展现了良好的性能。',
161
175
  id: 'groq',
176
+ modelList: { showModelFetcher: true },
162
177
  modelsUrl: 'https://console.groq.com/docs/models',
163
178
  name: 'Groq',
164
179
  proxyUrl: {
@@ -115,6 +115,37 @@ describe('LobeNextAuthDbAdapter', () => {
115
115
  await serverDB.query.users.findMany({ where: eq(users.email, user.email) }),
116
116
  ).toHaveLength(1);
117
117
  });
118
+
119
+ it('should create a user if id not exist and email is null', async () => {
120
+ // In previous version, it will link the account to the existing user if the email is null
121
+ // issue: https://github.com/lobehub/lobe-chat/issues/4918
122
+ expect(nextAuthAdapter).toBeDefined();
123
+ expect(nextAuthAdapter.createUser).toBeDefined();
124
+
125
+ const existUserId = 'user-db-1';
126
+ const existUserName = 'John Doe 1';
127
+ // @ts-expect-error: createUser is defined
128
+ await nextAuthAdapter.createUser({
129
+ ...user,
130
+ id: existUserId,
131
+ name: existUserName,
132
+ email: '',
133
+ });
134
+
135
+ const anotherUserId = 'user-db-2';
136
+ const anotherUserName = 'John Doe 2';
137
+ // @ts-expect-error: createUser is defined
138
+ await nextAuthAdapter.createUser({
139
+ ...user,
140
+ id: anotherUserId,
141
+ name: anotherUserName,
142
+ email: '',
143
+ });
144
+ // Should create a new user if id not exists and email is null
145
+ expect(
146
+ await serverDB.query.users.findMany({ where: eq(users.id, anotherUserId) }),
147
+ ).toHaveLength(1);
148
+ });
118
149
  });
119
150
 
120
151
  describe('deleteUser', () => {
@@ -1,5 +1,5 @@
1
1
  import { ActionIconGroup } from '@lobehub/ui';
2
- import { ActionsBarProps } from '@lobehub/ui/es/ChatList/ActionsBar';
2
+ import { ActionsBarProps } from '@lobehub/ui/es/chat/ChatList/ActionsBar';
3
3
  import { memo } from 'react';
4
4
 
5
5
  import { useChatListActionsBar } from '../hooks/useChatListActionsBar';
@@ -8,8 +8,8 @@ import { and, eq } from 'drizzle-orm';
8
8
  import type { NeonDatabase } from 'drizzle-orm/neon-serverless';
9
9
  import { Adapter, AdapterAccount } from 'next-auth/adapters';
10
10
 
11
- import { UserModel } from '@/database/server/models/user';
12
11
  import * as schema from '@/database/schemas';
12
+ import { UserModel } from '@/database/server/models/user';
13
13
  import { merge } from '@/utils/merge';
14
14
 
15
15
  import {
@@ -53,7 +53,7 @@ export function LobeNextAuthDbAdapter(serverDB: NeonDatabase<typeof schema>): Ad
53
53
  async createUser(user): Promise<AdapterUser> {
54
54
  const { id, name, email, emailVerified, image, providerAccountId } = user;
55
55
  // return the user if it already exists
56
- let existingUser = await UserModel.findByEmail(serverDB, email);
56
+ let existingUser = email.trim() ? await UserModel.findByEmail(serverDB, email) : undefined;
57
57
  // If the user is not found by email, try to find by providerAccountId
58
58
  if (!existingUser && providerAccountId) {
59
59
  existingUser = await UserModel.findById(serverDB, providerAccountId);
@@ -169,7 +169,7 @@ export function LobeNextAuthDbAdapter(serverDB: NeonDatabase<typeof schema>): Ad
169
169
  },
170
170
 
171
171
  async getUserByEmail(email): Promise<AdapterUser | null> {
172
- const lobeUser = await UserModel.findByEmail(serverDB, email);
172
+ const lobeUser = email.trim() ? await UserModel.findByEmail(serverDB, email) : undefined;
173
173
  return lobeUser ? mapLobeUserToAdapterUser(lobeUser) : null;
174
174
  },
175
175