@lobehub/lobehub 2.1.1 → 2.1.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.
- package/.env.example +4 -3
- package/.github/workflows/release-desktop-stable.yml +1 -1
- package/CHANGELOG.md +50 -0
- package/Dockerfile +6 -4
- package/README.md +3 -4
- package/README.zh-CN.md +3 -4
- package/apps/desktop/src/main/controllers/McpInstallCtr.ts +10 -10
- package/apps/desktop/src/main/controllers/NetworkProxyCtr.ts +6 -6
- package/apps/desktop/src/main/controllers/RemoteServerSyncCtr.ts +2 -2
- package/changelog/v2.json +14 -0
- package/docs/changelog/2025-03-02-new-models.mdx +1 -1
- package/docs/changelog/2025-03-02-new-models.zh-CN.mdx +1 -1
- package/docs/changelog/2025-04-06-exports.mdx +1 -1
- package/docs/changelog/2025-04-06-exports.zh-CN.mdx +1 -1
- package/docs/changelog/2025-05-08-desktop-app.mdx +2 -2
- package/docs/changelog/2025-05-08-desktop-app.zh-CN.mdx +2 -2
- package/docs/changelog/2025-06-08-claude-4.mdx +1 -1
- package/docs/changelog/2025-06-08-claude-4.zh-CN.mdx +1 -1
- package/docs/changelog/2025-07-08-mcp-market.mdx +1 -1
- package/docs/changelog/2025-07-08-mcp-market.zh-CN.mdx +1 -1
- package/docs/changelog/2025-08-08-image-generation.mdx +1 -1
- package/docs/changelog/2025-08-08-image-generation.zh-CN.mdx +1 -1
- package/docs/changelog/2025-09-08-gemini.mdx +1 -1
- package/docs/changelog/2025-09-08-gemini.zh-CN.mdx +1 -1
- package/docs/changelog/2025-10-08-python.mdx +1 -1
- package/docs/changelog/2025-10-08-python.zh-CN.mdx +1 -1
- package/docs/changelog/2025-11-08-comfy-ui.mdx +1 -1
- package/docs/changelog/2025-11-08-comfy-ui.zh-CN.mdx +1 -1
- package/docs/changelog/2025-12-20-mcp.mdx +1 -1
- package/docs/changelog/2025-12-20-mcp.zh-CN.mdx +1 -1
- package/docs/development/basic/add-new-authentication-providers.zh-CN.mdx +1 -1
- package/docs/development/basic/add-new-image-model.mdx +3 -3
- package/docs/development/basic/add-new-image-model.zh-CN.mdx +3 -3
- package/docs/development/basic/chat-api.mdx +10 -10
- package/docs/development/basic/chat-api.zh-CN.mdx +10 -10
- package/docs/development/basic/feature-development.mdx +4 -4
- package/docs/development/basic/feature-development.zh-CN.mdx +4 -4
- package/docs/development/basic/setup-development.mdx +4 -4
- package/docs/development/basic/setup-development.zh-CN.mdx +4 -4
- package/docs/development/internationalization/add-new-locale.mdx +1 -1
- package/docs/development/internationalization/add-new-locale.zh-CN.mdx +1 -1
- package/docs/development/internationalization/internationalization-implementation.mdx +5 -5
- package/docs/development/internationalization/internationalization-implementation.zh-CN.mdx +5 -5
- package/docs/development/others/lighthouse.mdx +8 -8
- package/docs/development/others/lighthouse.zh-CN.mdx +8 -8
- package/docs/development/start.mdx +3 -3
- package/docs/development/start.zh-CN.mdx +3 -3
- package/docs/self-hosting/advanced/feature-flags.mdx +1 -1
- package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/knowledge-base.mdx +2 -2
- package/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx +2 -2
- package/docs/self-hosting/advanced/online-search.mdx +1 -1
- package/docs/self-hosting/advanced/online-search.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/redis/upstash.mdx +3 -3
- package/docs/self-hosting/advanced/redis/upstash.zh-CN.mdx +3 -3
- package/docs/self-hosting/advanced/redis.mdx +6 -6
- package/docs/self-hosting/advanced/redis.zh-CN.mdx +6 -6
- package/docs/self-hosting/advanced/s3/rustfs.mdx +116 -116
- package/docs/self-hosting/advanced/s3/rustfs.zh-CN.mdx +116 -117
- package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +5 -5
- package/docs/self-hosting/auth/email.mdx +70 -0
- package/docs/self-hosting/auth/email.zh-CN.mdx +70 -0
- package/docs/self-hosting/{advanced/auth → auth}/legacy.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/legacy.zh-CN.mdx +5 -5
- package/docs/self-hosting/{advanced/auth → auth}/next-auth/casdoor.zh-CN.mdx +3 -3
- package/docs/self-hosting/{advanced/auth → auth}/next-auth/keycloak.zh-CN.mdx +2 -2
- package/docs/self-hosting/{advanced/auth → auth}/next-auth/logto.zh-CN.mdx +2 -2
- package/docs/self-hosting/{advanced/auth → auth}/providers/apple.mdx +6 -6
- package/docs/self-hosting/{advanced/auth → auth}/providers/apple.zh-CN.mdx +6 -6
- package/docs/self-hosting/{advanced/auth → auth}/providers/auth0.mdx +12 -12
- package/docs/self-hosting/{advanced/auth → auth}/providers/auth0.zh-CN.mdx +12 -12
- package/docs/self-hosting/{advanced/auth → auth}/providers/authelia.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/authelia.zh-CN.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/authentik.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/authentik.zh-CN.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/casdoor.mdx +8 -8
- package/docs/self-hosting/{advanced/auth → auth}/providers/casdoor.zh-CN.mdx +7 -7
- package/docs/self-hosting/{advanced/auth → auth}/providers/cloudflare-zero-trust.mdx +7 -7
- package/docs/self-hosting/{advanced/auth → auth}/providers/cloudflare-zero-trust.zh-CN.mdx +6 -6
- package/docs/self-hosting/{advanced/auth → auth}/providers/cognito.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/cognito.zh-CN.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/feishu.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/feishu.zh-CN.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/generic-oidc.mdx +12 -12
- package/docs/self-hosting/{advanced/auth → auth}/providers/generic-oidc.zh-CN.mdx +12 -12
- package/docs/self-hosting/{advanced/auth → auth}/providers/github.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/github.zh-CN.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/google.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/google.zh-CN.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/keycloak.mdx +11 -11
- package/docs/self-hosting/{advanced/auth → auth}/providers/keycloak.zh-CN.mdx +11 -11
- package/docs/self-hosting/{advanced/auth → auth}/providers/logto.mdx +8 -8
- package/docs/self-hosting/{advanced/auth → auth}/providers/logto.zh-CN.mdx +7 -7
- package/docs/self-hosting/{advanced/auth → auth}/providers/microsoft.mdx +11 -11
- package/docs/self-hosting/{advanced/auth → auth}/providers/microsoft.zh-CN.mdx +11 -11
- package/docs/self-hosting/{advanced/auth → auth}/providers/okta.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/okta.zh-CN.mdx +13 -13
- package/docs/self-hosting/auth/providers/password.mdx +112 -0
- package/docs/self-hosting/auth/providers/password.zh-CN.mdx +103 -0
- package/docs/self-hosting/{advanced/auth → auth}/providers/wechat.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/wechat.zh-CN.mdx +10 -10
- package/docs/self-hosting/{advanced/auth → auth}/providers/zitadel.mdx +13 -13
- package/docs/self-hosting/{advanced/auth → auth}/providers/zitadel.zh-CN.mdx +13 -13
- package/docs/self-hosting/{advanced/auth.mdx → auth.mdx} +24 -81
- package/docs/self-hosting/{advanced/auth.zh-CN.mdx → auth.zh-CN.mdx} +23 -80
- package/docs/self-hosting/environment-variables/auth.mdx +7 -0
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +7 -0
- package/docs/self-hosting/environment-variables/basic.mdx +0 -7
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +0 -7
- package/docs/self-hosting/environment-variables/redis.mdx +1 -1
- package/docs/self-hosting/environment-variables/redis.zh-CN.mdx +1 -1
- package/docs/self-hosting/environment-variables.mdx +1 -1
- package/docs/self-hosting/examples/azure-openai.mdx +0 -1
- package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +0 -1
- package/docs/self-hosting/faq/no-v1-suffix.mdx +3 -3
- package/docs/self-hosting/faq/no-v1-suffix.zh-CN.mdx +3 -3
- package/docs/self-hosting/{advanced → migration/v2}/auth/clerk-to-betterauth.mdx +7 -7
- package/docs/self-hosting/{advanced → migration/v2}/auth/clerk-to-betterauth.zh-CN.mdx +7 -7
- package/docs/self-hosting/{advanced → migration/v2}/auth/migration-internals.mdx +2 -2
- package/docs/self-hosting/{advanced → migration/v2}/auth/migration-internals.zh-CN.mdx +2 -2
- package/docs/self-hosting/{advanced → migration/v2}/auth/nextauth-to-betterauth.mdx +11 -11
- package/docs/self-hosting/{advanced → migration/v2}/auth/nextauth-to-betterauth.zh-CN.mdx +11 -11
- package/docs/self-hosting/migration/v2/breaking-changes.mdx +1 -1
- package/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdx +1 -1
- package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +4 -4
- package/docs/self-hosting/platform/docker.mdx +5 -5
- package/docs/self-hosting/platform/docker.zh-CN.mdx +10 -10
- package/docs/self-hosting/platform/dokploy.mdx +1 -1
- package/docs/self-hosting/platform/dokploy.zh-CN.mdx +5 -5
- package/docs/self-hosting/platform/sealos.mdx +12 -12
- package/docs/self-hosting/platform/sealos.zh-CN.mdx +17 -17
- package/docs/self-hosting/platform/vercel.zh-CN.mdx +4 -4
- package/docs/self-hosting/start.mdx +3 -3
- package/docs/self-hosting/start.zh-CN.mdx +4 -4
- package/locales/en-US/auth.json +2 -1
- package/locales/en-US/authError.json +1 -0
- package/locales/en-US/metadata.json +1 -1
- package/locales/zh-CN/auth.json +1 -0
- package/locales/zh-CN/authError.json +1 -0
- package/netlify.toml +0 -1
- package/package.json +1 -1
- package/packages/types/src/serverConfig.ts +1 -0
- package/src/app/[variants]/(auth)/auth-error/page.tsx +4 -2
- package/src/app/[variants]/(auth)/signin/SignInEmailStep.tsx +57 -50
- package/src/app/[variants]/(auth)/signin/SignInPasswordStep.tsx +1 -1
- package/src/app/[variants]/(auth)/signin/page.tsx +2 -0
- package/src/app/[variants]/(auth)/signin/useSignIn.ts +2 -0
- package/src/app/[variants]/(auth)/signup/[[...signup]]/page.tsx +7 -0
- package/src/envs/app.ts +0 -2
- package/src/envs/auth.ts +3 -0
- package/src/libs/better-auth/define-config.ts +1 -1
- package/src/libs/better-auth/sso/providers/feishu.ts +15 -14
- package/src/libs/better-auth/sso/providers/wechat.ts +6 -3
- package/src/libs/next/proxy/define-config.ts +1 -1
- package/src/locales/default/auth.ts +3 -1
- package/src/locales/default/authError.ts +2 -0
- package/src/locales/default/metadata.ts +1 -1
- package/src/server/globalConfig/index.ts +1 -0
- package/src/server/ld.ts +1 -1
- package/src/store/chat/slices/topic/action.ts +1 -1
- package/src/store/electron/actions/settings.ts +7 -7
- package/src/store/electron/actions/sync.ts +11 -11
- package/src/store/global/actions/general.ts +12 -12
- package/src/store/global/initialState.ts +11 -11
- package/src/store/global/selectors/clientDB.ts +1 -1
- package/src/store/global/selectors/systemStatus.ts +1 -1
- package/src/store/image/slices/generationConfig/action.ts +12 -12
- package/src/store/image/utils/size.ts +11 -11
- package/src/store/library/slices/ragEval/actions/dataset.ts +1 -1
- package/src/store/serverConfig/selectors.ts +1 -0
- package/src/store/session/slices/session/initialState.ts +6 -6
- package/src/store/session/slices/session/reducers.ts +1 -1
- package/src/store/session/slices/sessionGroup/initialState.ts +2 -2
- package/src/store/tool/slices/customPlugin/action.ts +2 -2
- package/src/store/tool/slices/oldStore/action.ts +5 -5
- package/src/store/userMemory/slices/preference/action.ts +6 -6
- /package/docs/self-hosting/{advanced/auth → auth}/clerk.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/clerk.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/auth0.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/auth0.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authelia.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authelia.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authentik.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/authentik.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/casdoor.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/cloudflare-zero-trust.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/cloudflare-zero-trust.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/github.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/github.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/google.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/google.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/keycloak.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/logto.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/microsoft-entra-id.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/microsoft-entra-id.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/okta.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/okta.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/wechat.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/wechat.zh-CN.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/zitadel.mdx +0 -0
- /package/docs/self-hosting/{advanced/auth → auth}/next-auth/zitadel.zh-CN.mdx +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: LobeHub API Client-Server Interaction Logic
|
|
3
3
|
description: >-
|
|
4
|
-
Explore the client-server interaction logic of
|
|
4
|
+
Explore the client-server interaction logic of LobeHub API, including event
|
|
5
5
|
sequences.
|
|
6
6
|
tags:
|
|
7
|
-
-
|
|
7
|
+
- LobeHub API
|
|
8
8
|
- Client-Server Interaction
|
|
9
9
|
- Event Sequences
|
|
10
10
|
- API Logic
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
#
|
|
13
|
+
# LobeHub API Client-Server Interaction Logic
|
|
14
14
|
|
|
15
|
-
This document explains the implementation logic of
|
|
15
|
+
This document explains the implementation logic of LobeHub API in client-server interactions, including event sequences and core components involved.
|
|
16
16
|
|
|
17
17
|
## Interaction Sequence Diagram
|
|
18
18
|
|
|
@@ -201,7 +201,7 @@ sequenceDiagram
|
|
|
201
201
|
|
|
202
202
|
## AgentRuntime Overview
|
|
203
203
|
|
|
204
|
-
AgentRuntime is a core abstraction layer in
|
|
204
|
+
AgentRuntime is a core abstraction layer in LobeHub that encapsulates a unified interface for interacting with different AI model providers. Its main responsibilities and features include:
|
|
205
205
|
|
|
206
206
|
1. **Unified Abstraction Layer**: AgentRuntime provides a unified interface that hides the implementation details and differences between various AI provider APIs (such as OpenAI, Anthropic, Bedrock, etc.).
|
|
207
207
|
|
|
@@ -244,7 +244,7 @@ AgentRuntime is a core abstraction layer in Lobe Chat that encapsulates a unifie
|
|
|
244
244
|
|
|
245
245
|
**Adapter Implementation Examples**:
|
|
246
246
|
|
|
247
|
-
1. **OpenRouter Adapter**: OpenRouter is a unified API that allows access to AI models from multiple providers.
|
|
247
|
+
1. **OpenRouter Adapter**: OpenRouter is a unified API that allows access to AI models from multiple providers. LobeHub implements support for OpenRouter through an adapter:
|
|
248
248
|
|
|
249
249
|
```ts
|
|
250
250
|
// OpenRouter adapter implementation
|
|
@@ -258,7 +258,7 @@ AgentRuntime is a core abstraction layer in Lobe Chat that encapsulates a unifie
|
|
|
258
258
|
apiKey: options.apiKey,
|
|
259
259
|
baseURL: OPENROUTER_BASE_URL,
|
|
260
260
|
defaultHeaders: {
|
|
261
|
-
'HTTP-Referer': 'https://github.com/lobehub/
|
|
261
|
+
'HTTP-Referer': 'https://github.com/lobehub/lobehub',
|
|
262
262
|
'X-Title': 'LobeHub',
|
|
263
263
|
},
|
|
264
264
|
});
|
|
@@ -267,7 +267,7 @@ AgentRuntime is a core abstraction layer in Lobe Chat that encapsulates a unifie
|
|
|
267
267
|
|
|
268
268
|
// Implement chat functionality
|
|
269
269
|
async chat(payload: ChatCompletionCreateParamsBase, options?: RequestOptions) {
|
|
270
|
-
// Convert
|
|
270
|
+
// Convert LobeHub request format to OpenRouter format
|
|
271
271
|
// Handle model mapping, message format, etc.
|
|
272
272
|
return this.client.chat.completions.create(
|
|
273
273
|
{
|
|
@@ -282,7 +282,7 @@ AgentRuntime is a core abstraction layer in Lobe Chat that encapsulates a unifie
|
|
|
282
282
|
}
|
|
283
283
|
```
|
|
284
284
|
|
|
285
|
-
2. **Google Gemini Adapter**: Gemini is Google's large language model.
|
|
285
|
+
2. **Google Gemini Adapter**: Gemini is Google's large language model. LobeHub supports Gemini series models through a dedicated adapter:
|
|
286
286
|
|
|
287
287
|
```ts
|
|
288
288
|
import { GoogleGenerativeAI } from '@google/generative-ai';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description: 深入了解
|
|
2
|
+
title: LobeHub API 前后端交互逻辑
|
|
3
|
+
description: 深入了解 LobeHub API 的前后端交互实现逻辑和核心组件。
|
|
4
4
|
tags:
|
|
5
|
-
-
|
|
5
|
+
- LobeHub API
|
|
6
6
|
- 前后端交互
|
|
7
7
|
- 事件序列
|
|
8
8
|
- 核心组件
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
# LobeHub API 前后端交互逻辑
|
|
12
12
|
|
|
13
|
-
本文档说明了
|
|
13
|
+
本文档说明了 LobeHub API 在前后端交互中的实现逻辑,包括事件序列和涉及的核心组件。
|
|
14
14
|
|
|
15
15
|
## 交互时序图
|
|
16
16
|
|
|
@@ -199,7 +199,7 @@ sequenceDiagram
|
|
|
199
199
|
|
|
200
200
|
## AgentRuntime 说明
|
|
201
201
|
|
|
202
|
-
AgentRuntime 是
|
|
202
|
+
AgentRuntime 是 LobeHub 中的一个核心抽象层,它封装了与不同 AI 模型提供商交互的统一接口。其主要职责和特点包括:
|
|
203
203
|
|
|
204
204
|
1. **统一抽象层**:AgentRuntime 提供了一个统一的接口,隐藏了不同 AI 提供商 API 的实现细节差异(如 OpenAI、Anthropic、Bedrock 等)。
|
|
205
205
|
|
|
@@ -242,7 +242,7 @@ AgentRuntime 是 Lobe Chat 中的一个核心抽象层,它封装了与不同 A
|
|
|
242
242
|
|
|
243
243
|
**适配器实现示例**:
|
|
244
244
|
|
|
245
|
-
1. **OpenRouter 适配器**:OpenRouter 是一个统一 API,可以通过它访问多个模型提供商的 AI 模型。
|
|
245
|
+
1. **OpenRouter 适配器**:OpenRouter 是一个统一 API,可以通过它访问多个模型提供商的 AI 模型。LobeHub 通过适配器实现对 OpenRouter 的支持:
|
|
246
246
|
|
|
247
247
|
```ts
|
|
248
248
|
// OpenRouter 适配器实现
|
|
@@ -256,7 +256,7 @@ AgentRuntime 是 Lobe Chat 中的一个核心抽象层,它封装了与不同 A
|
|
|
256
256
|
apiKey: options.apiKey,
|
|
257
257
|
baseURL: OPENROUTER_BASE_URL,
|
|
258
258
|
defaultHeaders: {
|
|
259
|
-
'HTTP-Referer': 'https://github.com/lobehub/
|
|
259
|
+
'HTTP-Referer': 'https://github.com/lobehub/lobehub',
|
|
260
260
|
'X-Title': 'LobeHub',
|
|
261
261
|
},
|
|
262
262
|
});
|
|
@@ -265,7 +265,7 @@ AgentRuntime 是 Lobe Chat 中的一个核心抽象层,它封装了与不同 A
|
|
|
265
265
|
|
|
266
266
|
// 实现聊天功能
|
|
267
267
|
async chat(payload: ChatCompletionCreateParamsBase, options?: RequestOptions) {
|
|
268
|
-
// 将
|
|
268
|
+
// 将 LobeHub 的请求格式转换为 OpenRouter 格式
|
|
269
269
|
// 处理模型映射、消息格式等
|
|
270
270
|
return this.client.chat.completions.create(
|
|
271
271
|
{
|
|
@@ -280,7 +280,7 @@ AgentRuntime 是 Lobe Chat 中的一个核心抽象层,它封装了与不同 A
|
|
|
280
280
|
}
|
|
281
281
|
```
|
|
282
282
|
|
|
283
|
-
2. **Google Gemini 适配器**:Gemini 是 Google 的大语言模型,
|
|
283
|
+
2. **Google Gemini 适配器**:Gemini 是 Google 的大语言模型,LobeHub 通过专门的适配器支持 Gemini 系列模型:
|
|
284
284
|
|
|
285
285
|
```ts
|
|
286
286
|
import { GoogleGenerativeAI } from '@google/generative-ai';
|
|
@@ -13,11 +13,11 @@ tags:
|
|
|
13
13
|
|
|
14
14
|
This document aims to guide developers on how to develop a complete feature in LobeHub.
|
|
15
15
|
|
|
16
|
-
We will use [RFC 021 - Custom Assistant Opening Guidance](https://github.com/lobehub/
|
|
16
|
+
We will use [RFC 021 - Custom Assistant Opening Guidance](https://github.com/lobehub/lobehub/discussions/891) as an example to illustrate the complete implementation process.
|
|
17
17
|
|
|
18
18
|
## 1. Update Schema
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
lobehub uses a postgres database, with the browser-side local database using [pglite](https://pglite.dev/) (wasm version of postgres). The project also uses [drizzle](https://orm.drizzle.team/) ORM to operate the database.
|
|
21
21
|
|
|
22
22
|
Compared to the old solution where the browser side used indexDB, having both the browser side and server side use postgres has the advantage that the model layer code can be completely reused.
|
|
23
23
|
|
|
@@ -160,7 +160,7 @@ Foreseeably, the frontend will add two inputs, calling updateSessionConfig upon
|
|
|
160
160
|
|
|
161
161
|
### Data Flow Store Implementation
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
lobehub uses [zustand](https://zustand.docs.pmnd.rs/getting-started/introduction) as the global state management framework. For detailed practices on state management, you can refer to [📘 State Management Best Practices](/docs/development/state-management/state-management-intro).
|
|
164
164
|
|
|
165
165
|
There are two stores related to the agent:
|
|
166
166
|
|
|
@@ -254,7 +254,7 @@ We're adding a new category of settings this time. In `src/features/AgentSetting
|
|
|
254
254
|
- [@ant-design/icons](https://ant.design/components/icon-cn) and [lucide](https://lucide.dev/icons/): icon libraries
|
|
255
255
|
- [react-i18next](https://github.com/i18next/react-i18next) and [lobe-i18n](https://github.com/lobehub/lobe-cli-toolbox/tree/master/packages/lobe-i18n): i18n framework and multi-language automatic translation tool
|
|
256
256
|
|
|
257
|
-
|
|
257
|
+
lobehub is an internationalized project, so newly added text needs to update the default `locale` file: `src/locales/default/setting.ts`.
|
|
258
258
|
|
|
259
259
|
Let's take the subcomponent `OpeningQuestion.tsx` as an example. Component implementation:
|
|
260
260
|
|
|
@@ -12,11 +12,11 @@ tags:
|
|
|
12
12
|
|
|
13
13
|
本文档旨在指导开发者了解如何在 LobeHub 中开发一块完整的功能需求。
|
|
14
14
|
|
|
15
|
-
我们将以 [RFC 021 - 自定义助手开场引导](https://github.com/lobehub/
|
|
15
|
+
我们将以 [RFC 021 - 自定义助手开场引导](https://github.com/lobehub/lobehub/discussions/891) 为例,阐述完整的实现流程。
|
|
16
16
|
|
|
17
17
|
## 一、更新 schema
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
lobehub 使用 postgres 数据库,浏览器端本地数据库使用 [pglite](https://pglite.dev/)(wasm 版本 postgres)。项目还使用了 [drizzle](https://orm.drizzle.team/) ORM 用来操作数据库。
|
|
20
20
|
|
|
21
21
|
相比旧方案浏览器端使用 indexDB 来说,浏览器端和 server 端都使用 postgres 好处在于 model 层代码可以完全复用。
|
|
22
22
|
|
|
@@ -159,7 +159,7 @@ export const sessionRouter = router({
|
|
|
159
159
|
|
|
160
160
|
### 数据流 store 实现
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
lobehub 使用 [zustand](https://zustand.docs.pmnd.rs/getting-started/introduction) 作为全局状态管理框架,对于状态管理的详细实践介绍,可以查阅 [📘 状态管理最佳实践](/zh/docs/development/state-management/state-management-intro)。
|
|
163
163
|
|
|
164
164
|
和 agent 相关的 store 有两个:
|
|
165
165
|
|
|
@@ -253,7 +253,7 @@ export const agentSelectors = {
|
|
|
253
253
|
- [@ant-design/icons](https://ant.design/components/icon-cn) 和 [lucide](https://lucide.dev/icons/): 图标库
|
|
254
254
|
- [react-i18next](https://github.com/i18next/react-i18next) 和 [lobe-i18n](https://github.com/lobehub/lobe-cli-toolbox/tree/master/packages/lobe-i18n) :i18n 框架和多语言自动翻译工具
|
|
255
255
|
|
|
256
|
-
|
|
256
|
+
lobehub 是个国际化项目,新加的文案需要更新默认的 `locale` 文件: `src/locales/default/setting.ts` 。
|
|
257
257
|
|
|
258
258
|
我们以子组件 `OpeningQuestion.tsx` 为例,组件实现:
|
|
259
259
|
|
|
@@ -39,7 +39,7 @@ First, you need to install the following software:
|
|
|
39
39
|
|
|
40
40
|
### VSCode Users
|
|
41
41
|
|
|
42
|
-
We recommend installing the extensions listed in [.vscode/extensions.json](https://github.com/lobehub/
|
|
42
|
+
We recommend installing the extensions listed in [.vscode/extensions.json](https://github.com/lobehub/lobehub/blob/main/.vscode/extensions.json) for the best development experience.
|
|
43
43
|
|
|
44
44
|
### Project Setup
|
|
45
45
|
|
|
@@ -48,13 +48,13 @@ After installing the above software, you can start setting up the LobeHub projec
|
|
|
48
48
|
1. **Get the code**: First, you need to clone the LobeHub codebase from GitHub. Run the following command in the terminal:
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
git clone https://github.com/lobehub/
|
|
51
|
+
git clone https://github.com/lobehub/lobehub.git
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
2. **Install dependencies**: Then, navigate to the project directory and use PNPM to install the project's dependencies:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
cd
|
|
57
|
+
cd lobehub
|
|
58
58
|
pnpm i
|
|
59
59
|
```
|
|
60
60
|
|
|
@@ -82,5 +82,5 @@ Please refer to the [Work with Server-Side Database](/docs/development/basic/wor
|
|
|
82
82
|
|
|
83
83
|
During the development process, if you encounter any issues with environment setup or have any questions about LobeHub development, feel free to ask us at any time. We look forward to seeing your contributions!
|
|
84
84
|
|
|
85
|
-
[codespaces-link]: https://codespaces.new/lobehub/
|
|
85
|
+
[codespaces-link]: https://codespaces.new/lobehub/lobehub
|
|
86
86
|
[codespaces-shield]: https://github.com/codespaces/badge.svg
|
|
@@ -35,7 +35,7 @@ tags:
|
|
|
35
35
|
|
|
36
36
|
### VSCode 用户
|
|
37
37
|
|
|
38
|
-
推荐安装 [.vscode/extensions.json](https://github.com/lobehub/
|
|
38
|
+
推荐安装 [.vscode/extensions.json](https://github.com/lobehub/lobehub/blob/main/.vscode/extensions.json) 中推荐安装的扩展获得最佳开发体验。
|
|
39
39
|
|
|
40
40
|
### 项目设置
|
|
41
41
|
|
|
@@ -44,13 +44,13 @@ tags:
|
|
|
44
44
|
1. **获取代码**:首先,你需要从 GitHub 上克隆 LobeHub 的代码库。在终端中运行以下命令:
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
git clone https://github.com/lobehub/
|
|
47
|
+
git clone https://github.com/lobehub/lobehub.git
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
2. **安装依赖**:然后,进入项目目录,并使用 `pnpm` 安装项目的依赖包:
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
cd
|
|
53
|
+
cd lobehub
|
|
54
54
|
pnpm i
|
|
55
55
|
```
|
|
56
56
|
|
|
@@ -78,5 +78,5 @@ bun run dev
|
|
|
78
78
|
|
|
79
79
|
在开发过程中,如果你在环境设置上遇到任何问题,或者有任何关于 LobeHub 开发的问题,欢迎随时向我们提问。我们期待看到你的贡献!
|
|
80
80
|
|
|
81
|
-
[codespaces-link]: https://codespaces.new/lobehub/
|
|
81
|
+
[codespaces-link]: https://codespaces.new/lobehub/lobehub
|
|
82
82
|
[codespaces-shield]: https://github.com/codespaces/badge.svg
|
|
@@ -54,7 +54,7 @@ This will utilize the `lobe-i18n` tool to process the language files.
|
|
|
54
54
|
|
|
55
55
|
Once you have completed the above steps, you need to submit your changes and create a Pull Request.
|
|
56
56
|
|
|
57
|
-
Ensure that you follow LobeHub's contribution guidelines and provide a necessary description to explain your changes. For example, refer to a similar previous Pull Request [#759](https://github.com/lobehub/
|
|
57
|
+
Ensure that you follow LobeHub's contribution guidelines and provide a necessary description to explain your changes. For example, refer to a similar previous Pull Request [#759](https://github.com/lobehub/lobehub/pull/759).
|
|
58
58
|
|
|
59
59
|
### Additional Information
|
|
60
60
|
|
|
@@ -54,7 +54,7 @@ npm run i18n
|
|
|
54
54
|
|
|
55
55
|
一旦你完成了上述步骤,你需要提交你的更改并创建一个 Pull Request。
|
|
56
56
|
|
|
57
|
-
请确保你遵循了 LobeHub 的贡献指南,并提供必要的描述来说明你的更改。例如,参考之前的类似 Pull Request [#759](https://github.com/lobehub/
|
|
57
|
+
请确保你遵循了 LobeHub 的贡献指南,并提供必要的描述来说明你的更改。例如,参考之前的类似 Pull Request [#759](https://github.com/lobehub/lobehub/pull/759)。
|
|
58
58
|
|
|
59
59
|
### 附加信息
|
|
60
60
|
|
|
@@ -114,11 +114,11 @@ In this example, we demonstrate how to use `i18next` and related plugins to init
|
|
|
114
114
|
|
|
115
115
|
We have already supported a variety of languages globally through the following efforts:
|
|
116
116
|
|
|
117
|
-
- [✨ feat: adding Arabic Language Support #1049](https://github.com/lobehub/
|
|
118
|
-
- [🌐 style: Add Vietnamese files and add the vi-VN option in the General Settings #860](https://github.com/lobehub/
|
|
119
|
-
- [🌐 style: support it-IT nl-NL and pl-PL locales #759](https://github.com/lobehub/
|
|
120
|
-
- [🌐 feat(locale): Add fr-FR (#637) #645](https://github.com/lobehub/
|
|
121
|
-
- [🌐 Add russian localy #137](https://github.com/lobehub/
|
|
117
|
+
- [✨ feat: adding Arabic Language Support #1049](https://github.com/lobehub/lobehub/pull/1049)
|
|
118
|
+
- [🌐 style: Add Vietnamese files and add the vi-VN option in the General Settings #860](https://github.com/lobehub/lobehub/pull/860)
|
|
119
|
+
- [🌐 style: support it-IT nl-NL and pl-PL locales #759](https://github.com/lobehub/lobehub/pull/759)
|
|
120
|
+
- [🌐 feat(locale): Add fr-FR (#637) #645](https://github.com/lobehub/lobehub/pull/645)
|
|
121
|
+
- [🌐 Add russian localy #137](https://github.com/lobehub/lobehub/pull/137)
|
|
122
122
|
|
|
123
123
|
To add support for new languages, please refer to the detailed steps in the [New Locale Addition Guide](add-new-locale).
|
|
124
124
|
|
|
@@ -111,11 +111,11 @@ const createI18nInstance = (lang) => {
|
|
|
111
111
|
|
|
112
112
|
我们通过以下工作,已经支持了全球多种语言:
|
|
113
113
|
|
|
114
|
-
- [✨ feat: adding Arabic Language Support #1049](https://github.com/lobehub/
|
|
115
|
-
- [🌐 style: Add Vietnamese files and add the vi-VN option in the General Settings #860](https://github.com/lobehub/
|
|
116
|
-
- [🌐 style: support it-IT nl-NL and pl-PL locales #759](https://github.com/lobehub/
|
|
117
|
-
- [🌐 feat(locale): Add fr-FR (#637) #645](https://github.com/lobehub/
|
|
118
|
-
- [🌐 Add russian localy #137](https://github.com/lobehub/
|
|
114
|
+
- [✨ feat: adding Arabic Language Support #1049](https://github.com/lobehub/lobehub/pull/1049)
|
|
115
|
+
- [🌐 style: Add Vietnamese files and add the vi-VN option in the General Settings #860](https://github.com/lobehub/lobehub/pull/860)
|
|
116
|
+
- [🌐 style: support it-IT nl-NL and pl-PL locales #759](https://github.com/lobehub/lobehub/pull/759)
|
|
117
|
+
- [🌐 feat(locale): Add fr-FR (#637) #645](https://github.com/lobehub/lobehub/pull/645)
|
|
118
|
+
- [🌐 Add russian localy #137](https://github.com/lobehub/lobehub/pull/137)
|
|
119
119
|
|
|
120
120
|
要添加新的语种支持, 详细步骤请参考:[新语种添加指南](/zh/docs/development/internationalization/add-new-locale)。
|
|
121
121
|
|
|
@@ -29,11 +29,11 @@ tags:
|
|
|
29
29
|
| ![][discover-desktop] | ![][discover-mobile] |
|
|
30
30
|
| [⚡️ Lighthouse Report][discover-desktop-report] | [⚡️ Lighthouse Report][discover-mobile-report] |
|
|
31
31
|
|
|
32
|
-
[chat-desktop]: https://raw.githubusercontent.com/lobehub/
|
|
33
|
-
[chat-desktop-report]: https://lobehub.github.io/
|
|
34
|
-
[chat-mobile]: https://raw.githubusercontent.com/lobehub/
|
|
35
|
-
[chat-mobile-report]: https://lobehub.github.io/
|
|
36
|
-
[discover-desktop]: https://raw.githubusercontent.com/lobehub/
|
|
37
|
-
[discover-desktop-report]: https://lobehub.github.io/
|
|
38
|
-
[discover-mobile]: https://raw.githubusercontent.com/lobehub/
|
|
39
|
-
[discover-mobile-report]: https://lobehub.github.io/
|
|
32
|
+
[chat-desktop]: https://raw.githubusercontent.com/lobehub/lobehub/lighthouse/lighthouse/chat/desktop/pagespeed.svg
|
|
33
|
+
[chat-desktop-report]: https://lobehub.github.io/lobehub/lighthouse/chat/desktop/LobeHub_com_chat.html
|
|
34
|
+
[chat-mobile]: https://raw.githubusercontent.com/lobehub/lobehub/lighthouse/lighthouse/chat/mobile/pagespeed.svg
|
|
35
|
+
[chat-mobile-report]: https://lobehub.github.io/lobehub/lighthouse/chat/mobile/LobeHub_com_chat.html
|
|
36
|
+
[discover-desktop]: https://raw.githubusercontent.com/lobehub/lobehub/lighthouse/lighthouse/discover/desktop/pagespeed.svg
|
|
37
|
+
[discover-desktop-report]: https://lobehub.github.io/lobehub/lighthouse/discover/desktop/LobeHub_com_discover.html
|
|
38
|
+
[discover-mobile]: https://raw.githubusercontent.com/lobehub/lobehub/lighthouse/lighthouse/discover/mobile/pagespeed.svg
|
|
39
|
+
[discover-mobile-report]: https://lobehub.github.io/lobehub/lighthouse/discover/mobile/LobeHub_com_discover.html
|
|
@@ -30,11 +30,11 @@ tags:
|
|
|
30
30
|
| ![][discover-desktop] | ![][discover-mobile] |
|
|
31
31
|
| [⚡️ Lighthouse Report][discover-desktop-report] | [⚡️ Lighthouse Report][discover-mobile-report] |
|
|
32
32
|
|
|
33
|
-
[chat-desktop]: https://raw.githubusercontent.com/lobehub/
|
|
34
|
-
[chat-desktop-report]: https://lobehub.github.io/
|
|
35
|
-
[chat-mobile]: https://raw.githubusercontent.com/lobehub/
|
|
36
|
-
[chat-mobile-report]: https://lobehub.github.io/
|
|
37
|
-
[discover-desktop]: https://raw.githubusercontent.com/lobehub/
|
|
38
|
-
[discover-desktop-report]: https://lobehub.github.io/
|
|
39
|
-
[discover-mobile]: https://raw.githubusercontent.com/lobehub/
|
|
40
|
-
[discover-mobile-report]: https://lobehub.github.io/
|
|
33
|
+
[chat-desktop]: https://raw.githubusercontent.com/lobehub/lobehub/lighthouse/lighthouse/chat/desktop/pagespeed.svg
|
|
34
|
+
[chat-desktop-report]: https://lobehub.github.io/lobehub/lighthouse/chat/desktop/LobeHub_com_chat.html
|
|
35
|
+
[chat-mobile]: https://raw.githubusercontent.com/lobehub/lobehub/lighthouse/lighthouse/chat/mobile/pagespeed.svg
|
|
36
|
+
[chat-mobile-report]: https://lobehub.github.io/lobehub/lighthouse/chat/mobile/LobeHub_com_chat.html
|
|
37
|
+
[discover-desktop]: https://raw.githubusercontent.com/lobehub/lobehub/lighthouse/lighthouse/discover/desktop/pagespeed.svg
|
|
38
|
+
[discover-desktop-report]: https://lobehub.github.io/lobehub/lighthouse/discover/desktop/LobeHub_com_discover.html
|
|
39
|
+
[discover-mobile]: https://raw.githubusercontent.com/lobehub/lobehub/lighthouse/lighthouse/discover/mobile/pagespeed.svg
|
|
40
|
+
[discover-mobile-report]: https://lobehub.github.io/lobehub/lighthouse/discover/mobile/LobeHub_com_discover.html
|
|
@@ -59,13 +59,13 @@ We recommend using WebStorm as your integrated development environment (IDE).
|
|
|
59
59
|
1. **Get the code**: Clone the LobeHub code repository locally:
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
|
-
git clone https://github.com/lobehub/
|
|
62
|
+
git clone https://github.com/lobehub/lobehub.git
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
2. **Install dependencies**: Enter the project directory and install the required dependencies:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
cd
|
|
68
|
+
cd lobehub
|
|
69
69
|
# If you use Bun
|
|
70
70
|
bun install
|
|
71
71
|
# If you use PNPM
|
|
@@ -110,6 +110,6 @@ For a detailed guide on internationalization implementation, please refer to [In
|
|
|
110
110
|
|
|
111
111
|
To support developers in better understanding and using the technology stack of LobeHub, we provide a comprehensive list of resources and references — [LobeHub Resources and References](/docs/development/basic/resources) - Visit our maintained list of resources, including tutorials, articles, and other useful links.
|
|
112
112
|
|
|
113
|
-
We encourage developers to utilize these resources to deepen their learning and enhance their skills, join community discussions through [LobeHub GitHub Discussions](https://github.com/lobehub/
|
|
113
|
+
We encourage developers to utilize these resources to deepen their learning and enhance their skills, join community discussions through [LobeHub GitHub Discussions](https://github.com/lobehub/lobehub/discussions) or [Discord](https://discord.com/invite/AYFPHvv2jT), ask questions, or share your experiences.
|
|
114
114
|
|
|
115
115
|
If you have any questions or need further assistance, please do not hesitate to contact us through the above channels.
|
|
@@ -57,13 +57,13 @@ src
|
|
|
57
57
|
1. **获取代码**:克隆 LobeHub 的代码库到本地:
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
git clone https://github.com/lobehub/
|
|
60
|
+
git clone https://github.com/lobehub/lobehub.git
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
2. **安装依赖**:进入项目目录,并安装所需依赖:
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
cd
|
|
66
|
+
cd lobehub
|
|
67
67
|
# 如果你使用 Bun
|
|
68
68
|
bun install
|
|
69
69
|
# 如果你使用 PNPM
|
|
@@ -108,6 +108,6 @@ LobeHub 采用 `i18next` 和 `lobe-i18n` 实现多语言支持,确保用户全
|
|
|
108
108
|
|
|
109
109
|
为了支持开发者更好地理解和使用 LobeHub 的技术栈,我们提供了一份详尽的资源与参考列表 —— [LobeHub 资源与参考](/zh/docs/development/basic/resources) - 访问我们维护的资源列表,包括教程、文章和其他有用的链接。
|
|
110
110
|
|
|
111
|
-
我们鼓励开发者利用这些资源深入学习和提升技能,通过 [LobeHub GitHub Discussions](https://github.com/lobehub/
|
|
111
|
+
我们鼓励开发者利用这些资源深入学习和提升技能,通过 [LobeHub GitHub Discussions](https://github.com/lobehub/lobehub/discussions) 或者 [Discord](https://discord.com/invite/AYFPHvv2jT) 加入社区讨论,提出问题或分享你的经验。
|
|
112
112
|
|
|
113
113
|
如果你有任何疑问,或者需要进一步的帮助,请不要犹豫,请通过上述渠道与我们联系。
|
|
@@ -57,4 +57,4 @@ You can achieve various feature combinations using the above configuration synta
|
|
|
57
57
|
| `commercial_hide_github` | Hides GitHub-related links in settings footer (requires commercial license). | Disabled |
|
|
58
58
|
| `commercial_hide_docs` | Hides documentation and help menu including changelog, docs, and feedback (requires commercial license). | Disabled |
|
|
59
59
|
|
|
60
|
-
You can always check the [featureFlags](https://github.com/lobehub/
|
|
60
|
+
You can always check the [featureFlags](https://github.com/lobehub/lobehub/blob/main/src/config/featureFlags/schema.ts) to get the latest list of feature flags.
|
|
@@ -53,4 +53,4 @@ tags:
|
|
|
53
53
|
| `commercial_hide_github` | 隐藏设置页面底部的 GitHub 相关链接(需要商业授权)。 | 关闭 |
|
|
54
54
|
| `commercial_hide_docs` | 隐藏文档和帮助菜单,包括更新日志、文档和反馈(需要商业授权)。 | 关闭 |
|
|
55
55
|
|
|
56
|
-
你可以随时检查 [featureFlags](https://github.com/lobehub/
|
|
56
|
+
你可以随时检查 [featureFlags](https://github.com/lobehub/lobehub/blob/main/src/config/featureFlags/schema.ts) 以获取最新的特性标志列表。
|
|
@@ -22,12 +22,12 @@ LobeHub supports file upload and knowledge base management. This feature relies
|
|
|
22
22
|
PostgreSQL is a powerful open-source relational database system, and PGVector is its extension for vector operations.
|
|
23
23
|
|
|
24
24
|
- **Purpose**: Store structured data and vector indexes
|
|
25
|
-
- **Deployment Tip**: Use
|
|
25
|
+
- **Deployment Tip**: Use the ParadeDB Docker image for quick deployment with pgvector and pg\_search plugins
|
|
26
26
|
|
|
27
27
|
Deployment script example:
|
|
28
28
|
|
|
29
29
|
```
|
|
30
|
-
docker run -p 5432:5432 -d --name pg -e POSTGRES_PASSWORD=mysecretpassword
|
|
30
|
+
docker run -p 5432:5432 -d --name pg -e POSTGRES_PASSWORD=mysecretpassword paradedb/paradedb:latest-pg17
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
- **Note**: Ensure sufficient resources for vector operations
|
|
@@ -20,12 +20,12 @@ LobeHub 支持文件上传 / 知识库管理。该功能依赖于以下核心技
|
|
|
20
20
|
PostgreSQL 是一个强大的开源关系型数据库系统,而 PGVector 是其扩展,为向量操作提供支持。
|
|
21
21
|
|
|
22
22
|
- **用途**:存储结构化数据和向量索引
|
|
23
|
-
-
|
|
23
|
+
- **部署建议**:使用 ParadeDB Docker 镜像可以快速部署包含 pgvector 和 pg\_search 插件的 PostgreSQL
|
|
24
24
|
|
|
25
25
|
示例部署脚本:
|
|
26
26
|
|
|
27
27
|
```
|
|
28
|
-
docker run -p 5432:5432 -d --name pg -e POSTGRES_PASSWORD=mysecretpassword
|
|
28
|
+
docker run -p 5432:5432 -d --name pg -e POSTGRES_PASSWORD=mysecretpassword paradedb/paradedb:latest-pg17
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
- **注意事项**:确保分配足够的资源以处理向量操作
|
|
@@ -191,7 +191,7 @@ This URL should point to a functional SearXNG instance. You can choose to self-h
|
|
|
191
191
|
|
|
192
192
|
You can find publicly available SearXNG instances in the [SearXNG instance list](https://searx.space/). Choose an instance that is fast and reliable, and then configure its URL in LobeHub.
|
|
193
193
|
|
|
194
|
-
> Note that the `searxng` you use must have `json` output enabled; otherwise, the `
|
|
194
|
+
> Note that the `searxng` you use must have `json` output enabled; otherwise, the `lobehub` call will result in an error. If self-hosting, find the `searxng` configuration file and add `json` as shown below.
|
|
195
195
|
|
|
196
196
|
```bash
|
|
197
197
|
$ vi searxng/settings.yml
|
|
@@ -186,7 +186,7 @@ SEARXNG_URL=https://searxng-instance.com
|
|
|
186
186
|
|
|
187
187
|
您可以在 [SearXNG 实例列表](https://searx.space/) 中找到公开可用的 SearXNG 实例。选择一个响应速度快、可靠性高的实例,然后将其 URL 配置到 LobeHub 中。
|
|
188
188
|
|
|
189
|
-
> 注意,使用的 `searxng` 必须开启 `json` 输出,否则 `
|
|
189
|
+
> 注意,使用的 `searxng` 必须开启 `json` 输出,否则 `lobehub` 调用会报错。如果是自托管,类似下面这样,找到 `searxng` 的配置文件,追加 `json` 即可。
|
|
190
190
|
|
|
191
191
|
```bash
|
|
192
192
|
$ vi searxng/settings.yml
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Configuring Upstash Redis Service
|
|
3
|
-
description: Step-by-step guide to configure Upstash Redis for
|
|
3
|
+
description: Step-by-step guide to configure Upstash Redis for LobeHub cache and session storage.
|
|
4
4
|
tags:
|
|
5
5
|
- Upstash
|
|
6
6
|
- Redis
|
|
@@ -10,7 +10,7 @@ tags:
|
|
|
10
10
|
|
|
11
11
|
# Configuring Upstash Redis Service
|
|
12
12
|
|
|
13
|
-
[Upstash](https://upstash.com/) is a serverless Redis service that provides a free tier and pay-as-you-go pricing, making it ideal for
|
|
13
|
+
[Upstash](https://upstash.com/) is a serverless Redis service that provides a free tier and pay-as-you-go pricing, making it ideal for LobeHub deployments.
|
|
14
14
|
|
|
15
15
|
## Configuration Steps
|
|
16
16
|
|
|
@@ -37,7 +37,7 @@ tags:
|
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
<Callout type={'info'}>
|
|
40
|
-
Upstash uses `rediss://` (with double 's') for TLS connections.
|
|
40
|
+
Upstash uses `rediss://` (with double 's') for TLS connections. LobeHub supports this format automatically.
|
|
41
41
|
</Callout>
|
|
42
42
|
</Steps>
|
|
43
43
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: 配置 Upstash Redis 服务
|
|
3
|
-
description: 详细指南:如何配置 Upstash Redis 用于
|
|
3
|
+
description: 详细指南:如何配置 Upstash Redis 用于 LobeHub 的缓存和会话存储。
|
|
4
4
|
tags:
|
|
5
5
|
- Upstash
|
|
6
6
|
- Redis
|
|
@@ -10,7 +10,7 @@ tags:
|
|
|
10
10
|
|
|
11
11
|
# 配置 Upstash Redis 服务
|
|
12
12
|
|
|
13
|
-
[Upstash](https://upstash.com/) 是一个 Serverless Redis 服务,提供免费额度和按量付费模式,非常适合
|
|
13
|
+
[Upstash](https://upstash.com/) 是一个 Serverless Redis 服务,提供免费额度和按量付费模式,非常适合 LobeHub 部署使用。
|
|
14
14
|
|
|
15
15
|
## 配置步骤
|
|
16
16
|
|
|
@@ -37,7 +37,7 @@ tags:
|
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
<Callout type={'info'}>
|
|
40
|
-
Upstash 使用 `rediss://`(双
|
|
40
|
+
Upstash 使用 `rediss://`(双's')表示 TLS 连接,LobeHub 自动支持此格式。
|
|
41
41
|
</Callout>
|
|
42
42
|
</Steps>
|
|
43
43
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Configure Redis Cache Service
|
|
3
|
-
description: Learn how to configure Redis cache service to optimize
|
|
3
|
+
description: Learn how to configure Redis cache service to optimize LobeHub performance and session management.
|
|
4
4
|
tags:
|
|
5
5
|
- Redis
|
|
6
6
|
- Cache
|
|
@@ -10,17 +10,17 @@ tags:
|
|
|
10
10
|
|
|
11
11
|
# Configure Redis Cache Service
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
LobeHub uses Redis as a high-performance cache and session storage service to optimize system performance and manage user authentication state.
|
|
14
14
|
|
|
15
15
|
<Callout type={'info'}>
|
|
16
|
-
|
|
16
|
+
LobeHub uses the standard Redis protocol (via ioredis library), supporting any Redis
|
|
17
17
|
protocol-compatible service, including official Redis, self-hosted Redis, and cloud provider Redis
|
|
18
18
|
services (such as AWS ElastiCache, Alibaba Cloud Redis, etc.).
|
|
19
19
|
</Callout>
|
|
20
20
|
|
|
21
21
|
## Use Cases
|
|
22
22
|
|
|
23
|
-
Redis is used in
|
|
23
|
+
Redis is used in LobeHub for the following scenarios:
|
|
24
24
|
|
|
25
25
|
### Authentication Session Storage
|
|
26
26
|
|
|
@@ -57,7 +57,7 @@ Caches Agent configuration data to reduce database queries and improve response
|
|
|
57
57
|
|
|
58
58
|
### `REDIS_PREFIX`
|
|
59
59
|
|
|
60
|
-
The prefix for Redis keys, used to isolate
|
|
60
|
+
The prefix for Redis keys, used to isolate LobeHub data in a shared Redis instance.
|
|
61
61
|
|
|
62
62
|
- Default: `lobechat`
|
|
63
63
|
- Example: `REDIS_PREFIX=my-lobechat`
|
|
@@ -119,7 +119,7 @@ REDIS_PREFIX=lobechat
|
|
|
119
119
|
## Notes
|
|
120
120
|
|
|
121
121
|
<Callout type={'warning'}>
|
|
122
|
-
Redis is an optional service. If `REDIS_URL` is not configured,
|
|
122
|
+
Redis is an optional service. If `REDIS_URL` is not configured, LobeHub will still function
|
|
123
123
|
normally, but will lose the caching and session management optimizations mentioned above.
|
|
124
124
|
</Callout>
|
|
125
125
|
|