@lobehub/chat 1.79.6 → 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 CHANGED
@@ -2,6 +2,31 @@
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
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 1.79.6](https://github.com/lobehub/lobe-chat/compare/v1.79.5...v1.79.6)
6
31
 
7
32
  <sup>Released on **2025-04-11**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
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
+ },
2
11
  {
3
12
  "children": {
4
13
  "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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.79.6",
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",
@@ -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
@@ -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
  }
@@ -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, {
@@ -1,8 +1,59 @@
1
- import { KeyMapEnum } from '@lobehub/ui/es/Hotkey';
2
-
3
1
  export const KeyEnum = {
4
- ...KeyMapEnum,
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 = {