Skip to content

Commit 4a741e0

Browse files
committed
Merge branch 'main' of https://github.com/lobehub/lobe-chat
2 parents 75f2293 + b287b0a commit 4a741e0

File tree

4 files changed

+91
-4
lines changed

4 files changed

+91
-4
lines changed

docs/self-hosting/environment-variables/basic.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ LobeChat provides some additional configuration options during deployment, which
3636

3737
When using the `random` mode, a random API Key will be selected from the available multiple API Keys.
3838

39-
When using the `turn` mode, the API Keys will be retrieved in a round-robin manner according to the specified order.
39+
When using the `turn` mode, the API Keys will be retrieved in a polling manner according to the specified order.
4040

4141
### `NEXT_PUBLIC_BASE_PATH`
4242

@@ -50,7 +50,7 @@ When using the `turn` mode, the API Keys will be retrieved in a round-robin mann
5050
- Type: Optional
5151
- Description: Used to configure the default settings for the LobeChat default agent. It supports various data types and structures, including key-value pairs, nested fields, array values, and more.
5252
- Default: -
53-
- Example: `'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer`
53+
- Example: `'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer'`
5454

5555
The `DEFAULT_AGENT_CONFIG` is used to configure the default settings for the LobeChat default agent. It supports various data types and structures, including key-value pairs, nested fields, array values, and more. The table below provides detailed information on the configuration options, examples, and corresponding explanations for the `DEFAULT_AGENT_CONFIG` environment variable:
5656

docs/self-hosting/environment-variables/basic.zh-CN.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
3232

3333
使用 `random` 模式下,将在多个 API Keys 中随机获取一个 API Key。
3434

35-
使用 `turn` 模式下,将按照填写的顺序,轮训获取得到 API Key。
35+
使用 `turn` 模式下,将按照填写的顺序,轮询获取得到 API Key。
3636

3737
### `NEXT_PUBLIC_BASE_PATH`
3838

@@ -46,7 +46,7 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
4646
- 类型:可选
4747
- 描述:用于配置 LobeChat 默认助理的默认配置。它支持多种数据类型和结构,包括键值对、嵌套字段、数组值等。
4848
- 默认值:`-`
49-
- 示例:`'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer`
49+
- 示例:`'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer'`
5050

5151
`DEFAULT_AGENT_CONFIG` 用于配置 LobeChat 默认助理的默认配置。它支持多种数据类型和结构,包括键值对、嵌套字段、数组值等。下表详细说明了 `DEFAULT_AGENT_CONFIG` 环境变量的配置项、示例以及相应解释:
5252

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: LobeChat Feature Flags Environment Variables Configuration Guide
3+
description: >-
4+
Learn how to use environment variables to customize LobeChat's feature flags,
5+
including controlling whether a feature is enabled or disabled, or enabling or
6+
disabling features for specific user groups or environments as needed.
7+
tags:
8+
- LobeChat
9+
- Environment Variables
10+
- Configuration Guide
11+
- Feature Flags
12+
---
13+
14+
# Feature Flags
15+
16+
In addition to basic environment variable configuration, LobeChat also offers feature flags to control whether a feature is enabled globally, or to enable or disable features for specific user groups or environments as needed.
17+
18+
## Feature Flags Environment Variable `FEATURE_FLAGS`
19+
20+
- Type: Optional
21+
- Description: Used to control LobeChat's feature functionalities. Supports multiple feature flags, using `+` to add a feature and `-` to disable a feature. Separate multiple feature flags with a comma `,` and enclose the entire value in quotes `"` to avoid parsing errors.
22+
- Default Value: `-`
23+
- Example: `"-welcome_suggest"`
24+
25+
All features are controlled by the `FEATURE_FLAGS` variable as the sole configuration variable.
26+
27+
You can achieve various feature combinations using the above configuration syntax. All feature flags are Boolean values, enabled with `+` and disabled with `-`.
28+
29+
<Callout type={'tip'}>
30+
Attention: Unlike the `OPENAI_MODEL_LIST` variable, the `FEATURE_FLAGS` variable does not support the `all` keyword. You need to manually control all feature flags (otherwise, they will adopt their default values).
31+
</Callout>
32+
33+
| Configuration Item | Description | Default Value |
34+
| ------------------------- | --------------------------------- | ------------- |
35+
| `webrtc_sync` | Enables WebRTC sync functionality.| Enabled |
36+
| `language_model_settings` | Enables language model settings. | Enabled |
37+
| `openai_api_key` | Allows users to customize the OpenAI API Key. | Enabled |
38+
| `openai_proxy_url` | Allows users to customize the OpenAI proxy URL. | Enabled |
39+
| `create_session` | Allows users to create sessions. | Enabled |
40+
| `edit_agent` | Allows users to edit assistants. | Enabled |
41+
| `dalle` | Enables the DALL-E functionality. | Enabled |
42+
| `check_updates` | Allows checking for updates. | Enabled |
43+
| `welcome_suggest` | Displays welcome suggestions. | Enabled |
44+
45+
You can always check the [featureFlags](https://github.com/lobehub/lobe-chat/blob/main/src/config/featureFlags/index.ts) to get the latest list of feature flags.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: LobeChat 特性标志环境变量配置指南
3+
description: 了解如何使用环境变量自定义 LobeChat 的特性标志,包括控制否启用某个功能、或者根据需要对特定用户群体或环境启用或禁用功能。
4+
tags:
5+
- LobeChat
6+
- 环境变量
7+
- 配置指南
8+
- 特征标志
9+
---
10+
11+
# 特性标志
12+
13+
除了基础的环境变量配置外,LobeChat 还提供了一些特性标志(Feature Flags),用于控制是否全局启用某个功能,或者根据需要对特定用户群体或环境启用或禁用功能。
14+
15+
## 特性标志环境变量 `FEATURE_FLAGS`
16+
17+
- 类型:可选
18+
- 描述:用于控制 LobeChat 的特性功能,支持多个功能标志,使用 `+` 增加一个功能,使用 `-` 来关闭一个功能,多个功能标志之间使用英文逗号 `,` 隔开,最外层建议添加引号 `"` 以避免解析错误。
19+
- 默认值:`-`
20+
- 示例:`"-welcome_suggest"`
21+
22+
所有的功能统一以特性标志 `FEATURE_FLAGS` 作为唯一的配置变量。
23+
24+
你可以通过上述配置语法来实现更多的功能组合。所有的功能配置项都是布尔类型,通过 `+` 来启用,通过 `-` 来关闭。
25+
26+
<Callout type={'tip'}>
27+
注意:与 `OPENAI_MODEL_LIST` 变量不同,`FEATURE_FLAGS` 变量不支持 `all` 关键字,你需要手动控制所有的功能标志(否则它们会采用对应的默认值)。
28+
</Callout>
29+
30+
| 配置项 | 解释 | 默认值 |
31+
| ------------------------- | -------------------------------- | ------ |
32+
| `webrtc_sync` | 启用 WebRTC 同步功能。 | 开启 |
33+
| `language_model_settings` | 启用语言模型设置。 | 开启 |
34+
| `openai_api_key` | 允许用户自定义 OpenAI API Key。 | 开启 |
35+
| `openai_proxy_url` | 允许用户自定义 OpenAI 代理 URL。 | 开启 |
36+
| `create_session` | 允许用户创建会话。 | 开启 |
37+
| `edit_agent` | 允许用户编辑助手。 | 开启 |
38+
| `dalle` | 启用 DALL-E 功能。 | 开启 |
39+
| `check_updates` | 允许检查更新。 | 开启 |
40+
| `welcome_suggest` | 显示欢迎建议。 | 开启 |
41+
42+
你可以随时检查 [featureFlags](https://github.com/lobehub/lobe-chat/blob/main/src/config/featureFlags/index.ts) 以获取最新的特性标志列表。

0 commit comments

Comments
 (0)