@lobehub/chat 1.15.1 → 1.15.2
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 +25 -0
- package/docker-compose/local/.env.example +1 -1
- package/docker-compose/production/.env.example +36 -15
- package/docker-compose/production/.env.zh-CN.example +34 -14
- package/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/knowledge-base.mdx +53 -0
- package/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx +10 -4
- package/docs/self-hosting/advanced/model-list.mdx +3 -1
- package/docs/self-hosting/advanced/model-list.zh-CN.mdx +3 -1
- package/docs/self-hosting/advanced/s3/cloudflare-r2.zh-CN.mdx +54 -52
- package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +66 -0
- package/docs/self-hosting/advanced/s3/tencent-cloud.zh-CN.mdx +82 -0
- package/docs/self-hosting/advanced/s3.mdx +2 -1
- package/docs/self-hosting/advanced/s3.zh-CN.mdx +1 -0
- package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +2 -2
- package/docs/self-hosting/environment-variables/s3.mdx +82 -0
- package/docs/self-hosting/environment-variables/s3.zh-CN.mdx +81 -0
- package/docs/self-hosting/environment-variables.mdx +1 -0
- package/docs/self-hosting/environment-variables.zh-CN.mdx +1 -0
- package/docs/self-hosting/examples/azure-openai.mdx +1 -1
- package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +1 -1
- package/docs/self-hosting/examples/ollama.zh-CN.mdx +1 -1
- package/docs/self-hosting/platform/docker.zh-CN.mdx +1 -1
- package/docs/self-hosting/platform/netlify.zh-CN.mdx +1 -1
- package/docs/self-hosting/platform/vercel.zh-CN.mdx +1 -1
- package/docs/self-hosting/server-database/docker-compose.mdx +115 -56
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +113 -58
- package/docs/self-hosting/server-database/docker.mdx +1 -1
- package/docs/self-hosting/server-database/zeabur.mdx +6 -2
- package/docs/self-hosting/server-database/zeabur.zh-CN.mdx +2 -2
- package/docs/self-hosting/server-database.mdx +2 -2
- package/docs/self-hosting/start.mdx +1 -1
- package/docs/usage/agents/custom-agent.zh-CN.mdx +2 -2
- package/docs/usage/features/local-llm.zh-CN.mdx +2 -2
- package/docs/usage/features/multi-ai-providers.zh-CN.mdx +3 -3
- package/docs/usage/features/plugin-system.mdx +1 -1
- package/docs/usage/features/plugin-system.zh-CN.mdx +2 -2
- package/docs/usage/foundation/basic.mdx +5 -5
- package/docs/usage/foundation/basic.zh-CN.mdx +5 -5
- package/docs/usage/foundation/text2image.mdx +1 -1
- package/docs/usage/foundation/text2image.zh-CN.mdx +1 -1
- package/docs/usage/plugins/custom-plugin.zh-CN.mdx +1 -1
- package/docs/usage/providers/ollama/gemma.zh-CN.mdx +2 -2
- package/docs/usage/providers/ollama/qwen.zh-CN.mdx +2 -2
- package/docs/usage/tools-calling/openai.mdx +1 -1
- package/package.json +1 -1
- package/src/config/modelProviders/google.ts +14 -14
- package/src/config/modelProviders/qwen.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.15.2](https://github.com/lobehub/lobe-chat/compare/v1.15.1...v1.15.2)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-08-30**</sup>
|
|
8
|
+
|
|
9
|
+
#### 💄 Styles
|
|
10
|
+
|
|
11
|
+
- **misc**: Update Qwen and Gemini models info.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Styles
|
|
19
|
+
|
|
20
|
+
- **misc**: Update Qwen and Gemini models info, closes [#3693](https://github.com/lobehub/lobe-chat/issues/3693) ([ba01641](https://github.com/lobehub/lobe-chat/commit/ba01641))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 1.15.1](https://github.com/lobehub/lobe-chat/compare/v1.15.0...v1.15.1)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2024-08-30**</sup>
|
|
@@ -1,35 +1,56 @@
|
|
|
1
|
-
# LobeChat domain
|
|
1
|
+
# Required: LobeChat domain for tRPC calls
|
|
2
|
+
# Ensure this domain is whitelisted in your NextAuth providers and S3 service CORS settings
|
|
2
3
|
APP_URL=https://lobe.example.com/
|
|
3
4
|
|
|
4
|
-
# Postgres related
|
|
5
|
-
#
|
|
5
|
+
# Postgres related environment variables
|
|
6
|
+
# Required: Secret key for encrypting sensitive information. Generate with: openssl rand -base64 32
|
|
6
7
|
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
|
|
7
|
-
# Postgres database connection string
|
|
8
|
-
# Format:
|
|
8
|
+
# Required: Postgres database connection string
|
|
9
|
+
# Format: postgresql://username:password@host:port/dbname
|
|
10
|
+
# If using Docker, you can use the container name as the host
|
|
9
11
|
DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres
|
|
10
12
|
|
|
11
|
-
# NEXT_AUTH related
|
|
12
|
-
#
|
|
13
|
+
# NEXT_AUTH related environment variables
|
|
14
|
+
# Supports auth0, Azure AD, GitHub, Authentik, Zitadel, Logto, etc.
|
|
15
|
+
# For supported providers, see: https://lobehub.com/docs/self-hosting/advanced/auth#next-auth
|
|
16
|
+
# If you have ACCESS_CODE, please remove it. We use NEXT_AUTH as the sole authentication source
|
|
17
|
+
# Required: NextAuth secret key. Generate with: openssl rand -base64 32
|
|
13
18
|
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
|
|
19
|
+
# Required: Specify the authentication provider (e.g., Logto)
|
|
14
20
|
NEXT_AUTH_SSO_PROVIDERS=logto
|
|
21
|
+
# Required: NextAuth URL for callbacks
|
|
15
22
|
NEXTAUTH_URL=https://lobe.example.com/api/auth
|
|
23
|
+
|
|
24
|
+
# NextAuth providers configuration (example using Logto)
|
|
25
|
+
# For other providers, see: https://lobehub.com/docs/self-hosting/environment-variables/auth
|
|
16
26
|
LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID
|
|
17
27
|
LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET
|
|
18
28
|
LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
|
|
19
|
-
|
|
20
|
-
# Proxy
|
|
29
|
+
|
|
30
|
+
# Proxy settings (if needed, e.g., when using GitHub as an auth provider)
|
|
21
31
|
# HTTP_PROXY=http://localhost:7890
|
|
22
32
|
# HTTPS_PROXY=http://localhost:7890
|
|
23
33
|
|
|
24
|
-
#
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
# S3 related environment variables (example using MinIO)
|
|
35
|
+
# Required: S3 Access Key ID (for MinIO, invalid until manually created in MinIO UI)
|
|
36
|
+
S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID
|
|
37
|
+
# Required: S3 Secret Access Key (for MinIO, invalid until manually created in MinIO UI)
|
|
38
|
+
S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY
|
|
39
|
+
# Required: S3 Endpoint for server/client connections to S3 API
|
|
27
40
|
S3_ENDPOINT=https://lobe-s3-api.example.com
|
|
28
|
-
|
|
41
|
+
# Required: S3 Bucket (invalid until manually created in MinIO UI)
|
|
42
|
+
S3_BUCKET=lobe
|
|
43
|
+
# Required: S3 Public Domain for client access to unstructured data
|
|
29
44
|
S3_PUBLIC_DOMAIN=https://lobe-s3-api.example.com
|
|
45
|
+
# Optional: S3 Enable Path Style
|
|
46
|
+
# Use 0 for mainstream S3 cloud providers; use 1 for self-hosted MinIO
|
|
47
|
+
# See: https://lobehub.com/docs/self-hosting/advanced/s3#s-3-enable-path-style
|
|
30
48
|
S3_ENABLE_PATH_STYLE=1
|
|
31
49
|
|
|
32
|
-
# Other environment variables
|
|
50
|
+
# Other basic environment variables (as needed)
|
|
51
|
+
# See: https://lobehub.com/docs/self-hosting/environment-variables/basic
|
|
52
|
+
# Note: For server versions, the API must support embedding models (OpenAI text-embedding-3-small) for file processing
|
|
53
|
+
# You don't need to specify this model in OPENAI_MODEL_LIST
|
|
33
54
|
# OPEANAI_API_KEY=sk-xxxx
|
|
34
55
|
# OPENAI_PROXY_URL=https://api.openai.com/v1
|
|
35
|
-
# OPENAI_MODEL_LIST=...
|
|
56
|
+
# OPENAI_MODEL_LIST=...
|
|
@@ -1,35 +1,55 @@
|
|
|
1
|
-
# LobeChat
|
|
1
|
+
# 必填,LobeChat 域名,用于 tRPC 调用
|
|
2
|
+
# 请保证此域名在你的 NextAuth 鉴权服务提供商、S3 服务商的 CORS 白名单中
|
|
2
3
|
APP_URL=https://lobe.example.com/
|
|
3
4
|
|
|
4
|
-
# Postgres 相关,也即 DB
|
|
5
|
-
#
|
|
5
|
+
# Postgres 相关,也即 DB 必需的环境变量
|
|
6
|
+
# 必填,用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成
|
|
6
7
|
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
|
|
7
|
-
# Postgres
|
|
8
|
-
# 格式:
|
|
8
|
+
# 必填,Postgres 数据库连接字符串,用于连接到数据库
|
|
9
|
+
# 格式:postgresql://username:password@host:port/dbname,如果你的 pg 实例为 Docker 容器且位于同一 docker-compose 文件中,亦可使用容器名作为 host
|
|
9
10
|
DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/postgres
|
|
10
11
|
|
|
11
|
-
# NEXT_AUTH
|
|
12
|
-
#
|
|
12
|
+
# NEXT_AUTH 相关,也即鉴权服务必需的环境变量
|
|
13
|
+
# 可以使用 auth0、Azure AD、GitHub、Authentik、Zitadel、Logto 等,如有其他接入诉求欢迎提 PR
|
|
14
|
+
# 目前支持的鉴权服务提供商请参考:https://lobehub.com/zh/docs/self-hosting/advanced/auth#next-auth
|
|
15
|
+
# 如果你有 ACCESS_CODE,请务必清空,我们以 NEXT_AUTH 作为唯一鉴权来源
|
|
16
|
+
# 必填,用于 NextAuth 的密钥,可以使用 openssl rand -base64 32 生成
|
|
13
17
|
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
|
|
18
|
+
# 必填,指定鉴权服务提供商,这里以 Logto 为例
|
|
14
19
|
NEXT_AUTH_SSO_PROVIDERS=logto
|
|
20
|
+
# 必填,NextAuth 的 URL,用于 NextAuth 的回调
|
|
15
21
|
NEXTAUTH_URL=https://lobe.example.com/api/auth
|
|
22
|
+
|
|
23
|
+
# NextAuth 鉴权服务提供商部分,以 Logto 为例
|
|
24
|
+
# 其他鉴权服务提供商所需的环境变量,请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/auth
|
|
16
25
|
LOGTO_CLIENT_ID=YOUR_LOGTO_CLIENT_ID
|
|
17
26
|
LOGTO_CLIENT_SECRET=YOUR_LOGTO_CLIENT_SECRET
|
|
18
27
|
LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
|
|
19
|
-
|
|
20
|
-
#
|
|
28
|
+
|
|
29
|
+
# 代理相关,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商)
|
|
21
30
|
# HTTP_PROXY=http://localhost:7890
|
|
22
31
|
# HTTPS_PROXY=http://localhost:7890
|
|
23
32
|
|
|
24
|
-
#
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
# S3 相关,也即非结构化数据(文件、图片等)存储必需的环境变量
|
|
34
|
+
# 这里以 MinIO 为例
|
|
35
|
+
# 必填,S3 的 Access Key ID,对于 MinIO 来说,直到在 MinIO UI 中手动创建之前都是无效的
|
|
36
|
+
S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID
|
|
37
|
+
# 必填,S3 的 Secret Access Key,对于 MinIO 来说,直到在 MinIO UI 中手动创建之前都是无效的
|
|
38
|
+
S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY
|
|
39
|
+
# 必填,S3 的 Endpoint,用于服务端/客户端连接到 S3 API
|
|
27
40
|
S3_ENDPOINT=https://lobe-s3-api.example.com
|
|
28
|
-
|
|
41
|
+
# 必填,S3 的 Bucket,直到在 MinIO UI 中手动创建之前都是无效的
|
|
42
|
+
S3_BUCKET=lobe
|
|
43
|
+
# 必填,S3 的 Public Domain,用于客户端通过公开连接访问非结构化数据
|
|
29
44
|
S3_PUBLIC_DOMAIN=https://lobe-s3-api.example.com
|
|
45
|
+
# 选填,S3 的 Enable Path Style
|
|
46
|
+
# 对于主流 S3 Cloud 服务商,一般填 0 即可;对于自部署的 MinIO,请填 1
|
|
47
|
+
# 请参考:https://lobehub.com/zh/docs/self-hosting/advanced/s3#s-3-enable-path-style
|
|
30
48
|
S3_ENABLE_PATH_STYLE=1
|
|
31
49
|
|
|
32
|
-
#
|
|
50
|
+
# 其他基础环境变量,视需求而定。注意不要有 ACCESS_CODE
|
|
51
|
+
# 请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/basic
|
|
52
|
+
# 请注意,对于服务端版本,其 API 必须支持嵌入(即 OpenAI text-embedding-3-small)模型,否则无法对上传文件进行处理,但你无需在 OPENAI_MODEL_LIST 中指定此模型
|
|
33
53
|
# OPEANAI_API_KEY=sk-xxxx
|
|
34
54
|
# OPENAI_PROXY_URL=https://api.openai.com/v1
|
|
35
55
|
# OPENAI_MODEL_LIST=...
|
|
@@ -63,7 +63,7 @@ identity_providers:
|
|
|
63
63
|
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://chat.example.com/api/auth` |
|
|
64
64
|
|
|
65
65
|
<Callout type={'tip'}>
|
|
66
|
-
前往 [📘 环境变量](/docs/self-hosting/environment-variable#Authelia) 可查阅相关变量详情。
|
|
66
|
+
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#Authelia) 可查阅相关变量详情。
|
|
67
67
|
|
|
68
68
|
</Callout>
|
|
69
69
|
</Steps>
|
|
@@ -57,7 +57,7 @@ https://your-domain/api/auth/callback/authentik
|
|
|
57
57
|
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
|
|
58
58
|
|
|
59
59
|
<Callout type={'tip'}>
|
|
60
|
-
前往 [📘 环境变量](/docs/self-hosting/environment-variable#Authentik) 可查阅相关变量详情。
|
|
60
|
+
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#Authentik) 可查阅相关变量详情。
|
|
61
61
|
|
|
62
62
|
</Callout>
|
|
63
63
|
</Steps>
|
|
@@ -55,7 +55,7 @@ tags:
|
|
|
55
55
|
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://chat.example.com/api/auth` |
|
|
56
56
|
|
|
57
57
|
<Callout type={'tip'}>
|
|
58
|
-
前往 [📘 环境变量](/docs/self-hosting/environment-variable#Cloudflare%20Zero%20Trust) 可查阅相关变量详情。
|
|
58
|
+
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#Cloudflare%20Zero%20Trust) 可查阅相关变量详情。
|
|
59
59
|
|
|
60
60
|
</Callout>
|
|
61
61
|
</Steps>
|
|
@@ -85,7 +85,7 @@ tags:
|
|
|
85
85
|
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
|
|
86
86
|
|
|
87
87
|
<Callout type={'tip'}>
|
|
88
|
-
前往 [📘 环境变量](/docs/self-hosting/environment-variables/auth#github) 可查阅相关变量详情。
|
|
88
|
+
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#github) 可查阅相关变量详情。
|
|
89
89
|
|
|
90
90
|
</Callout>
|
|
91
91
|
</Steps>
|
|
@@ -70,7 +70,7 @@ tags:
|
|
|
70
70
|
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://lobe.example.com/api/auth` |
|
|
71
71
|
|
|
72
72
|
<Callout type={'tip'}>
|
|
73
|
-
前往 [📘 环境变量](/docs/self-hosting/environment-variables/auth#logto) 可查阅相关变量详情。
|
|
73
|
+
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#logto) 可查阅相关变量详情。
|
|
74
74
|
|
|
75
75
|
</Callout>
|
|
76
76
|
</Steps>
|
|
@@ -76,7 +76,7 @@ https://your-domain/api/auth/callback/azure-ad
|
|
|
76
76
|
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
|
|
77
77
|
|
|
78
78
|
<Callout type={'tip'}>
|
|
79
|
-
前往 [📘 环境变量](/docs/self-hosting/environment-variable#microsoft-entra-id) 可查阅相关变量详情。
|
|
79
|
+
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#microsoft-entra-id) 可查阅相关变量详情。
|
|
80
80
|
|
|
81
81
|
</Callout>
|
|
82
82
|
</Steps>
|
|
@@ -103,7 +103,7 @@ http(s)://your-domain/api/auth/callback/zitadel
|
|
|
103
103
|
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 中执行 OAuth 认证的回调地址。仅当默认地址不正确时才需要设置。`https://example.com/api/auth` |
|
|
104
104
|
|
|
105
105
|
<Callout type={'tip'}>
|
|
106
|
-
您可以在 [📘 环境变量](/docs/self-hosting/environment-variables/auth#zitadel) 中查看相关变量的详细信息。
|
|
106
|
+
您可以在 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#zitadel) 中查看相关变量的详细信息。
|
|
107
107
|
|
|
108
108
|
</Callout>
|
|
109
109
|
</Steps>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Knowledge Base / File Upload
|
|
2
|
+
|
|
3
|
+
LobeChat supports file upload and knowledge base management. This feature relies on the following core technical components. Understanding these components will help you successfully deploy and maintain the knowledge base system.
|
|
4
|
+
|
|
5
|
+
## Core Components
|
|
6
|
+
|
|
7
|
+
### 1. PostgreSQL and PGVector
|
|
8
|
+
|
|
9
|
+
PostgreSQL is a powerful open-source relational database system, and PGVector is its extension for vector operations.
|
|
10
|
+
|
|
11
|
+
- **Purpose**: Store structured data and vector indexes
|
|
12
|
+
- **Deployment Tip**: Use official Docker image for quick deployment
|
|
13
|
+
|
|
14
|
+
Deployment script example:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
docker run -p 5432:5432 -d --name pg -e POSTGRES_PASSWORD=mysecretpassword pgvector/pgvector:pg16
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- **Note**: Ensure sufficient resources for vector operations
|
|
21
|
+
|
|
22
|
+
### 2. S3-compatible Object Storage
|
|
23
|
+
|
|
24
|
+
S3 (or S3-compatible storage services) is used for storing uploaded files.
|
|
25
|
+
|
|
26
|
+
- **Purpose**: Store raw files
|
|
27
|
+
- **Options**: AWS S3, MinIO, or other S3-compatible services
|
|
28
|
+
- **Note**: Configure appropriate access permissions and security policies
|
|
29
|
+
|
|
30
|
+
### 3. OpenAI Embedding
|
|
31
|
+
|
|
32
|
+
OpenAI's Embedding service is used to convert text into vector representations.
|
|
33
|
+
|
|
34
|
+
<Callout type={'info'}>
|
|
35
|
+
|
|
36
|
+
LobeChat currently uses OpenAI's `text-embedding-3-small` model by default. Ensure your API Key has access to this model.
|
|
37
|
+
|
|
38
|
+
</Callout>
|
|
39
|
+
|
|
40
|
+
- **Purpose**: Generate vector representations for semantic search
|
|
41
|
+
- **Notes**:
|
|
42
|
+
- Requires valid OpenAI API key
|
|
43
|
+
- Implement proper API call limits and error handling
|
|
44
|
+
|
|
45
|
+
### 4. Unstructured.io (Optional)
|
|
46
|
+
|
|
47
|
+
Unstructured.io is a powerful document processing tool.
|
|
48
|
+
|
|
49
|
+
- **Purpose**: Process complex document formats, extract structured information
|
|
50
|
+
- **Use Case**: Handle non-plain text formats like PDF, Word
|
|
51
|
+
- **Note**: Evaluate processing needs based on document complexity
|
|
52
|
+
|
|
53
|
+
By correctly configuring and integrating these core components, you can build a powerful and efficient knowledge base system for LobeChat. Each component plays a crucial role in the overall architecture, supporting advanced document management and intelligent retrieval functions.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 知识库 / 文件上传
|
|
2
2
|
|
|
3
|
-
LobeChat
|
|
3
|
+
LobeChat 支持文件上传 / 知识库管理。该功能依赖于以下核心技术组件,了解这些组件将有助于你成功部署和维护知识库系统。
|
|
4
4
|
|
|
5
5
|
## 核心组件
|
|
6
6
|
|
|
@@ -31,10 +31,16 @@ S3(或兼容 S3 协议的存储服务)用于存储上传的文件。
|
|
|
31
31
|
|
|
32
32
|
OpenAI 的嵌入(Embedding)服务用于将文本转化为向量表示。
|
|
33
33
|
|
|
34
|
+
<Callout type={'info'}>
|
|
35
|
+
|
|
36
|
+
LobeChat 当前默认使用 OpenAI `text-embedding-3-small` 模型,请确保你的 API Key 可以访问该模型。
|
|
37
|
+
|
|
38
|
+
</Callout>
|
|
39
|
+
|
|
34
40
|
- **用途**:生成文本的向量表示,用于语义搜索
|
|
35
41
|
- **注意事项**:
|
|
36
|
-
- 需要有效的 OpenAI API 密钥
|
|
37
|
-
- 实施适当的 API 调用限制和错误处理机制
|
|
42
|
+
- 需要有效的 OpenAI API 密钥
|
|
43
|
+
- 实施适当的 API 调用限制和错误处理机制
|
|
38
44
|
|
|
39
45
|
### 4. Unstructured.io(可选)
|
|
40
46
|
|
|
@@ -12,7 +12,9 @@ tags:
|
|
|
12
12
|
|
|
13
13
|
# Model List
|
|
14
14
|
|
|
15
|
-
LobeChat supports customizing the model list during deployment. This configuration is done in the environment for each [model provider](/docs/self-hosting/environment-variables/model-provider).
|
|
15
|
+
LobeChat supports customizing the model list during deployment. This configuration is done in the environment for each [model provider](/docs/self-hosting/environment-variables/model-provider).
|
|
16
|
+
|
|
17
|
+
You can use `+` to add a model, `-` to hide a model, and use `model name=display name<extension configuration>` to customize the display name of a model, separated by English commas. The basic syntax is as follows:
|
|
16
18
|
|
|
17
19
|
```text
|
|
18
20
|
id=displayName<maxToken:vision:fc:file>,model2,model3
|
|
@@ -11,7 +11,9 @@ tags:
|
|
|
11
11
|
|
|
12
12
|
# Model List
|
|
13
13
|
|
|
14
|
-
LobeChat
|
|
14
|
+
LobeChat 支持在部署时自定义模型列表,详情请参考 [模型提供商](/zh/docs/self-hosting/environment-variables/model-provider) 。
|
|
15
|
+
|
|
16
|
+
你可以使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名<扩展配置>` 来自定义模型的展示名,用英文逗号隔开。通过 `<>` 来添加扩展配置。基本语法如下:
|
|
15
17
|
|
|
16
18
|
```text
|
|
17
19
|
id=displayName<maxToken:vision:fc:file>,model2,model3
|
|
@@ -7,6 +7,7 @@ tags:
|
|
|
7
7
|
- 文件存储
|
|
8
8
|
- 环境变量
|
|
9
9
|
---
|
|
10
|
+
|
|
10
11
|
# 配置 Cloudflare R2 存储服务
|
|
11
12
|
|
|
12
13
|
在服务端数据库中我们需要配置 S3 存储服务来存储文件。
|
|
@@ -15,31 +16,32 @@ tags:
|
|
|
15
16
|
|
|
16
17
|
<Steps>
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
### 配置并获取 S3 存储桶
|
|
20
|
+
|
|
21
|
+
你需要前往你的 S3 服务提供商(如 AWS S3、Cloudflare R2 等)并创建一个新的存储桶(Bucket)。接下来以 Cloudflare R2 为例,介绍创建流程。
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
下图是 Cloudflare R2 的界面:
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
<Image
|
|
26
|
+
alt={'Cloudflare R2 存储界面'}
|
|
27
|
+
src={'https://github.com/lobehub/lobe-chat/assets/28616219/41f7f677-0153-4a96-b849-5ac9b7ebefee'}
|
|
28
|
+
/>
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
alt={'Cloudflare R2 存储界面'}
|
|
26
|
-
src={'https://github.com/lobehub/lobe-chat/assets/28616219/41f7f677-0153-4a96-b849-5ac9b7ebefee'}
|
|
27
|
-
></Image>
|
|
30
|
+
创建存储桶时将指定其名称,然后点击创建。
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
></Image>
|
|
32
|
+
<Image
|
|
33
|
+
alt={'R2 创建存储桶'}
|
|
34
|
+
src={'https://github.com/lobehub/lobe-chat/assets/28616219/9c0d184c-3169-40fa-9115-011cfffb9ca7'}
|
|
35
|
+
/>
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
### 获取存储桶相关环境变量
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
在 R2 存储桶的设置中,可以看到桶配置的信息:
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
<Image
|
|
42
|
+
alt={'查看存储桶的相关信息'}
|
|
43
|
+
src={'https://github.com/lobehub/lobe-chat/assets/28616219/2ceb210c-eca0-4439-ba27-8734d4ebb3ee'}
|
|
44
|
+
/>
|
|
43
45
|
|
|
44
46
|
其对应的环境变量为:
|
|
45
47
|
|
|
@@ -54,60 +56,60 @@ S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com
|
|
|
54
56
|
|
|
55
57
|
<Callout type={'warning'}>`S3_ENDPOINT`必须删除其路径,否则会无法访问所上传文件</Callout>
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
### 获取 S3 密钥环境变量
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
你需要获取 S3 的访问密钥,以便 LobeChat 的服务端有权限访问 S3 存储服务。在 R2 中,你可以在账户详情中配置访问密钥:
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
<Image
|
|
64
|
+
alt={'查看存储桶的访问秘钥'}
|
|
65
|
+
src={'https://github.com/lobehub/lobe-chat/assets/28616219/be0c95c0-6693-44ee-a490-7e8dfaa8b34d'}
|
|
66
|
+
/>
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
点击右上角按钮创建 API token,进入创建 API Token 页面
|
|
67
69
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
<Image
|
|
71
|
+
alt={'创建对应 API token'}
|
|
72
|
+
src={'https://github.com/lobehub/lobe-chat/assets/28616219/7b0ea46c-5157-40a8-888f-f47664a4884f'}
|
|
73
|
+
/>
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
鉴于我们的服务端数据库需要读写 S3 存储服务,因此权限需要选择`对象读与写`,然后点击创建。
|
|
74
76
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
<Image
|
|
78
|
+
alt={'配置 API token 权限'}
|
|
79
|
+
src={'https://github.com/lobehub/lobe-chat/assets/28616219/d6f5a918-7b50-4d6e-83a6-3894ab930ddf'}
|
|
80
|
+
/>
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
创建完成后,就可以看到对应的 S3 API token
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
<Image
|
|
85
|
+
alt={'复制 API token'}
|
|
86
|
+
src={'https://github.com/lobehub/lobe-chat/assets/28616219/763b18f9-2b5f-44bb-a479-9b56d46f7397'}
|
|
87
|
+
/>
|
|
86
88
|
|
|
87
|
-
|
|
89
|
+
其对应的环境变量为:
|
|
88
90
|
|
|
89
91
|
```shell
|
|
90
92
|
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
|
91
93
|
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
|
92
94
|
```
|
|
93
95
|
|
|
94
|
-
|
|
96
|
+
### 配置跨域
|
|
95
97
|
|
|
96
|
-
|
|
98
|
+
由于 S3 存储服务往往是一个独立的网址,因此需要配置跨域访问。
|
|
97
99
|
|
|
98
|
-
|
|
100
|
+
在 R2 中,你可以在存储桶的设置中找到跨域配置:
|
|
99
101
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
<Image
|
|
103
|
+
alt={'Cloudflare R2 的跨域设置'}
|
|
104
|
+
src={'https://github.com/lobehub/lobe-chat/assets/28616219/ab008be7-26b2-4b78-8bd9-24301bf34d23'}
|
|
105
|
+
/>
|
|
104
106
|
|
|
105
|
-
|
|
107
|
+
添加跨域规则,允许你的域名(在上文是 `https://your-project.vercel.app`)来源的请求:
|
|
106
108
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
<Image
|
|
110
|
+
alt={'配置允许你的站点域名'}
|
|
111
|
+
src={'https://github.com/lobehub/lobe-chat/assets/28616219/dfcc2cb3-2958-4498-a8a4-51bec584fe7d'}
|
|
112
|
+
/>
|
|
111
113
|
|
|
112
114
|
示例配置如下:
|
|
113
115
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Configuring Tencent Cloud COS Storage Service
|
|
3
|
+
description: >-
|
|
4
|
+
Detailed steps to configure Tencent Cloud COS storage service for smooth file
|
|
5
|
+
storage.
|
|
6
|
+
tags:
|
|
7
|
+
- Tencent Cloud COS
|
|
8
|
+
- S3 Storage
|
|
9
|
+
- File Storage
|
|
10
|
+
- Environment Variables
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Configuring Tencent Cloud COS Storage Service
|
|
14
|
+
|
|
15
|
+
We need to configure S3 storage service for file storage in the server-side database.
|
|
16
|
+
|
|
17
|
+
## Configuration Steps
|
|
18
|
+
|
|
19
|
+
<Steps>
|
|
20
|
+
### Configure and Obtain S3 Bucket
|
|
21
|
+
|
|
22
|
+
Create a new bucket on [Tencent Cloud COS](https://console.cloud.tencent.com/cos/bucket):
|
|
23
|
+
|
|
24
|
+
<Image alt={'Tencent Cloud COS Storage Interface'} src={'https://github.com/user-attachments/assets/d3626294-74ba-4944-9a63-052e6cf719ab'} />
|
|
25
|
+
|
|
26
|
+
Name the bucket (e.g., 'lobe'). Choose 'Public Read, Private Write', select any region, and keep other settings default.
|
|
27
|
+
|
|
28
|
+
<Image alt={'COS Create Bucket'} src={'https://github.com/user-attachments/assets/7257eb0e-4e2c-4db2-981d-354598e2c60f'} />
|
|
29
|
+
|
|
30
|
+
### Get Bucket-related Environment Variables
|
|
31
|
+
|
|
32
|
+
View bucket information in COS bucket overview:
|
|
33
|
+
|
|
34
|
+
<Image alt={'View Bucket Information'} src={'https://github.com/user-attachments/assets/d7d65e32-679d-4e50-a933-28cf5dde1330'} />
|
|
35
|
+
|
|
36
|
+
Corresponding environment variables:
|
|
37
|
+
|
|
38
|
+
```shell
|
|
39
|
+
S3_BUCKET=lobe-130xxxxxx2
|
|
40
|
+
S3_ENDPOINT=https://cos.ap-chengdu.myqcloud.com
|
|
41
|
+
S3_REGION=ap-chengdu
|
|
42
|
+
S3_PUBLIC_DOMAIN=https://lobe-1251234567.cos.ap-chengdu.myqcloud.com
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
<Callout type={'warning'}>
|
|
46
|
+
Note: `S3_ENDPOINT` should be `https://cos.ap-chengdu.myqcloud.com`, not `https://lobe-130xxxxxx2.cos.ap-chengdu.myqcloud.com`
|
|
47
|
+
|
|
48
|
+
Include `https://` in the URL
|
|
49
|
+
|
|
50
|
+
</Callout>
|
|
51
|
+
|
|
52
|
+
### Configure CORS
|
|
53
|
+
|
|
54
|
+
Add the following in 'Security Management - CORS Settings':
|
|
55
|
+
|
|
56
|
+
<Image alt={'Configure CORS'} src={'https://github.com/user-attachments/assets/35164b25-c964-42ce-9cb0-32f6ebe1d07c'} />
|
|
57
|
+
|
|
58
|
+
### Get S3 Keys
|
|
59
|
+
|
|
60
|
+
Create a new SecretId and SecretKey at [Tencent Cloud API Key Management](https://console.cloud.tencent.com/cam/capi). Use as `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY`.
|
|
61
|
+
</Steps>
|
|
62
|
+
|
|
63
|
+
### Additional Notes
|
|
64
|
+
|
|
65
|
+
- Consider setting up CDN acceleration for improved access speed and reduced costs.
|
|
66
|
+
- Use role management when creating API keys for enhanced security.
|