@lobehub/chat 1.79.5 → 1.79.7
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 +50 -0
- package/changelog/v1.json +18 -0
- package/docs/self-hosting/advanced/online-search.mdx +63 -0
- package/docs/self-hosting/advanced/online-search.zh-CN.mdx +59 -0
- package/package.json +2 -2
- package/src/const/hotkeys.ts +2 -2
- package/src/const/trace.ts +1 -0
- package/src/libs/agent-runtime/xai/index.ts +10 -0
- package/src/store/chat/slices/aiChat/actions/memory.ts +6 -1
- package/src/types/hotkey.ts +54 -3
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.79.7](https://github.com/lobehub/lobe-chat/compare/v1.79.6...v1.79.7)
|
6
|
+
|
7
|
+
<sup>Released on **2025-04-11**</sup>
|
8
|
+
|
9
|
+
#### ♻ Code Refactoring
|
10
|
+
|
11
|
+
- **misc**: Refactor hotkey import to avoid db generate error.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Code refactoring
|
19
|
+
|
20
|
+
- **misc**: Refactor hotkey import to avoid db generate error, closes [#7374](https://github.com/lobehub/lobe-chat/issues/7374) ([b91e4c2](https://github.com/lobehub/lobe-chat/commit/b91e4c2))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.79.6](https://github.com/lobehub/lobe-chat/compare/v1.79.5...v1.79.6)
|
31
|
+
|
32
|
+
<sup>Released on **2025-04-11**</sup>
|
33
|
+
|
34
|
+
#### 🐛 Bug Fixes
|
35
|
+
|
36
|
+
- **misc**: Fix `grok-3-mini` series calling.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### What's fixed
|
44
|
+
|
45
|
+
- **misc**: Fix `grok-3-mini` series calling, closes [#7371](https://github.com/lobehub/lobe-chat/issues/7371) ([523c605](https://github.com/lobehub/lobe-chat/commit/523c605))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.79.5](https://github.com/lobehub/lobe-chat/compare/v1.79.4...v1.79.5)
|
6
56
|
|
7
57
|
<sup>Released on **2025-04-10**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"improvements": [
|
5
|
+
"Refactor hotkey import to avoid db generate error."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-04-11",
|
9
|
+
"version": "1.79.7"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {
|
13
|
+
"fixes": [
|
14
|
+
"Fix grok-3-mini series calling."
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"date": "2025-04-11",
|
18
|
+
"version": "1.79.6"
|
19
|
+
},
|
2
20
|
{
|
3
21
|
"children": {
|
4
22
|
"fixes": [
|
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
title: >-
|
3
|
+
Configuring Online Search Functionality - Enhancing AI's Ability to Access Web
|
4
|
+
Information
|
5
|
+
description: >-
|
6
|
+
Learn how to configure the SearXNG online search functionality for LobeChat,
|
7
|
+
enabling AI to access the latest web information.
|
8
|
+
tags:
|
9
|
+
- Online Search
|
10
|
+
- SearXNG
|
11
|
+
- Web Information
|
12
|
+
- AI Enhancement
|
13
|
+
---
|
14
|
+
|
15
|
+
# Configuring Online Search Functionality
|
16
|
+
|
17
|
+
LobeChat supports configuring online search functionality for AI, allowing it to access the latest web information and provide more accurate and timely responses. The online search feature is based on the [SearXNG](https://github.com/searxng/searxng) search engine, which is a privacy-respecting metasearch engine that aggregates results from multiple search engines.
|
18
|
+
|
19
|
+
<Callout type={'info'}>
|
20
|
+
SearXNG is an open-source metasearch engine that can be self-hosted or accessed via public instances. By configuring SearXNG, LobeChat enables AI to retrieve the latest internet information, allowing it to answer time-sensitive questions and provide up-to-date news.
|
21
|
+
</Callout>
|
22
|
+
|
23
|
+
# Core Environment Variables
|
24
|
+
|
25
|
+
## `SEARXNG_URL`
|
26
|
+
|
27
|
+
The URL of the SearXNG instance, which is a necessary configuration to enable the online search functionality. For example:
|
28
|
+
|
29
|
+
```shell
|
30
|
+
SEARXNG_URL=https://searxng-instance.com
|
31
|
+
```
|
32
|
+
|
33
|
+
This URL should point to a functional SearXNG instance. You can choose to self-host SearXNG or use a publicly available SearXNG instance.
|
34
|
+
|
35
|
+
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 LobeChat.
|
36
|
+
|
37
|
+
> Note that the `searxng` you use must have `json` output enabled; otherwise, the `lobe-chat` call will result in an error.
|
38
|
+
> If self-hosting, find the `searxng` configuration file and add `json` as shown below.
|
39
|
+
|
40
|
+
```bash
|
41
|
+
$ vi searxng/settings.yml
|
42
|
+
...
|
43
|
+
search:
|
44
|
+
formats:
|
45
|
+
- html
|
46
|
+
- json
|
47
|
+
```
|
48
|
+
|
49
|
+
# Verifying Online Search Functionality
|
50
|
+
|
51
|
+
After configuration, you can verify whether the online search functionality is working correctly by following these steps:
|
52
|
+
|
53
|
+
1. Restart the LobeChat service.
|
54
|
+
2. Start a new chat session, enable smart online search, and then ask AI a question that requires the latest information, such as "What is the current gold price today?" or "What are the latest major news stories?"
|
55
|
+
3. Observe whether AI can return the latest information based on internet searches.
|
56
|
+
|
57
|
+
If AI can answer these time-sensitive questions, it indicates that the online search functionality has been successfully configured.
|
58
|
+
|
59
|
+
## References
|
60
|
+
|
61
|
+
- [LobeChat Online Search RFC Discussion](https://github.com/lobehub/lobe-chat/discussions/6447)
|
62
|
+
- [SearXNG GitHub Repository](https://github.com/searxng/searxng)
|
63
|
+
- [Discussion on Enabling JSON Output for SearXNG](https://github.com/searxng/searxng/discussions/3542)
|
@@ -0,0 +1,59 @@
|
|
1
|
+
---
|
2
|
+
title: 配置联网搜索功能 - 增强 AI 的网络信息获取能力
|
3
|
+
description: 了解如何为 LobeChat 配置 SearXNG 联网搜索功能,使 AI 能够获取最新的网络信息。
|
4
|
+
tags:
|
5
|
+
- 联网搜索
|
6
|
+
- SearXNG
|
7
|
+
- 网络信息
|
8
|
+
- AI 增强
|
9
|
+
---
|
10
|
+
|
11
|
+
# 配置联网搜索功能
|
12
|
+
|
13
|
+
LobeChat 支持为 AI 配置联网搜索功能,这使得 AI 能够获取最新的网络信息,从而提供更准确、更及时的回答。联网搜索功能基于 [SearXNG](https://github.com/searxng/searxng) 搜索引擎,它是一个尊重隐私的元搜索引擎,可以聚合多个搜索引擎的结果。
|
14
|
+
|
15
|
+
<Callout type={'info'}>
|
16
|
+
SearXNG 是一个开源的元搜索引擎,可以自行部署,也可以使用公共实例。通过配置 SearXNG,LobeChat 可以让 AI 获取最新的互联网信息,从而回答时效性问题、提供最新资讯。
|
17
|
+
</Callout>
|
18
|
+
|
19
|
+
# 核心环境变量
|
20
|
+
|
21
|
+
## `SEARXNG_URL`
|
22
|
+
|
23
|
+
SearXNG 实例的 URL 地址,这是启用联网搜索功能的必要配置。例如:
|
24
|
+
|
25
|
+
```shell
|
26
|
+
SEARXNG_URL=https://searxng-instance.com
|
27
|
+
```
|
28
|
+
|
29
|
+
这个 URL 应该指向一个可用的 SearXNG 实例。您可以选择自行部署 SearXNG,或使用公共可用的 SearXNG 实例。
|
30
|
+
|
31
|
+
您可以在 [SearXNG 实例列表](https://searx.space/) 中找到公开可用的 SearXNG 实例。选择一个响应速度快、可靠性高的实例,然后将其 URL 配置到 LobeChat 中。
|
32
|
+
|
33
|
+
> 注意,使用的 `searxng` 必须开启 `json` 输出,否则 `lobe-chat` 调用会报错。
|
34
|
+
> 如果是自托管,类似下面这样,找到 `searxng` 的配置文件,追加 `json` 即可。
|
35
|
+
|
36
|
+
```bash
|
37
|
+
$ vi searxng/settings.yml
|
38
|
+
...
|
39
|
+
search:
|
40
|
+
formats:
|
41
|
+
- html
|
42
|
+
- json
|
43
|
+
```
|
44
|
+
|
45
|
+
# 验证联网搜索功能
|
46
|
+
|
47
|
+
配置完成后,您可以通过以下步骤验证联网搜索功能是否正常工作:
|
48
|
+
|
49
|
+
1. 重启 LobeChat 服务
|
50
|
+
2. 启动一个新的聊天,启动智能联网,之后向 AI 提问一个需要最新信息的问题,例如:"今天的实时金价是多少?"或"最近的重大新闻有哪些?"
|
51
|
+
3. 观察 AI 是否能够返回基于互联网搜索的最新信息
|
52
|
+
|
53
|
+
如果 AI 能够回答这些时效性问题,说明联网搜索功能已经成功配置。
|
54
|
+
|
55
|
+
## 参考资料
|
56
|
+
|
57
|
+
- [LobeChat 联网搜索 RFC 讨论](https://github.com/lobehub/lobe-chat/discussions/6447)
|
58
|
+
- [SearXNG GitHub 仓库](https://github.com/searxng/searxng)
|
59
|
+
- [SearXNG 开启 json 输出的讨论](https://github.com/searxng/searxng/discussions/3542)
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.79.
|
3
|
+
"version": "1.79.7",
|
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",
|
@@ -33,7 +33,7 @@
|
|
33
33
|
"postbuild": "npm run build-sitemap && npm run build-migrate-db",
|
34
34
|
"build-migrate-db": "bun run db:migrate",
|
35
35
|
"build-sitemap": "tsx ./scripts/buildSitemapIndex/index.ts",
|
36
|
-
"build:analyze": "ANALYZE=true next build",
|
36
|
+
"build:analyze": "NODE_OPTIONS=--max-old-space-size=6144 ANALYZE=true next build",
|
37
37
|
"build:docker": "DOCKER=true next build && npm run build-sitemap",
|
38
38
|
"prebuild:electron": "cross-env NEXT_PUBLIC_IS_DESKTOP_APP=1 tsx scripts/prebuild.mts",
|
39
39
|
"build:electron": "cross-env NODE_OPTIONS=--max-old-space-size=6144 NEXT_PUBLIC_IS_DESKTOP_APP=1 NEXT_PUBLIC_SERVICE_MODE=server next build",
|
package/src/const/hotkeys.ts
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import { combineKeys } from '@lobehub/ui/es/Hotkey';
|
2
|
-
|
3
1
|
import {
|
4
2
|
HotkeyEnum,
|
5
3
|
HotkeyGroupEnum,
|
@@ -8,6 +6,8 @@ import {
|
|
8
6
|
KeyEnum,
|
9
7
|
} from '@/types/hotkey';
|
10
8
|
|
9
|
+
const combineKeys = (keys: string[]) => keys.join('+');
|
10
|
+
|
11
11
|
// mod 在 Mac 上是 command 键,alt 在 Win 上是 ctrl 键
|
12
12
|
export const HOTKEYS_REGISTRATION: HotkeyRegistration = [
|
13
13
|
// basic
|
package/src/const/trace.ts
CHANGED
@@ -12,6 +12,7 @@ export enum TraceNameMap {
|
|
12
12
|
SummaryAgentDescription = 'Summary Agent Description',
|
13
13
|
SummaryAgentTags = 'Summary Agent Tags',
|
14
14
|
SummaryAgentTitle = 'Summary Agent Title',
|
15
|
+
SummaryHistoryMessages = 'Summary History Messages',
|
15
16
|
SummaryTopicTitle = 'Summary Topic Title',
|
16
17
|
Translator = 'Translator',
|
17
18
|
}
|
@@ -12,6 +12,16 @@ export const LobeXAI = LobeOpenAICompatibleFactory({
|
|
12
12
|
chatCompletion: {
|
13
13
|
// xAI API does not support stream_options: { include_usage: true }
|
14
14
|
excludeUsage: true,
|
15
|
+
handlePayload: (payload) => {
|
16
|
+
const { frequency_penalty, model, presence_penalty, ...rest } = payload;
|
17
|
+
|
18
|
+
return {
|
19
|
+
...rest,
|
20
|
+
frequency_penalty: model.includes('grok-3-mini') ? undefined : frequency_penalty,
|
21
|
+
model,
|
22
|
+
presence_penalty: model.includes('grok-3-mini') ? undefined : presence_penalty,
|
23
|
+
} as any;
|
24
|
+
},
|
15
25
|
},
|
16
26
|
debug: {
|
17
27
|
chatCompletion: () => process.env.DEBUG_XAI_CHAT_COMPLETION === '1',
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { StateCreator } from 'zustand/vanilla';
|
2
2
|
|
3
3
|
import { chainSummaryHistory } from '@/chains/summaryHistory';
|
4
|
+
import { TraceNameMap } from '@/const/trace';
|
4
5
|
import { chatService } from '@/services/chat';
|
5
6
|
import { topicService } from '@/services/topic';
|
6
7
|
import { ChatStore } from '@/store/chat';
|
@@ -29,8 +30,12 @@ export const chatMemory: StateCreator<
|
|
29
30
|
onFinish: async (text) => {
|
30
31
|
historySummary = text;
|
31
32
|
},
|
32
|
-
|
33
33
|
params: { ...chainSummaryHistory(messages), model, provider, stream: false },
|
34
|
+
trace: {
|
35
|
+
sessionId: get().activeId,
|
36
|
+
topicId: get().activeTopicId,
|
37
|
+
traceName: TraceNameMap.SummaryHistoryMessages,
|
38
|
+
},
|
34
39
|
});
|
35
40
|
|
36
41
|
await topicService.updateTopic(topicId, {
|
package/src/types/hotkey.ts
CHANGED
@@ -1,8 +1,59 @@
|
|
1
|
-
import { KeyMapEnum } from '@lobehub/ui/es/Hotkey';
|
2
|
-
|
3
1
|
export const KeyEnum = {
|
4
|
-
|
2
|
+
Alt: 'alt',
|
3
|
+
Backquote: 'backquote',
|
4
|
+
// `
|
5
|
+
Backslash: 'backslash',
|
6
|
+
// \
|
7
|
+
Backspace: 'backspace',
|
8
|
+
BracketLeft: 'bracketleft',
|
9
|
+
// [
|
10
|
+
BracketRight: 'bracketright',
|
11
|
+
// ]
|
12
|
+
Comma: 'comma',
|
13
|
+
// ,
|
14
|
+
Ctrl: 'ctrl',
|
15
|
+
Down: 'down',
|
16
|
+
Enter: 'enter',
|
17
|
+
Equal: 'equal',
|
18
|
+
// =
|
19
|
+
Esc: 'esc',
|
20
|
+
Left: 'left',
|
21
|
+
LeftClick: 'left-click',
|
22
|
+
LeftDoubleClick: 'left-double-click',
|
23
|
+
Meta: 'meta',
|
24
|
+
// Command on Mac, Win on Win
|
25
|
+
MiddleClick: 'middle-click',
|
26
|
+
Minus: 'minus',
|
27
|
+
// -
|
28
|
+
Mod: 'mod',
|
29
|
+
|
5
30
|
Number: '1-9',
|
31
|
+
|
32
|
+
// Command on Mac, Ctrl on Win
|
33
|
+
Period: 'period',
|
34
|
+
|
35
|
+
// .
|
36
|
+
Plus: 'equal',
|
37
|
+
|
38
|
+
// +
|
39
|
+
QuestionMark: 'slash',
|
40
|
+
|
41
|
+
// ?
|
42
|
+
Quote: 'quote',
|
43
|
+
// '
|
44
|
+
Right: 'right',
|
45
|
+
RightClick: 'right-click',
|
46
|
+
RightDoubleClick: 'right-double-click',
|
47
|
+
|
48
|
+
Semicolon: 'semicolon',
|
49
|
+
// ;
|
50
|
+
Shift: 'shift',
|
51
|
+
|
52
|
+
Slash: 'slash',
|
53
|
+
// /
|
54
|
+
Space: 'space',
|
55
|
+
Tab: 'tab',
|
56
|
+
Up: 'up',
|
6
57
|
} as const;
|
7
58
|
|
8
59
|
export const HotkeyEnum = {
|