@lobehub/chat 0.147.4 → 0.147.5

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 (43) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/docs/self-hosting/advanced/authentication.mdx +5 -5
  3. package/docs/self-hosting/advanced/authentication.zh-CN.mdx +5 -5
  4. package/docs/self-hosting/advanced/sso-providers/auth0.mdx +1 -1
  5. package/docs/self-hosting/advanced/sso-providers/auth0.zh-CN.mdx +1 -1
  6. package/docs/self-hosting/advanced/sso-providers/authentik.mdx +1 -1
  7. package/docs/self-hosting/advanced/sso-providers/authentik.zh-CN.mdx +1 -1
  8. package/docs/self-hosting/advanced/sso-providers/github.mdx +1 -1
  9. package/docs/self-hosting/advanced/sso-providers/github.zh-CN.mdx +1 -1
  10. package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.mdx +1 -1
  11. package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.zh-CN.mdx +1 -1
  12. package/docs/self-hosting/advanced/sso-providers/zitadel.mdx +1 -1
  13. package/docs/self-hosting/advanced/sso-providers/zitadel.zh-CN.mdx +1 -1
  14. package/docs/self-hosting/examples/ollama.zh-CN.mdx +1 -1
  15. package/docs/self-hosting/platform/docker-compose.mdx +12 -11
  16. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +28 -26
  17. package/docs/self-hosting/platform/docker.mdx +1 -1
  18. package/docs/self-hosting/platform/docker.zh-CN.mdx +1 -1
  19. package/docs/self-hosting/platform/netlify.mdx +1 -1
  20. package/docs/self-hosting/platform/netlify.zh-CN.mdx +1 -1
  21. package/docs/self-hosting/platform/vercel.mdx +1 -1
  22. package/docs/self-hosting/platform/vercel.zh-CN.mdx +1 -1
  23. package/docs/usage/agents/custom-agent.mdx +2 -2
  24. package/docs/usage/agents/custom-agent.zh-CN.mdx +2 -2
  25. package/docs/usage/features/multi-ai-providers.mdx +1 -1
  26. package/docs/usage/features/multi-ai-providers.zh-CN.mdx +1 -1
  27. package/docs/usage/features/plugin-system.mdx +1 -1
  28. package/docs/usage/features/plugin-system.zh-CN.mdx +2 -2
  29. package/docs/usage/plugins/custom-plugin.mdx +1 -1
  30. package/docs/usage/plugins/custom-plugin.zh-CN.mdx +1 -1
  31. package/docs/usage/providers/ollama/gemma.mdx +2 -2
  32. package/docs/usage/providers/ollama/gemma.zh-CN.mdx +2 -2
  33. package/docs/usage/providers/ollama/qwen.mdx +2 -2
  34. package/docs/usage/providers/ollama/qwen.zh-CN.mdx +2 -2
  35. package/docs/usage/providers/ollama.mdx +1 -1
  36. package/docs/usage/providers/ollama.zh-CN.mdx +1 -1
  37. package/package.json +1 -1
  38. package/src/app/chat/features/TopicListContent/TopicSearchBar/index.tsx +6 -4
  39. package/src/database/models/__tests__/topic.test.ts +26 -3
  40. package/src/database/models/topic.ts +8 -3
  41. package/src/services/__tests__/topic.test.ts +3 -3
  42. package/src/services/topic.ts +2 -2
  43. package/src/store/chat/slices/topic/action.ts +5 -4
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.147.5](https://github.com/lobehub/lobe-chat/compare/v0.147.4...v0.147.5)
6
+
7
+ <sup>Released on **2024-04-11**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix only search topics in current session.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix only search topics in current session, closes [#1834](https://github.com/lobehub/lobe-chat/issues/1834) ([9fdcfa4](https://github.com/lobehub/lobe-chat/commit/9fdcfa4))
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
+
5
30
  ### [Version 0.147.4](https://github.com/lobehub/lobe-chat/compare/v0.147.3...v0.147.4)
6
31
 
7
32
  <sup>Released on **2024-04-11**</sup>
@@ -24,11 +24,11 @@ LobeChat supports the configuration of external identity verification services f
24
24
 
25
25
  Currently supported identity verification services include:
26
26
 
27
- - [Auth0](/en/docs/self-hosting/advanced/sso-providers/auth0)
28
- - [Microsoft Entra ID](/en/docs/self-hosting/advanced/sso-providers/microsoft-entra-id)
29
- - [Authentik](/en/docs/self-hosting/advanced/sso-providers/authentik)
30
- - [Github](/en/docs/self-hosting/advanced/sso-providers/github)
31
- - [ZITADEL](/en/docs/self-hosting/advanced/sso-providers/zitadel)
27
+ - [Auth0](/docs/self-hosting/advanced/sso-providers/auth0)
28
+ - [Microsoft Entra ID](/docs/self-hosting/advanced/sso-providers/microsoft-entra-id)
29
+ - [Authentik](/docs/self-hosting/advanced/sso-providers/authentik)
30
+ - [Github](/docs/self-hosting/advanced/sso-providers/github)
31
+ - [ZITADEL](/docs/self-hosting/advanced/sso-providers/zitadel)
32
32
 
33
33
  Click on the links to view the corresponding platform's configuration documentation.
34
34
 
@@ -20,11 +20,11 @@ LobeChat 支持配置外部身份验证服务,供企业 / 组织内部使用
20
20
 
21
21
  目前支持的身份验证服务有:
22
22
 
23
- - [Auth0](/zh/docs/self-hosting/advanced/sso-providers/auth0)
24
- - [Microsoft Entra ID](/zh/docs/self-hosting/advanced/sso-providers/microsoft-entra-id)
25
- - [Authentik](/zh/docs/self-hosting/advanced/sso-providers/authentik)
26
- - [Github](/zh/docs/self-hosting/advanced/sso-providers/github)
27
- - [ZITADEL](/zh/docs/self-hosting/advanced/sso-providers/zitadel)
23
+ - [Auth0](/docs/self-hosting/advanced/sso-providers/auth0)
24
+ - [Microsoft Entra ID](/docs/self-hosting/advanced/sso-providers/microsoft-entra-id)
25
+ - [Authentik](/docs/self-hosting/advanced/sso-providers/authentik)
26
+ - [Github](/docs/self-hosting/advanced/sso-providers/github)
27
+ - [ZITADEL](/docs/self-hosting/advanced/sso-providers/zitadel)
28
28
 
29
29
  点击链接可以查看对应平台的配置文档。
30
30
 
@@ -86,7 +86,7 @@ When deploying LobeChat, you need to configure the following environment variabl
86
86
  | `NEXTAUTH_URL` | Optional | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` |
87
87
 
88
88
  <Callout type={'tip'}>
89
- You can refer to the related variable details at [📘Environment Variables](/en/docs/self-hosting/environment-variable#auth0).
89
+ You can refer to the related variable details at [📘Environment Variables](/docs/self-hosting/environment-variable#auth0).
90
90
 
91
91
  </Callout>
92
92
  </Steps>
@@ -81,7 +81,7 @@ http(s)://your-domain/api/auth/callback/auth0
81
81
  | `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
82
82
 
83
83
  <Callout type={'tip'}>
84
- 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#auth0) 可查阅相关变量详情。
84
+ 前往 [📘 环境变量](/docs/self-hosting/environment-variable#auth0) 可查阅相关变量详情。
85
85
 
86
86
  </Callout>
87
87
  </Steps>
@@ -64,7 +64,7 @@ When deploying LobeChat, you need to configure the following environment variabl
64
64
  | `NEXTAUTH_URL` | Optional | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` |
65
65
 
66
66
  <Callout type={'tip'}>
67
- Go to Environment Variables: /en/docs/self-hosting/environment-variable#Authentik for details about the variables.
67
+ Go to Environment Variables: /docs/self-hosting/environment-variable#Authentik for details about the variables.
68
68
 
69
69
  </Callout>
70
70
  </Steps>
@@ -59,7 +59,7 @@ https://your-domain/api/auth/callback/authentik
59
59
  | `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
60
60
 
61
61
  <Callout type={'tip'}>
62
- 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#Authentik) 可查阅相关变量详情。
62
+ 前往 [📘 环境变量](/docs/self-hosting/environment-variable#Authentik) 可查阅相关变量详情。
63
63
 
64
64
  </Callout>
65
65
  </Steps>
@@ -91,7 +91,7 @@ When deploying LobeChat, you need to configure the following environment variabl
91
91
  | `NEXTAUTH_URL` | Optional | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` |
92
92
 
93
93
  <Callout type={'tip'}>
94
- Go to [📘 Environment Variables](/en/docs/self-hosting/environment-variable#Github) for detailed
94
+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Github) for detailed
95
95
  information on these variables.
96
96
  </Callout>
97
97
  </Steps>
@@ -87,7 +87,7 @@ tags:
87
87
  | `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
88
88
 
89
89
  <Callout type={'tip'}>
90
- 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#Github) 可查阅相关变量详情。
90
+ 前往 [📘 环境变量](/docs/self-hosting/environment-variable#Github) 可查阅相关变量详情。
91
91
 
92
92
  </Callout>
93
93
  </Steps>
@@ -82,7 +82,7 @@ When deploying LobeChat, you need to configure the following environment variabl
82
82
 
83
83
  <Callout type={'tip'}>
84
84
  You can refer to [📘 environment
85
- variables](/en/docs/self-hosting/environment-variable#microsoft-entra-id) for details on related
85
+ variables](/docs/self-hosting/environment-variable#microsoft-entra-id) for details on related
86
86
  variables.
87
87
  </Callout>
88
88
 
@@ -78,7 +78,7 @@ https://your-domain/api/auth/callback/azure-ad
78
78
  | `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
79
79
 
80
80
  <Callout type={'tip'}>
81
- 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#microsoft-entra-id) 可查阅相关变量详情。
81
+ 前往 [📘 环境变量](/docs/self-hosting/environment-variable#microsoft-entra-id) 可查阅相关变量详情。
82
82
 
83
83
  </Callout>
84
84
  </Steps>
@@ -99,7 +99,7 @@ When deploying LobeChat, you need to configure the following environment variabl
99
99
  | `NEXTAUTH_URL` | Optional | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` |
100
100
 
101
101
  <Callout type={'tip'}>
102
- You can refer to the related variable details at [📘Environment Variables](/en/docs/self-hosting/environment-variables/auth#zitadel).
102
+ You can refer to the related variable details at [📘Environment Variables](/docs/self-hosting/environment-variables/auth#zitadel).
103
103
 
104
104
  </Callout>
105
105
  </Steps>
@@ -95,7 +95,7 @@ http(s)://your-domain/api/auth/callback/zitadel
95
95
  | `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 中执行 OAuth 认证的回调地址。仅当默认地址不正确时才需要设置。`https://example.com/api/auth` |
96
96
 
97
97
  <Callout type={'tip'}>
98
- 您可以在 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#zitadel) 中查看相关变量的详细信息。
98
+ 您可以在 [📘 环境变量](/docs/self-hosting/environment-variables/auth#zitadel) 中查看相关变量的详细信息。
99
99
 
100
100
  </Callout>
101
101
  </Steps>
@@ -30,7 +30,7 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434
30
30
 
31
31
  接下来,你就可以使用 LobeChat 与本地 LLM 对话了。
32
32
 
33
- 关于在 LobeChat 中使用 Ollama 的更多信息,请查阅 [Ollama 使用](/zh/docs/usage/providers/ollama)。
33
+ 关于在 LobeChat 中使用 Ollama 的更多信息,请查阅 [Ollama 使用](/docs/usage/providers/ollama)。
34
34
 
35
35
  ## 非本地访问 Ollama
36
36
 
@@ -15,7 +15,8 @@ tags:
15
15
  # Docker Compose Deployment Guide
16
16
 
17
17
  <div style={{display:"flex", gap: 4}}>
18
- [![][docker-release-shield]][docker-release-link]
18
+
19
+ [![][docker-release-shield]][docker-release-link]
19
20
 
20
21
  [![][docker-size-shield]][docker-size-link]
21
22
 
@@ -26,29 +27,29 @@ tags:
26
27
  We provide a [Docker image][docker-release-link] for deploying the LobeChat service on your private device.
27
28
 
28
29
  <Steps>
29
-
30
+
30
31
  ### Install Docker Container Environment
31
32
 
32
33
  (Skip this step if already installed)
33
34
 
34
35
  <Tabs items={['Ubuntu', 'CentOS']}>
35
-
36
+
36
37
  <Tab>
37
-
38
- ```fish
39
- $ apt install docker.io
40
- ```
41
-
38
+
39
+ ```fish
40
+ $ apt install docker.io
41
+ ```
42
+
42
43
  </Tab>
43
44
 
44
45
  <Tab>
45
-
46
+
46
47
  ```fish
47
48
  $ yum install docker
48
49
  ```
49
-
50
+
50
51
  </Tab>
51
-
52
+
52
53
  </Tabs>
53
54
 
54
55
  ### Run Docker Compose Deployment Command
@@ -12,7 +12,8 @@ tags:
12
12
  # Docker Compose 部署指引
13
13
 
14
14
  <div style={{display:"flex", gap: 4}}>
15
- [![][docker-release-shield]][docker-release-link]
15
+
16
+ [![][docker-release-shield]][docker-release-link]
16
17
 
17
18
  [![][docker-size-shield]][docker-size-link]
18
19
 
@@ -23,7 +24,8 @@ tags:
23
24
  我们提供了 [Docker 镜像][docker-release-link],供你在自己的私有设备上部署 LobeChat 服务。
24
25
 
25
26
  <Steps>
26
- ### 安装 Docker 容器环境
27
+
28
+ ### 安装 Docker 容器环境
27
29
 
28
30
  (如果已安装,请跳过此步)
29
31
 
@@ -55,16 +57,16 @@ $ yum install docker
55
57
  version: '3.8'
56
58
 
57
59
  services:
58
- lobe-chat:
59
- image: lobehub/lobe-chat
60
- container_name: lobe-chat
61
- restart: always
62
- ports:
63
- - '3210:3210'
64
- environment:
65
- OPENAI_API_KEY: sk-xxxx
66
- OPENAI_PROXY_URL: https://api-proxy.com/v1
67
- ACCESS_CODE: lobe66
60
+ lobe-chat:
61
+ image: lobehub/lobe-chat
62
+ container_name: lobe-chat
63
+ restart: always
64
+ ports:
65
+ - '3210:3210'
66
+ environment:
67
+ OPENAI_API_KEY: sk-xxxx
68
+ OPENAI_PROXY_URL: https://api-proxy.com/v1
69
+ ACCESS_CODE: lobe66
68
70
  ```
69
71
 
70
72
  运行以下命令启动 Lobe Chat 服务:
@@ -81,48 +83,48 @@ $ docker-compose up -d
81
83
  #!/bin/bash
82
84
  # auto-update-lobe-chat.sh
83
85
 
84
- # 设置代理(可选)
86
+ # Set proxy (optional)
85
87
  export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
86
88
 
87
- # 拉取最新的镜像并将输出存储在变量中
89
+ # Pull the latest image and store the output in a variable
88
90
  output=$(docker pull lobehub/lobe-chat:latest 2>&1)
89
91
 
90
- # 检查拉取命令是否成功执行
92
+ # Check if the pull command was executed successfully
91
93
  if [ $? -ne 0 ]; then
92
- exit 1
94
+ exit 1
93
95
  fi
94
96
 
95
- # 检查输出中是否包含特定的字符串
97
+ # Check if the output contains a specific string
96
98
  echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest"
97
99
 
98
- # 如果镜像已经是最新的,则不执行任何操作
100
+ # If the image is already up to date, do nothing
99
101
  if [ $? -eq 0 ]; then
100
- exit 0
102
+ exit 0
101
103
  fi
102
104
 
103
105
  echo "Detected Lobe-Chat update"
104
106
 
105
- # 删除旧的容器
107
+ # Remove the old container
106
108
  echo "Removed: $(docker rm -f Lobe-Chat)"
107
109
 
108
- # 也许需要先进入 `docker-compose.yml` 所在的目录
110
+ # You may need to navigate to the directory where `docker-compose.yml` is located first
109
111
  # cd /path/to/docker-compose-folder
110
112
 
111
- # 运行新的容器
113
+ # Run the new container
112
114
  echo "Started: $(docker-compose up)"
113
115
 
114
- # 打印更新的时间和版本
116
+ # Print the update time and version
115
117
  echo "Update time: $(date)"
116
118
  echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')"
117
119
 
118
- # 清理不再使用的镜像
120
+ # Clean up unused images
119
121
  docker images | grep 'lobehub/lobe-chat' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
120
122
  echo "Removed old images."
121
123
  ```
122
124
 
123
- 此脚本亦可以在 Crontab 中使用,但请确认你的 Crontab 可以找到正确的 Docker 命令。建议使用绝对路径。
125
+ This script can also be used in Crontab, but ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths.
124
126
 
125
- 配置 Crontab,每 5 分钟执行一次脚本:
127
+ Configure Crontab to execute the script every 5 minutes:
126
128
 
127
129
  ```bash
128
130
  */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1
@@ -64,7 +64,7 @@ Command explanation:
64
64
 
65
65
  - Replace `sk-xxxx` in the above command with your OpenAI API Key.
66
66
 
67
- - For the complete list of environment variables supported by LobeChat, please refer to the [Environment Variables](/zh/docs/self-hosting/environment-ariable) section.
67
+ - For the complete list of environment variables supported by LobeChat, please refer to the [Environment Variables](/docs/self-hosting/environment-ariable) section.
68
68
 
69
69
  <Callout type="tip">
70
70
  Since the official Docker image build takes about half an hour, if you see the "update available"
@@ -63,7 +63,7 @@ $ docker run -d -p 3210:3210 \
63
63
  - 使用你的 OpenAI API Key 替换上述命令中的 `sk-xxxx`
64
64
 
65
65
  <Callout type={'tip'}>
66
- LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/zh/docs/self-hosting/environment-variables) 部分
66
+ LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/docs/self-hosting/environment-variables) 部分
67
67
  </Callout>
68
68
 
69
69
  <Callout>
@@ -92,7 +92,7 @@ Taking OpenAI as an example, the environment variables you need to add are as fo
92
92
 
93
93
  <Callout type={'tip'}>
94
94
  For a complete list of environment variables supported by LobeChat, please refer to the [📘
95
- Environment Variables](/en/docs/self-hosting/environment-variables)
95
+ Environment Variables](/docs/self-hosting/environment-variables)
96
96
  </Callout>
97
97
 
98
98
  Afteradding the variables, finally click "Deploy lobe-chat" to enter the deployment phase
@@ -86,7 +86,7 @@ tags:
86
86
  | `OPENAI_PROXY_URL` | 可选 | 如果你手动配置了 OpenAI 接口代理,可以使用此配置项来覆盖默认的 OpenAI API 请求基础 URL | `https://aihubmix.com/v1` ,默认值:`https://api.openai.com/v1` |
87
87
 
88
88
  <Callout type={'tip'}>
89
- LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/zh/docs/self-hosting/environment-variables) 部分
89
+ LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/docs/self-hosting/environment-variables) 部分
90
90
  </Callout>
91
91
 
92
92
  添加完成后,最后点击「Deploy lobe-chat」 进入部署阶段。
@@ -41,7 +41,7 @@ Vercel's assigned domain DNS may be polluted in some regions, so binding a custo
41
41
  If you have deployed your project using the one-click deployment steps mentioned above, you may find that you are always prompted with "updates available." This is because Vercel creates a new project for you by default instead of forking this project, which causes the inability to accurately detect updates.
42
42
 
43
43
  <Callout>
44
- We recommend following the [Self-Hosting Upstream Sync](/zh/docs/self-hosting/upstream-sync) steps to
44
+ We recommend following the [Self-Hosting Upstream Sync](/docs/self-hosting/upstream-sync) steps to
45
45
  Redeploy.
46
46
  </Callout>
47
47
 
@@ -40,7 +40,7 @@ Vercel 分配的域名 DNS 在某些区域被污染了,绑定自定义域名
40
40
  如果你根据上述中的一键部署步骤部署了自己的项目,你可能会发现总是被提示 “有可用更新”。这是因为 Vercel 默认为你创建新项目而非 fork 本项目,这将导致无法准确检测更新。
41
41
 
42
42
  <Callout>
43
- 我们建议按照 [📘 LobeChat 自部署保持更新](/zh/docs/self-hosting/advanced/upstream-sync) 步骤重新部署。
43
+ 我们建议按照 [📘 LobeChat 自部署保持更新](/docs/self-hosting/advanced/upstream-sync) 步骤重新部署。
44
44
  </Callout>
45
45
 
46
46
  [deploy-button-image]: https://vercel.com/button
@@ -52,7 +52,7 @@ When you need to handle specific tasks, you need to consider creating a custom a
52
52
  If you want to understand Prompt writing tips and common model parameter settings, you can continue to view:
53
53
 
54
54
  <Cards>
55
- <Card href={'/en/docs/usage/agents/prompt'} title={'Prompt User Guide'} />
55
+ <Card href={'/docs/usage/agents/prompt'} title={'Prompt User Guide'} />
56
56
 
57
- <Card href={'/en/docs/usage/agents/model'} title={'Large Language Model User Guide'} />
57
+ <Card href={'/docs/usage/agents/model'} title={'Large Language Model User Guide'} />
58
58
  </Cards>
@@ -47,7 +47,7 @@ tags:
47
47
  如果你希望理解 Prompt 编写技巧和常见的模型参数设置,可以继续查看:
48
48
 
49
49
  <Cards>
50
- <Card href={'/zh/docs/usage/agents/prompt'} title={'Prompt 使用指南'} />
50
+ <Card href={'/docs/usage/agents/prompt'} title={'Prompt 使用指南'} />
51
51
 
52
- <Card href={'/zh/docs/usage/agents/model'} title={'大语言模型使用指南'} />
52
+ <Card href={'/docs/usage/agents/model'} title={'大语言模型使用指南'} />
53
53
  </Cards>
@@ -55,4 +55,4 @@ At the same time, we are also planning to support more model service providers,
55
55
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/ca9a21bc-ea6c-4c90-bf4a-fa53b4fb2b5c'}
56
56
  />
57
57
 
58
- To meet the specific needs of users, LobeChat also supports the use of local models based on [Ollama](https://ollama.ai), allowing users to flexibly use their own or third-party models. For more details, see [Local Model Support](/en/docs/usage/features/local-llm).
58
+ To meet the specific needs of users, LobeChat also supports the use of local models based on [Ollama](https://ollama.ai), allowing users to flexibly use their own or third-party models. For more details, see [Local Model Support](/docs/usage/features/local-llm).
@@ -55,4 +55,4 @@ tags:
55
55
  src={'https://github.com/lobehub/lobe-chat/assets/28616219/ca9a21bc-ea6c-4c90-bf4a-fa53b4fb2b5c'}
56
56
  />
57
57
 
58
- 为了满足特定用户的需求,LobeChat 还基于 [Ollama](https://ollama.ai) 支持了本地模型的使用,让用户能够更灵活地使用自己的或第三方的模型,详见 [本地模型支持](/zh/docs/usage/features/local-llm)。
58
+ 为了满足特定用户的需求,LobeChat 还基于 [Ollama](https://ollama.ai) 支持了本地模型的使用,让用户能够更灵活地使用自己的或第三方的模型,详见 [本地模型支持](/docs/usage/features/local-llm)。
@@ -52,7 +52,7 @@ Learn more about [plugin usage](/en-US/usage/plugins/basic) by checking it out.
52
52
 
53
53
  <Callout>
54
54
  If you are interested in plugin development, please refer to our [📘 Plugin Development
55
- Guide](/en/docs/usage/plugins/development) in the Wiki.
55
+ Guide](/docs/usage/plugins/development) in the Wiki.
56
56
  </Callout>
57
57
 
58
58
  - [lobe-chat-plugins][lobe-chat-plugins]: This is the plugin index for LobeChat. It retrieves the list of plugins from the index.json of this repository and displays them to the users.
@@ -27,7 +27,7 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
27
27
 
28
28
  此外,这些插件不仅局限于新闻聚合,还可以扩展到其他实用的功能,如快速检索文档、生成图片、获取 Bilibili 、Steam 等各种平台数据,以及与其他各式各样的第三方服务交互。
29
29
 
30
- 通过查看 [插件使用](/zh/docs/usage/plugins/basic) 了解更多。
30
+ 通过查看 [插件使用](/docs/usage/plugins/basic) 了解更多。
31
31
 
32
32
  <Callout type={'tip'}>
33
33
  为了帮助开发者更好地参与到这个生态中来,我们在提供了全面的开发资源。这包括详尽的组件开发文档、功能齐全的软件开发工具包(SDK),以及样板示例,这些都是为了简化开发过程,降低开发者的入门门槛。
@@ -40,7 +40,7 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
40
40
  ## 插件生态体系
41
41
 
42
42
  <Callout>
43
- 如果你对插件开发感兴趣,请在 Wiki 中查阅我们的 [📘 插件开发指南](/zh/docs/usage/plugins/development)。
43
+ 如果你对插件开发感兴趣,请在 Wiki 中查阅我们的 [📘 插件开发指南](/docs/usage/plugins/development)。
44
44
  </Callout>
45
45
 
46
46
  - [lobe-chat-plugins][lobe-chat-plugins]:这是 LobeChat 的插件索引。它从该仓库的 index.json 中获取插件列表并显示给用户。
@@ -34,4 +34,4 @@ If you want to try installing custom plugins on your own, you can use the follow
34
34
 
35
35
  ## Developing Custom Plugins
36
36
 
37
- If you wish to develop a LobeChat plugin on your own, feel free to refer to the [Plugin Development Guide](/en/docs/usage/plugins/development) to expand the possibilities of your AI assistant!
37
+ If you wish to develop a LobeChat plugin on your own, feel free to refer to the [Plugin Development Guide](/docs/usage/plugins/development) to expand the possibilities of your AI assistant!
@@ -32,4 +32,4 @@ tags:
32
32
 
33
33
  ## 开发自定义插件
34
34
 
35
- 如果你希望自行开发一个 LobeChat 的插件,欢迎查阅 [插件开发指南](/zh/docs/usage/plugins/development) 以扩展你的 AI 智能助手的可能性边界!
35
+ 如果你希望自行开发一个 LobeChat 的插件,欢迎查阅 [插件开发指南](/docs/usage/plugins/development) 以扩展你的 AI 智能助手的可能性边界!
@@ -27,7 +27,7 @@ This document will guide you on how to use Google Gemma in LobeChat:
27
27
  <Steps>
28
28
  ### Install Ollama locally
29
29
 
30
- First, you need to install Ollama. For the installation process, please refer to the [Ollama usage documentation](/en/docs/usage/providers/ollama).
30
+ First, you need to install Ollama. For the installation process, please refer to the [Ollama usage documentation](/docs/usage/providers/ollama).
31
31
 
32
32
  ### Pull Google Gemma model to local using Ollama
33
33
 
@@ -59,7 +59,7 @@ In the session page, open the model panel and then select the Gemma model.
59
59
 
60
60
  <Callout type={'info'}>
61
61
  If you do not see the Ollama provider in the model selection panel, please refer to [Integrating
62
- with Ollama](/en/docs/self-hosting/examples/ollama) to learn how to enable the Ollama provider in
62
+ with Ollama](/docs/self-hosting/examples/ollama) to learn how to enable the Ollama provider in
63
63
  LobeChat.
64
64
 
65
65
  </Callout>
@@ -27,7 +27,7 @@ tags:
27
27
  <Steps>
28
28
  ### 本地安装 Ollama
29
29
 
30
- 首先,你需要安装 Ollama,安装过程请查阅 [Ollama 使用文件](/zh/docs/usage/providers/ollama)。
30
+ 首先,你需要安装 Ollama,安装过程请查阅 [Ollama 使用文件](/docs/usage/providers/ollama)。
31
31
 
32
32
  ### 用 Ollama 拉取 Google Gemma 模型到本地
33
33
 
@@ -59,7 +59,7 @@ ollama pull gemma
59
59
 
60
60
  <Callout type={'info'}>
61
61
  如果你没有在模型选择面板中看到 Ollama 服务商,请查阅 [与 Ollama
62
- 集成](/zh/docs/self-hosting/examples/ollama) 了解如何在 LobeChat 中开启 Ollama 服务商。
62
+ 集成](/docs/self-hosting/examples/ollama) 了解如何在 LobeChat 中开启 Ollama 服务商。
63
63
 
64
64
  </Callout>
65
65
  </Steps>
@@ -26,7 +26,7 @@ Now, through the integration of LobeChat and [Ollama](https://ollama.com/), you
26
26
  <Steps>
27
27
  ## Local Installation of Ollama
28
28
 
29
- First, you need to install Ollama. For the installation process, please refer to the [Ollama Usage Document](/en/docs/usage/providers/ollama).
29
+ First, you need to install Ollama. For the installation process, please refer to the [Ollama Usage Document](/docs/usage/providers/ollama).
30
30
 
31
31
  ## Pull the Qwen Model to Local with Ollama
32
32
 
@@ -61,7 +61,7 @@ In the LobeChat conversation page, open the model selection panel, and then sele
61
61
  />
62
62
 
63
63
  <Callout type={'info'}>
64
- If you do not see the Ollama provider in the model selection panel, please refer to [Integration with Ollama](/en/docs/self-hosting/examples/ollama) to learn how to enable the Ollama provider in LobeChat.
64
+ If you do not see the Ollama provider in the model selection panel, please refer to [Integration with Ollama](/docs/self-hosting/examples/ollama) to learn how to enable the Ollama provider in LobeChat.
65
65
 
66
66
  </Callout>
67
67
  </Steps>
@@ -28,7 +28,7 @@ tags:
28
28
  <Steps>
29
29
  ### 本地安装 Ollama
30
30
 
31
- 首先,你需要安装 Ollama,安装过程请查阅 [Ollama 使用文件](/zh/docs/usage/providers/ollama)。
31
+ 首先,你需要安装 Ollama,安装过程请查阅 [Ollama 使用文件](/docs/usage/providers/ollama)。
32
32
 
33
33
  ### 用 Ollama 拉取 Qwen 模型到本地
34
34
 
@@ -58,7 +58,7 @@ ollama pull qwen:14b
58
58
 
59
59
  <Callout type={'info'}>
60
60
  如果你没有在模型选择面板中看到 Ollama 服务商,请查阅 [与 Ollama
61
- 集成](/zh/docs/self-hosting/examples/ollama) 了解如何在 LobeChat 中开启 Ollama 服务商。
61
+ 集成](/docs/self-hosting/examples/ollama) 了解如何在 LobeChat 中开启 Ollama 服务商。
62
62
 
63
63
  </Callout>
64
64
  </Steps>
@@ -76,7 +76,7 @@ Next, you can start conversing with the local LLM using LobeChat.
76
76
  />
77
77
 
78
78
  <Callout type={'info'}>
79
- You can visit [Integrating with Ollama](/en/docs/self-hosting/examples/ollama) to learn how to deploy
79
+ You can visit [Integrating with Ollama](/docs/self-hosting/examples/ollama) to learn how to deploy
80
80
  LobeChat to meet the integration requirements with Ollama.
81
81
 
82
82
  </Callout>
@@ -76,7 +76,7 @@ Ollama 支持多种模型,你可以在 [Ollama Library](https://ollama.com/lib
76
76
  />
77
77
 
78
78
  <Callout type={'info'}>
79
- 你可以前往 [与 Ollama 集成](/zh/docs/self-hosting/examples/ollama) 了解如何部署 LobeChat ,以满足与 Ollama 的集成需求。
79
+ 你可以前往 [与 Ollama 集成](/docs/self-hosting/examples/ollama) 了解如何部署 LobeChat ,以满足与 Ollama 的集成需求。
80
80
 
81
81
  </Callout>
82
82
  </Steps>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.147.4",
3
+ "version": "0.147.5",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -1,4 +1,5 @@
1
1
  import { SearchBar } from '@lobehub/ui';
2
+ import { useUnmount } from 'ahooks';
2
3
  import { useResponsive } from 'antd-style';
3
4
  import { memo, useState } from 'react';
4
5
  import { useTranslation } from 'react-i18next';
@@ -10,11 +11,12 @@ const TopicSearchBar = memo<{ onClear?: () => void }>(({ onClear }) => {
10
11
 
11
12
  const [keywords, setKeywords] = useState('');
12
13
  const { mobile } = useResponsive();
14
+ const [activeSessionId, useSearchTopics] = useChatStore((s) => [s.activeId, s.useSearchTopics]);
13
15
 
14
- const useSearchTopics = useChatStore((s) => s.useSearchTopics);
15
-
16
- useSearchTopics(keywords);
17
-
16
+ useSearchTopics(keywords, activeSessionId);
17
+ useUnmount(() => {
18
+ useChatStore.setState({ isSearchingTopic: false });
19
+ });
18
20
  return (
19
21
  <SearchBar
20
22
  autoFocus
@@ -11,11 +11,11 @@ import { CreateTopicParams, QueryTopicParams, TopicModel } from '../topic';
11
11
 
12
12
  describe('TopicModel', () => {
13
13
  let topicData: CreateTopicParams;
14
-
14
+ const currentSessionId = 'session1';
15
15
  beforeEach(() => {
16
16
  // Set up topic data with the correct structure
17
17
  topicData = {
18
- sessionId: 'session1',
18
+ sessionId: currentSessionId,
19
19
  title: 'Test Topic',
20
20
  favorite: false,
21
21
  };
@@ -484,7 +484,7 @@ describe('TopicModel', () => {
484
484
  });
485
485
 
486
486
  describe('queryByKeyword', () => {
487
- it('should query topics by keyword', async () => {
487
+ it('should query global topics by keyword', async () => {
488
488
  // Create a topic with a unique title
489
489
  const uniqueTitle = 'Unique Title';
490
490
  await TopicModel.create({ ...topicData, title: uniqueTitle });
@@ -496,5 +496,28 @@ describe('TopicModel', () => {
496
496
  expect(topics).toHaveLength(1);
497
497
  expect(topics[0].title).toBe(uniqueTitle);
498
498
  });
499
+ it('should query topics in current session by keyword', async () => {
500
+ // Create a topic with a unique title
501
+ const uniqueTitle = 'Unique Title';
502
+ await TopicModel.create({ ...topicData, title: uniqueTitle });
503
+
504
+ // Query topics by the unique title
505
+ const topics = await TopicModel.queryByKeyword(uniqueTitle, currentSessionId);
506
+
507
+ // Verify the correct topic is queried
508
+ expect(topics).toHaveLength(1);
509
+ expect(topics[0].title).toBe(uniqueTitle);
510
+ });
511
+ it('should not query any topic in other session by keyword', async () => {
512
+ // Create a topic with a unique title
513
+ const uniqueTitle = 'Unique Title';
514
+ await TopicModel.create({ ...topicData, title: uniqueTitle });
515
+
516
+ // Query topics by the unique title
517
+ const topics = await TopicModel.queryByKeyword(uniqueTitle, 'session-id-2');
518
+
519
+ // Verify the correct topic is queried
520
+ expect(topics).toHaveLength(0);
521
+ });
499
522
  });
500
523
  });
@@ -53,20 +53,25 @@ class _TopicModel extends BaseModel {
53
53
  /**
54
54
  * Query topics by keyword in title, message content, or translated content
55
55
  * @param keyword The keyword to search for
56
+ * @param sessionId The currently activated session id.
56
57
  */
57
- async queryByKeyword(keyword: string): Promise<ChatTopic[]> {
58
+ async queryByKeyword(keyword: string, sessionId?: string): Promise<ChatTopic[]> {
58
59
  if (!keyword) return [];
59
60
 
60
61
  console.time('queryTopicsByKeyword');
61
62
  const keywordLowerCase = keyword.toLowerCase();
62
63
 
63
64
  // Find topics with matching title
64
- const matchingTopicsPromise = this.table
65
+ const queryTable = sessionId ? this.table.where('sessionId').equals(sessionId) : this.table;
66
+ const matchingTopicsPromise = queryTable
65
67
  .filter((topic) => topic.title.toLowerCase().includes(keywordLowerCase))
66
68
  .toArray();
67
69
 
68
70
  // Find messages with matching content or translate.content
69
- const matchingMessagesPromise = this.db.messages
71
+ const queryMessages = sessionId
72
+ ? this.db.messages.where('sessionId').equals(sessionId)
73
+ : this.db.messages;
74
+ const matchingMessagesPromise = queryMessages
70
75
  .filter((message) => {
71
76
  // check content
72
77
  if (message.content.toLowerCase().includes(keywordLowerCase)) return true;
@@ -204,16 +204,16 @@ describe('TopicService', () => {
204
204
  });
205
205
 
206
206
  describe('searchTopics', () => {
207
- it('should return topics that match the keyword', async () => {
207
+ it('should return all topics that match the keyword', async () => {
208
208
  // Setup
209
209
  const keyword = 'search';
210
210
  (TopicModel.queryByKeyword as Mock).mockResolvedValue(mockTopics);
211
211
 
212
212
  // Execute
213
- const result = await topicService.searchTopics(keyword);
213
+ const result = await topicService.searchTopics(keyword, undefined);
214
214
 
215
215
  // Assert
216
- expect(TopicModel.queryByKeyword).toHaveBeenCalledWith(keyword);
216
+ expect(TopicModel.queryByKeyword).toHaveBeenCalledWith(keyword, undefined);
217
217
  expect(result).toBe(mockTopics);
218
218
  });
219
219
  });
@@ -48,8 +48,8 @@ class TopicService {
48
48
  return TopicModel.queryAll();
49
49
  }
50
50
 
51
- async searchTopics(keyword: string) {
52
- return TopicModel.queryByKeyword(keyword);
51
+ async searchTopics(keyword: string, sessionId?: string) {
52
+ return TopicModel.queryByKeyword(keyword, sessionId);
53
53
  }
54
54
 
55
55
  async duplicateTopic(id: string, newTitle?: string) {
@@ -43,7 +43,7 @@ export interface ChatTopicAction {
43
43
  updateTopicLoading: (id?: string) => void;
44
44
  updateTopicTitle: (id: string, title: string) => Promise<void>;
45
45
  useFetchTopics: (sessionId: string) => SWRResponse<ChatTopic[]>;
46
- useSearchTopics: (keywords?: string) => SWRResponse<ChatTopic[]>;
46
+ useSearchTopics: (keywords?: string, sessionId?: string) => SWRResponse<ChatTopic[]>;
47
47
  }
48
48
 
49
49
  export const chatTopic: StateCreator<
@@ -154,10 +154,11 @@ export const chatTopic: StateCreator<
154
154
  },
155
155
  },
156
156
  ),
157
- useSearchTopics: (keywords) =>
157
+ useSearchTopics: (keywords, sessionId) =>
158
158
  useSWR<ChatTopic[]>(
159
- [SWR_USE_SEARCH_TOPIC, keywords],
160
- ([, keywords]: [string, string]) => topicService.searchTopics(keywords),
159
+ [SWR_USE_SEARCH_TOPIC, keywords, sessionId],
160
+ ([, keywords, sessionId]: [string, string, string]) =>
161
+ topicService.searchTopics(keywords, sessionId),
161
162
  {
162
163
  onSuccess: (data) => {
163
164
  set({ searchTopics: data }, false, n('useSearchTopics(success)', { keywords }));