@lobehub/chat 1.11.1 → 1.11.3

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.
Files changed (137) hide show
  1. package/.nvmrc +1 -1
  2. package/CHANGELOG.md +42 -0
  3. package/Dockerfile.database +70 -22
  4. package/README.md +1 -1
  5. package/README.zh-CN.md +1 -1
  6. package/docs/self-hosting/server-database/vercel.mdx +78 -75
  7. package/docs/self-hosting/start.zh-CN.mdx +2 -2
  8. package/docs/usage/providers/siliconcloud.mdx +4 -3
  9. package/docs/usage/providers/siliconcloud.zh-CN.mdx +0 -1
  10. package/locales/ar/common.json +3 -0
  11. package/locales/ar/components.json +60 -0
  12. package/locales/ar/setting.json +5 -0
  13. package/locales/bg-BG/common.json +3 -0
  14. package/locales/bg-BG/components.json +60 -0
  15. package/locales/bg-BG/setting.json +5 -0
  16. package/locales/de-DE/common.json +3 -0
  17. package/locales/de-DE/components.json +60 -0
  18. package/locales/de-DE/setting.json +5 -0
  19. package/locales/en-US/common.json +3 -0
  20. package/locales/en-US/components.json +60 -0
  21. package/locales/en-US/setting.json +5 -0
  22. package/locales/es-ES/common.json +3 -0
  23. package/locales/es-ES/components.json +60 -0
  24. package/locales/es-ES/setting.json +5 -0
  25. package/locales/fr-FR/common.json +3 -0
  26. package/locales/fr-FR/components.json +60 -0
  27. package/locales/fr-FR/setting.json +5 -0
  28. package/locales/it-IT/common.json +3 -0
  29. package/locales/it-IT/components.json +60 -0
  30. package/locales/it-IT/setting.json +5 -0
  31. package/locales/ja-JP/common.json +3 -0
  32. package/locales/ja-JP/components.json +60 -0
  33. package/locales/ja-JP/setting.json +5 -0
  34. package/locales/ko-KR/common.json +3 -0
  35. package/locales/ko-KR/components.json +60 -0
  36. package/locales/ko-KR/setting.json +5 -0
  37. package/locales/nl-NL/common.json +3 -0
  38. package/locales/nl-NL/components.json +60 -0
  39. package/locales/nl-NL/setting.json +5 -0
  40. package/locales/pl-PL/common.json +3 -0
  41. package/locales/pl-PL/components.json +60 -0
  42. package/locales/pl-PL/setting.json +5 -0
  43. package/locales/pt-BR/common.json +3 -0
  44. package/locales/pt-BR/components.json +60 -0
  45. package/locales/pt-BR/setting.json +5 -0
  46. package/locales/ru-RU/common.json +3 -0
  47. package/locales/ru-RU/components.json +60 -0
  48. package/locales/ru-RU/setting.json +5 -0
  49. package/locales/tr-TR/common.json +3 -0
  50. package/locales/tr-TR/components.json +60 -0
  51. package/locales/tr-TR/setting.json +5 -0
  52. package/locales/vi-VN/common.json +3 -0
  53. package/locales/vi-VN/components.json +60 -0
  54. package/locales/vi-VN/setting.json +5 -0
  55. package/locales/zh-CN/common.json +3 -0
  56. package/locales/zh-CN/components.json +60 -0
  57. package/locales/zh-CN/error.json +1 -1
  58. package/locales/zh-CN/setting.json +6 -1
  59. package/locales/zh-TW/common.json +3 -0
  60. package/locales/zh-TW/components.json +60 -0
  61. package/locales/zh-TW/setting.json +5 -0
  62. package/next.config.mjs +67 -66
  63. package/package.json +20 -8
  64. package/src/app/(main)/@nav/_layout/Desktop/TopActions.test.tsx +11 -0
  65. package/src/app/(main)/@nav/_layout/Desktop/TopActions.tsx +13 -1
  66. package/src/app/(main)/settings/_layout/Desktop/SideBar.tsx +3 -22
  67. package/src/components/FileIcon/config.ts +12 -0
  68. package/src/components/FileIcon/index.tsx +30 -0
  69. package/src/components/FunctionModal/createModalHooks.ts +46 -0
  70. package/src/components/FunctionModal/index.ts +1 -0
  71. package/src/components/FunctionModal/style.tsx +39 -0
  72. package/src/components/GoBack/index.tsx +46 -0
  73. package/src/components/PanelTitle/index.tsx +41 -0
  74. package/src/components/RepoIcon/index.tsx +22 -0
  75. package/src/components/SidebarHeader/index.tsx +4 -2
  76. package/src/components/TipGuide/index.tsx +150 -0
  77. package/src/config/featureFlags/schema.ts +6 -0
  78. package/src/config/file.ts +6 -0
  79. package/src/config/knowledge.ts +17 -0
  80. package/src/const/settings/llm.ts +1 -0
  81. package/src/const/settings/systemAgent.ts +1 -0
  82. package/src/database/client/models/message.ts +5 -0
  83. package/src/features/Conversation/Messages/Default.tsx +1 -2
  84. package/src/libs/agent-runtime/AgentRuntime.ts +9 -2
  85. package/src/libs/agent-runtime/BaseAI.ts +14 -1
  86. package/src/libs/agent-runtime/qwen/index.ts +3 -4
  87. package/src/libs/agent-runtime/types/embeddings.ts +43 -0
  88. package/src/libs/agent-runtime/types/index.ts +1 -0
  89. package/src/libs/agent-runtime/utils/openaiCompatibleFactory/index.ts +25 -2
  90. package/src/libs/langchain/file.ts +29 -0
  91. package/src/libs/langchain/index.ts +1 -0
  92. package/src/libs/langchain/loaders/code/__tests__/index.test.ts +34 -0
  93. package/src/libs/langchain/loaders/code/__tests__/long.json +250 -0
  94. package/src/libs/langchain/loaders/code/__tests__/long.txt +885 -0
  95. package/src/libs/langchain/loaders/code/index.ts +15 -0
  96. package/src/libs/langchain/loaders/config.ts +6 -0
  97. package/src/libs/langchain/loaders/docx/index.ts +13 -0
  98. package/src/libs/langchain/loaders/index.ts +98 -0
  99. package/src/libs/langchain/loaders/markdown/__tests__/demo.mdx +325 -0
  100. package/src/libs/langchain/loaders/markdown/__tests__/index.test.ts +13 -0
  101. package/src/libs/langchain/loaders/markdown/index.ts +9 -0
  102. package/src/libs/langchain/loaders/pdf/index.ts +7 -0
  103. package/src/libs/langchain/loaders/pptx/index.ts +7 -0
  104. package/src/libs/langchain/loaders/txt/__tests__/index.test.ts +54 -0
  105. package/src/libs/langchain/loaders/txt/__tests__/long.json +38 -0
  106. package/src/libs/langchain/loaders/txt/__tests__/pg24022.txt +83 -0
  107. package/src/libs/langchain/loaders/txt/index.ts +9 -0
  108. package/src/libs/langchain/types.ts +1 -0
  109. package/src/libs/unstructured/__tests__/fixtures/image-parse/fast-partition-none-output.json +3258 -0
  110. package/src/libs/unstructured/__tests__/fixtures/image-parse/fast-partition-none-raw.json +3255 -0
  111. package/src/libs/unstructured/__tests__/fixtures/table-parse/auto-partition-basic-output.json +347 -0
  112. package/src/libs/unstructured/__tests__/fixtures/table-parse/auto-partition-basic-raw.json +131 -0
  113. package/src/libs/unstructured/__tests__/fixtures/table-parse/auto-partition-raw.json +276 -0
  114. package/src/libs/unstructured/__tests__/fixtures/table-parse/fast-partition-basic-output.json +1865 -0
  115. package/src/libs/unstructured/__tests__/fixtures/table-parse/fast-partition-basic-raw.json +111 -0
  116. package/src/libs/unstructured/__tests__/fixtures/table-parse/fast-partition-raw.json +1892 -0
  117. package/src/libs/unstructured/__tests__/index.test.ts +165 -0
  118. package/src/libs/unstructured/index.ts +166 -0
  119. package/src/locales/default/common.ts +3 -0
  120. package/src/locales/default/components.ts +62 -0
  121. package/src/locales/default/setting.ts +5 -0
  122. package/src/store/file/initialState.ts +1 -1
  123. package/src/store/file/selectors.ts +1 -1
  124. package/src/store/file/store.ts +1 -1
  125. package/src/store/global/initialState.ts +5 -0
  126. package/src/store/global/selectors.ts +4 -0
  127. package/src/store/serverConfig/selectors.test.ts +1 -0
  128. package/src/types/user/index.ts +12 -4
  129. package/src/types/user/settings/systemAgent.ts +1 -0
  130. package/src/utils/colorUtils.ts +19 -0
  131. package/src/utils/sleep.ts +4 -0
  132. /package/src/store/file/slices/{images → chat}/action.test.ts +0 -0
  133. /package/src/store/file/slices/{images → chat}/action.ts +0 -0
  134. /package/src/store/file/slices/{images → chat}/index.ts +0 -0
  135. /package/src/store/file/slices/{images → chat}/initialState.ts +0 -0
  136. /package/src/store/file/slices/{images → chat}/selectors.test.ts +0 -0
  137. /package/src/store/file/slices/{images → chat}/selectors.ts +0 -0
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- lts/hydrogen
1
+ lts/iron
package/CHANGELOG.md CHANGED
@@ -2,6 +2,48 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.11.3](https://github.com/lobehub/lobe-chat/compare/v1.11.2...v1.11.3)
6
+
7
+ <sup>Released on **2024-08-17**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Refactor PanelTitle and move commit from file uploading.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Code refactoring
19
+
20
+ - **misc**: Refactor PanelTitle and move commit from file uploading, closes [#3491](https://github.com/lobehub/lobe-chat/issues/3491) ([d03d9f6](https://github.com/lobehub/lobe-chat/commit/d03d9f6))
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.11.2](https://github.com/lobehub/lobe-chat/compare/v1.11.1...v1.11.2)
31
+
32
+ <sup>Released on **2024-08-17**</sup>
33
+
34
+ <br/>
35
+
36
+ <details>
37
+ <summary><kbd>Improvements and Fixes</kbd></summary>
38
+
39
+ </details>
40
+
41
+ <div align="right">
42
+
43
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
44
+
45
+ </div>
46
+
5
47
  ### [Version 1.11.1](https://github.com/lobehub/lobe-chat/compare/v1.11.0...v1.11.1)
6
48
 
7
49
  <sup>Released on **2024-08-15**</sup>
@@ -1,20 +1,32 @@
1
1
  ## Base image for all the stages
2
2
  FROM node:20-alpine AS base
3
3
 
4
+ ARG USE_CN_MIRROR
5
+
4
6
  RUN \
7
+ # If you want to build docker in China, build with --build-arg USE_CN_MIRROR=true
8
+ if [ "${USE_CN_MIRROR:-false}" = "true" ]; then \
9
+ sed -i "s/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g" "/etc/apk/repositories"; \
10
+ fi \
11
+ # Add required package & update base package
12
+ && apk update \
13
+ && apk add --no-cache bind-tools proxychains-ng \
14
+ && apk upgrade --no-cache \
5
15
  # Add user nextjs to run the app
6
- addgroup --system --gid 1001 nodejs \
7
- && adduser --system --uid 1001 nextjs
16
+ && addgroup --system --gid 1001 nodejs \
17
+ && adduser --system --uid 1001 nextjs \
18
+ && chown -R nextjs:nodejs "/etc/proxychains" \
19
+ && rm -rf /tmp/* /var/cache/apk/*
8
20
 
9
21
  ## Builder image, install all the dependencies and build the app
10
22
  FROM base AS builder
11
23
 
12
- ARG USE_NPM_CN_MIRROR
24
+ ARG USE_CN_MIRROR
13
25
 
14
- ENV KEY_VAULTS_SECRET="use-for-build" \
15
- NEXT_PUBLIC_SERVICE_MODE="server" \
16
- DATABASE_DRIVER="node" \
17
- DATABASE_URL="postgres://postgres:password@localhost:5432/postgres"
26
+ ENV NEXT_PUBLIC_SERVICE_MODE="server" \
27
+ DATABASE_DRIVER="node" \
28
+ DATABASE_URL="postgres://postgres:password@localhost:5432/postgres" \
29
+ KEY_VAULTS_SECRET="use-for-build"
18
30
 
19
31
  # Sentry
20
32
  ENV NEXT_PUBLIC_SENTRY_DSN="" \
@@ -40,8 +52,8 @@ COPY package.json ./
40
52
  COPY .npmrc ./
41
53
 
42
54
  RUN \
43
- # If you want to build docker in China, build with --build-arg USE_NPM_CN_MIRROR=true
44
- if [ "${USE_NPM_CN_MIRROR:-false}" = "true" ]; then \
55
+ # If you want to build docker in China, build with --build-arg USE_CN_MIRROR=true
56
+ if [ "${USE_CN_MIRROR:-false}" = "true" ]; then \
45
57
  export SENTRYCLI_CDNURL="https://npmmirror.com/mirrors/sentry-cli"; \
46
58
  npm config set registry "https://registry.npmmirror.com/"; \
47
59
  fi \
@@ -94,26 +106,29 @@ ENV HOSTNAME="0.0.0.0" \
94
106
  PORT="3210"
95
107
 
96
108
  # General Variables
97
- ENV API_KEY_SELECT_MODE="" \
98
- FEATURE_FLAGS=""
109
+ ENV ACCESS_CODE="" \
110
+ API_KEY_SELECT_MODE="" \
111
+ DEFAULT_AGENT_CONFIG="" \
112
+ SYSTEM_AGENT="" \
113
+ FEATURE_FLAGS="" \
114
+ PROXY_URL=""
99
115
 
100
116
  # Database
101
117
  ENV KEY_VAULTS_SECRET="" \
102
- DATABASE_DRIVER="node" \
103
- DATABASE_URL=""
118
+ DATABASE_DRIVER="node" \
119
+ DATABASE_URL=""
104
120
 
105
121
  # Next Auth
106
122
  ENV NEXT_AUTH_SECRET="" \
107
- ACCESS_CODE="" \
108
- NEXTAUTH_URL="" \
109
- NEXT_AUTH_SSO_PROVIDERS=""
123
+ NEXT_AUTH_SSO_PROVIDERS="" \
124
+ NEXTAUTH_URL=""
110
125
 
111
126
  # S3
112
- ENV S3_ACCESS_KEY_ID="" \
113
- S3_SECRET_ACCESS_KEY="" \
114
- NEXT_PUBLIC_S3_DOMAIN="" \
127
+ ENV NEXT_PUBLIC_S3_DOMAIN="" \
128
+ S3_ACCESS_KEY_ID="" \
129
+ S3_BUCKET="" \
115
130
  S3_ENDPOINT="" \
116
- S3_BUCKET=""
131
+ S3_SECRET_ACCESS_KEY=""
117
132
 
118
133
  # Model Variables
119
134
  ENV \
@@ -166,5 +181,38 @@ USER nextjs
166
181
 
167
182
  EXPOSE 3210/tcp
168
183
 
169
- # run migration , then run app
170
- CMD ["sh", "-c", "node /app/docker.cjs && node /app/server.js"]
184
+ CMD \
185
+ if [ -n "$PROXY_URL" ]; then \
186
+ # Set regex for IPv4
187
+ IP_REGEX="^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$"; \
188
+ # Set proxychains command
189
+ PROXYCHAINS="proxychains -q"; \
190
+ # Parse the proxy URL
191
+ host_with_port="${PROXY_URL#*//}"; \
192
+ host="${host_with_port%%:*}"; \
193
+ port="${PROXY_URL##*:}"; \
194
+ protocol="${PROXY_URL%%://*}"; \
195
+ # Resolve to IP address if the host is a domain
196
+ if ! [[ "$host" =~ "$IP_REGEX" ]]; then \
197
+ nslookup=$(nslookup -q="A" "$host" | tail -n +3 | grep 'Address:'); \
198
+ if [ -n "$nslookup" ]; then \
199
+ host=$(echo "$nslookup" | tail -n 1 | awk '{print $2}'); \
200
+ fi; \
201
+ fi; \
202
+ # Generate proxychains configuration file
203
+ printf "%s\n" \
204
+ 'localnet 127.0.0.0/255.0.0.0' \
205
+ 'localnet ::1/128' \
206
+ 'proxy_dns' \
207
+ 'remote_dns_subnet 224' \
208
+ 'strict_chain' \
209
+ 'tcp_connect_time_out 8000' \
210
+ 'tcp_read_time_out 15000' \
211
+ '[ProxyList]' \
212
+ "$protocol $host $port" \
213
+ > "/etc/proxychains/proxychains.conf"; \
214
+ fi; \
215
+ # Run migration
216
+ node "/app/docker.cjs"; \
217
+ # Run the server
218
+ ${PROXYCHAINS} node "/app/server.js";
package/README.md CHANGED
@@ -308,7 +308,7 @@ LobeChat supports multi-user management and provides two main user authenticatio
308
308
 
309
309
  - **next-auth**: LobeChat integrates `next-auth`, a flexible and powerful identity verification library that supports multiple authentication methods, including OAuth, email login, credential login, etc. With `next-auth`, you can easily implement user registration, login, session management, social login, and other functions to ensure the security and privacy of user data.
310
310
 
311
- - **Clerk**: For users who need more advanced user management features, LobeChat also supports `Clerk`, a modern user management platform. `Clerk` provides richer functions, such as multi-factor authentication (MFA), user profile management, login activity monitoring, etc. With `Clerk`, you can get higher security and flexibility, and easily cope with complex user management needs.
311
+ - [**Clerk**](https://go.clerk.com/exgqLG0): For users who need more advanced user management features, LobeChat also supports `Clerk`, a modern user management platform. `Clerk` provides richer functions, such as multi-factor authentication (MFA), user profile management, login activity monitoring, etc. With `Clerk`, you can get higher security and flexibility, and easily cope with complex user management needs.
312
312
 
313
313
  Regardless of which user management solution you choose, LobeChat can provide you with an excellent user experience and powerful functional support.
314
314
 
package/README.zh-CN.md CHANGED
@@ -296,7 +296,7 @@ LobeChat 支持多用户管理,提供了两种主要的用户认证和管理
296
296
 
297
297
  - **next-auth**:LobeChat 集成了 `next-auth`,一个灵活且强大的身份验证库,支持多种身份验证方式,包括 OAuth、邮件登录、凭证登录等。通过 `next-auth`,您可以轻松实现用户的注册、登录、会话管理以及社交登录等功能,确保用户数据的安全性和隐私性。
298
298
 
299
- - **Clerk**:对于需要更高级用户管理功能的用户,LobeChat 还支持 `Clerk`,一个现代化的用户管理平台。`Clerk` 提供了更丰富的功能,如多因素认证 (MFA)、白名单、用户管理、登录活动监控等。通过 `Clerk`,您可以获得更高的安全性和灵活性,轻松应对生产级的用户管理需求。
299
+ - [**Clerk**](https://go.clerk.com/exgqLG0):对于需要更高级用户管理功能的用户,LobeChat 还支持 `Clerk`,一个现代化的用户管理平台。`Clerk` 提供了更丰富的功能,如多因素认证 (MFA)、白名单、用户管理、登录活动监控等。通过 `Clerk`,您可以获得更高的安全性和灵活性,轻松应对生产级的用户管理需求。
300
300
 
301
301
  您可以根据自己的需求,选择合适的用户管理方案。
302
302
 
@@ -1,8 +1,7 @@
1
1
  ---
2
2
  title: Deploy LobeChat with database on Vercel
3
3
  description: >-
4
- Learn how to deploy LobeChat with database on Vercel with ease, including:
5
- database, authentication and S3 storage service.
4
+ Learn how to deploy LobeChat with database on Vercel with ease, including: database, authentication and S3 storage service.
6
5
  tags:
7
6
  - Deploy LobeChat
8
7
  - Vercel Deployment
@@ -44,55 +43,64 @@ In Vercel's deployment environment variables, add `DATABASE_URL` and other envir
44
43
 
45
44
  <Tab>
46
45
 
47
- <Callout type={'warning'}>
48
- Please confirm the `Postgres` type provided by your vendor. If it is `Node Postgres`, switch to the `Node Postgres` Tab.
46
+ <Callout type={'warning'}>
47
+ Please confirm the `Postgres` type provided by your vendor. If it is `Node Postgres`, switch to
48
+ the `Node Postgres` Tab.
49
49
  </Callout>
50
50
 
51
- Variables to be filled for Serverless Postgres are as follows:
51
+ Variables to be filled for Serverless Postgres are as follows:
52
52
 
53
- ```shell
54
- # Serverless Postgres DB Url
55
- DATABASE_URL=
53
+ ```shell
54
+ # Serverless Postgres DB Url
55
+ DATABASE_URL=
56
56
 
57
- # Specify service mode as server, otherwise it will not enter the server-side database
58
- NEXT_PUBLIC_SERVICE_MODE=server
59
- ```
57
+ # Specify service mode as server, otherwise it will not enter the server-side database
58
+ NEXT_PUBLIC_SERVICE_MODE=server
59
+ ```
60
60
 
61
- An example of filling in Vercel is as follows:
61
+ An example of filling in Vercel is as follows:
62
62
 
63
- <Image alt={'Add Serverless Postgres DATABASE_URL'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/d4a710cd-6404-4196-90d0-cd08ca385074'}></Image>
63
+ <Image
64
+ alt={'Add Serverless Postgres DATABASE_URL'}
65
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/d4a710cd-6404-4196-90d0-cd08ca385074'}
66
+ />
64
67
 
65
68
  </Tab>
66
69
 
67
70
  <Tab>
68
71
  Variables to be filled for Node Postgres are as follows:
69
72
 
70
- ```shell
71
- # Node Postgres DB Url
72
- DATABASE_URL=
73
+ ```shell
74
+ # Node Postgres DB Url
75
+ DATABASE_URL=
73
76
 
74
- # Specify Postgres database driver as node
75
- DATABASE_DRIVER=node
77
+ # Specify Postgres database driver as node
78
+ DATABASE_DRIVER=node
76
79
 
77
- # Specify service mode as server, otherwise it will not enter the server-side database
78
- NEXT_PUBLIC_SERVICE_MODE=server
79
- ```
80
+ # Specify service mode as server, otherwise it will not enter the server-side database
81
+ NEXT_PUBLIC_SERVICE_MODE=server
82
+ ```
80
83
 
81
- An example of filling in Vercel is as follows:
84
+ An example of filling in Vercel is as follows:
82
85
 
83
- <Image alt={'Add Node Postgres DATABASE_URL'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/1c689738-809b-4199-b305-ba5770d39da7'}></Image>
86
+ <Image
87
+ alt={'Add Node Postgres DATABASE_URL'}
88
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/1c689738-809b-4199-b305-ba5770d39da7'}
89
+ />
84
90
 
85
91
  </Tab>
86
92
 
87
93
  </Tabs>
88
94
 
89
95
  <Callout type={'info'}>
90
- If you wish to enable SSL when connecting to the database, please refer to the [link](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode) for setup instructions.
96
+ If you wish to enable SSL when connecting to the database, please refer to the
97
+ [link](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)
98
+ for setup instructions.
91
99
  </Callout>
92
100
 
93
101
  ### Add the `KEY_VAULTS_SECRET` Environment Variable
94
102
 
95
- After adding the DATABASE\_URL environment variable for the database, you need to add a `KEY_VAULTS_SECRET` environment variable. This variable is used to encrypt sensitive information such as apikeys stored by users. You can generate a random 32-character string as the key using `openssl rand -base64 32`.
103
+ After adding the DATABASE_URL environment variable for the database, you need to add a `KEY_VAULTS_SECRET` environment variable. This variable is used to encrypt sensitive information such as apikeys stored by users. You can generate a random 32-character string as the key using `openssl rand -base64 32`.
96
104
 
97
105
  ```shell
98
106
  KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
@@ -110,10 +118,11 @@ The server-side database needs to be paired with a user authentication service t
110
118
 
111
119
  ### Prepare Clerk Authentication Service
112
120
 
113
- Go to [Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) to register and create an application to obtain the corresponding Public Key and Secret Key.
121
+ Go to [Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) to register and create an application to obtain the corresponding Public Key and Secret Key.
114
122
 
115
123
  <Callout type={'info'}>
116
- If you are not familiar with Clerk, you can refer to [Authentication Service-Clerk](/en/docs/self-hosting/advanced/authentication#clerk) for details on using Clerk.
124
+ If you are not familiar with Clerk, you can refer to [Authentication
125
+ Service-Clerk](/en/docs/self-hosting/advanced/authentication#clerk) for details on using Clerk.
117
126
  </Callout>
118
127
 
119
128
  ### Add Public and Private Key Environment Variables in Vercel
@@ -121,11 +130,9 @@ If you are not familiar with Clerk, you can refer to [Authentication Service-Cle
121
130
  In Vercel's deployment environment variables, add the `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on "API Keys" in the menu, then copy the corresponding values and paste them into Vercel's environment variables.
122
131
 
123
132
  <Image
124
- alt={'Find the corresponding public and private key environment variables in Clerk'}
125
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'}>
126
-
127
- >
128
- </Image>
133
+ alt={'Find the corresponding public and private key environment variables in Clerk'}
134
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'}
135
+ />
129
136
 
130
137
  The environment variables required for this step are as follows:
131
138
 
@@ -137,11 +144,9 @@ CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
137
144
  Add the above variables to Vercel:
138
145
 
139
146
  <Image
140
- alt={'Add Clerk public and private key environment variables in Vercel'}
141
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/2bfa13df-6e20-4768-97c0-4dad06c85a2f'}>
142
-
143
- >
144
- </Image>
147
+ alt={'Add Clerk public and private key environment variables in Vercel'}
148
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/2bfa13df-6e20-4768-97c0-4dad06c85a2f'}
149
+ />
145
150
 
146
151
  ### Create and Configure Webhook in Clerk
147
152
 
@@ -150,21 +155,22 @@ Since we let Clerk fully handle user authentication and management, we need Cler
150
155
  We need to add an endpoint in Clerk's Webhooks to inform Clerk to send notifications to this endpoint when a user's information changes.
151
156
 
152
157
  <Image
153
- alt={'Add Webhooks endpoint in Clerk'}
154
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/f50f47fb-5e8e-4930-bf4e-8cf6f5b8afb9'}>
155
-
156
- >
157
- </Image>
158
+ alt={'Add Webhooks endpoint in Clerk'}
159
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/f50f47fb-5e8e-4930-bf4e-8cf6f5b8afb9'}
160
+ />
158
161
 
159
162
  Fill in the endpoint with the URL of your Vercel project, such as `https://your-project.vercel.app/api/webhooks/clerk`. Then, subscribe to events by checking the three user events (`user.created`, `user.deleted`, `user.updated`), and click create.
160
163
 
161
- <Callout type={'warning'}>The `https://` in the URL is essential to maintain the integrity of the URL.</Callout>
164
+ <Callout type={'warning'}>
165
+ The `https://` in the URL is essential to maintain the integrity of the URL.
166
+ </Callout>
162
167
 
163
168
  <Image
164
169
  alt={'Configure URL and user events when adding Clerk Webhooks'}
165
170
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'}>
166
171
 
167
172
  >
173
+
168
174
  </Image>
169
175
 
170
176
  ### Add Webhook Secret to Vercel Environment Variables
@@ -176,6 +182,7 @@ alt={'View Clerk Webhooks secret'}
176
182
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'}>
177
183
 
178
184
  >
185
+
179
186
  </Image>
180
187
 
181
188
  The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`:
@@ -187,11 +194,9 @@ CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
187
194
  Add it to Vercel's environment variables:
188
195
 
189
196
  <Image
190
- alt={'Add Clerk Webhooks secret in Vercel'}
191
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'}>
192
-
193
- >
194
- </Image>
197
+ alt={'Add Clerk Webhooks secret in Vercel'}
198
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'}
199
+ />
195
200
 
196
201
  </Steps>
197
202
 
@@ -202,7 +207,9 @@ By completing these steps, you have successfully configured the Clerk authentica
202
207
  In the server-side database, we need to configure the S3 storage service to store files.
203
208
 
204
209
  <Callout type={'info'}>
205
- In this article, S3 refers to a compatible S3 storage solution, which supports object storage systems that comply with the Amazon S3 API. Common examples include Cloudflare R2, Alibaba Cloud OSS, etc., all of which support S3-compatible APIs.
210
+ In this article, S3 refers to a compatible S3 storage solution, which supports object storage
211
+ systems that comply with the Amazon S3 API. Common examples include Cloudflare R2, Alibaba Cloud
212
+ OSS, etc., all of which support S3-compatible APIs.
206
213
  </Callout>
207
214
 
208
215
  <Steps>
@@ -216,13 +223,14 @@ The interface of Cloudflare R2 is shown below:
216
223
  <Image
217
224
  alt={'Cloudflare R2 Storage Interface'}
218
225
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/41f7f677-0153-4a96-b849-5ac9b7ebefee'}
219
- ></Image>
226
+ />
220
227
 
221
228
  When creating a storage bucket, specify its name and then click create.
229
+
222
230
  <Image
223
231
  alt={'Create Storage Bucket in R2'}
224
232
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/9c0d184c-3169-40fa-9115-011cfffb9ca7'}
225
- ></Image>
233
+ />
226
234
 
227
235
  ### Obtain Environment Variables for the Bucket
228
236
 
@@ -231,7 +239,7 @@ In the settings of the R2 storage bucket, you can view the bucket configuration
231
239
  <Image
232
240
  alt={'View Storage Bucket Information'}
233
241
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/2ceb210c-eca0-4439-ba27-8734d4ebb3ee'}
234
- ></Image>
242
+ />
235
243
 
236
244
  The corresponding environment variables are:
237
245
 
@@ -244,7 +252,9 @@ S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
244
252
  NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
245
253
  ```
246
254
 
247
- <Callout type={'warning'}>`S3_ENDPOINT` must have its path removed, otherwise uploaded files will not be accessible</Callout>
255
+ <Callout type={'warning'}>
256
+ `S3_ENDPOINT` must have its path removed, otherwise uploaded files will not be accessible
257
+ </Callout>
248
258
 
249
259
  ### Obtain S3 Key Environment Variables
250
260
 
@@ -253,28 +263,28 @@ You need to obtain the access key for S3 so that the LobeChat server has permiss
253
263
  <Image
254
264
  alt={'View Storage Bucket Access Key'}
255
265
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/be0c95c0-6693-44ee-a490-7e8dfaa8b34d'}
256
- ></Image>
266
+ />
257
267
 
258
268
  Click the button in the upper right corner to create an API token and enter the create API Token page.
259
269
 
260
270
  <Image
261
271
  alt={'Create Corresponding API Token'}
262
272
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/7b0ea46c-5157-40a8-888f-f47664a4884f'}
263
- ></Image>
273
+ />
264
274
 
265
275
  Since our server-side database needs to read and write to the S3 storage service, the permission needs to be set to `Object Read and Write`, then click create.
266
276
 
267
277
  <Image
268
278
  alt={'Configure API Token Permissions'}
269
279
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/d6f5a918-7b50-4d6e-83a6-3894ab930ddf'}
270
- ></Image>
280
+ />
271
281
 
272
282
  After creation, you can see the corresponding S3 API token.
273
283
 
274
284
  <Image
275
285
  alt={'Copy API Token'}
276
286
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/763b18f9-2b5f-44bb-a479-9b56d46f7397'}
277
- ></Image>
287
+ />
278
288
 
279
289
  The corresponding environment variables are:
280
290
 
@@ -287,7 +297,9 @@ S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f4
287
297
 
288
298
  The steps to obtain the required environment variables may vary for different S3 service providers, but the obtained environment variables should be consistent:
289
299
 
290
- <Callout type={'warning'}>The `https://` in the URL is essential and must be maintained for the completeness of the URL.</Callout>
300
+ <Callout type={'warning'}>
301
+ The `https://` in the URL is essential and must be maintained for the completeness of the URL.
302
+ </Callout>
291
303
 
292
304
  ```shell
293
305
  # S3 Keys
@@ -310,7 +322,7 @@ Then, insert the above environment variables into Vercel's environment variables
310
322
  <Image
311
323
  alt={'Adding S3 environment variables in Vercel'}
312
324
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/cd74152d-0ae8-44fd-b815-3307c56a3c18'}
313
- ></Image>
325
+ />
314
326
 
315
327
  ### Configuring Cross-Origin Resource Sharing (CORS)
316
328
 
@@ -328,7 +340,7 @@ Add a CORS rule to allow requests from your domain (in this case, `https://your-
328
340
  <Image
329
341
  alt={'Configuring allowed site domain'}
330
342
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/dfcc2cb3-2958-4498-a8a4-51bec584fe7d'}
331
- ></Image>
343
+ />
332
344
 
333
345
  Example configuration:
334
346
 
@@ -356,11 +368,9 @@ After completing the steps above, the configuration of the server-side database
356
368
  After configuring the environment variables, you need to redeploy the latest commit and wait for the deployment to complete.
357
369
 
358
370
  <Image
359
- alt={'Redeploy the latest commit'}
360
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/b3a78112-adc8-4837-b4e3-48f67058f16e'}>
361
-
362
- >
363
- </Image>
371
+ alt={'Redeploy the latest commit'}
372
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/b3a78112-adc8-4837-b4e3-48f67058f16e'}
373
+ />
364
374
 
365
375
  ### Check if the features are working properly
366
376
 
@@ -368,18 +378,12 @@ If you click on the login button in the top left corner and the login popup appe
368
378
 
369
379
  <Image
370
380
  alt={'User login popup'}
371
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/da84edc3-46f7-4e2b-a0cd-dc33a98bf5cb'}>
372
-
373
- >
374
- </Image>
381
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/da84edc3-46f7-4e2b-a0cd-dc33a98bf5cb'}/>
375
382
 
376
383
  <Image
377
384
  alt={'Login successful state'}
378
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/9cb5150d-6e1e-4c59-9a18-4e418dce1a5d'}>
379
-
380
- >
381
- </Image>
382
-
385
+ src={'https://github.com/lobehub/lobe-chat/assets/28616219/9cb5150d-6e1e-4c59-9a18-4e418dce1a5d'}/>
386
+
383
387
  </Steps>
384
388
 
385
389
  ## Appendix
@@ -415,4 +419,3 @@ NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
415
419
  # Bucket region, such as us-west-1, generally not needed to add, but some service providers may require configuration
416
420
  # S3_REGION=us-west-1
417
421
  ```
418
-
@@ -32,6 +32,6 @@ LobeChat 支持多种部署平台,包括 Vercel、Docker 和 Docker Compose
32
32
 
33
33
  针对已经了解 LobeChat 的用户,或需要多端同步的用户,可以自行部署带有服务端数据库的版本,进而获得更完整、功能更强大的 LobeChat。
34
34
 
35
- <Cards>
36
- <Card href={'/zh/docs/self-hosting/server-database'} title={'服务端数据库部署指南'} />
35
+ <Cards rows={1}>
36
+ <Card href={'/zh/docs/self-hosting/server-database'} title={'服务端数据库部署指南'} />
37
37
  </Cards>
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: Using SiliconCloud API Key in LobeChat
3
- description: Learn how to configure and use SiliconCloud's large language models in LobeChat, get your API key, and start chatting.
3
+ description: >-
4
+ Learn how to configure and use SiliconCloud's large language models in
5
+ LobeChat, get your API key, and start chatting.
4
6
  tags:
5
7
  - LobeChat
6
8
  - SiliconCloud
@@ -10,7 +12,6 @@ tags:
10
12
 
11
13
  # Using SiliconCloud in LobeChat
12
14
 
13
-
14
15
  [SiliconCloud](https://siliconflow.cn/zh-cn/siliconcloud) is a cost-effective large model service provider, offering various services such as text generation and image generation.
15
16
 
16
17
  This document will guide you on how to use SiliconCloud in LobeChat:
@@ -43,4 +44,4 @@ This document will guide you on how to use SiliconCloud in LobeChat:
43
44
 
44
45
  </Steps>
45
46
 
46
- Now you can use the models provided by SiliconCloud for conversation in LobeChat.
47
+ Now you can use the models provided by SiliconCloud for conversation in LobeChat.
@@ -10,7 +10,6 @@ tags:
10
10
 
11
11
  # 在 LobeChat 中使用 SiliconCloud
12
12
 
13
-
14
13
  [SiliconCloud](https://siliconflow.cn/zh-cn/siliconcloud) 是高性价比的大模型服务提供商,提供文本生成与图片生成等多种服务。
15
14
 
16
15
  本文档将指导你如何在 LobeChat 中使用 SiliconCloud:
@@ -13,6 +13,7 @@
13
13
  "autoGenerate": "توليد تلقائي",
14
14
  "autoGenerateTooltip": "إكمال تلقائي بناءً على الكلمات المقترحة لوصف المساعد",
15
15
  "autoGenerateTooltipDisabled": "الرجاء إدخال كلمة تلميح قبل تفعيل وظيفة الإكمال التلقائي",
16
+ "batchDelete": "حذف دفعة",
16
17
  "blog": "مدونة المنتجات",
17
18
  "cancel": "إلغاء",
18
19
  "changelog": "سجل التغييرات",
@@ -31,6 +32,7 @@
31
32
  "defaultSession": "جلسة افتراضية",
32
33
  "delete": "حذف",
33
34
  "document": "وثيقة الاستخدام",
35
+ "download": "تحميل",
34
36
  "duplicate": "إنشاء نسخة",
35
37
  "edit": "تحرير",
36
38
  "export": "تصدير الإعدادات",
@@ -192,6 +194,7 @@
192
194
  },
193
195
  "tab": {
194
196
  "chat": "الدردشة",
197
+ "files": "ملفات",
195
198
  "market": "الاكتشاف",
196
199
  "me": "أنا",
197
200
  "setting": "الإعدادات"