@lobehub/chat 1.112.3 → 1.112.4
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 +25 -0
- package/changelog/v1.json +9 -0
- package/package.json +2 -1
- package/packages/prompts/package.json +9 -0
- package/{src/prompts → packages/prompts/src}/chatMessages/index.test.ts +1 -2
- package/{src/prompts → packages/prompts/src}/chatMessages/index.ts +1 -1
- package/{src/prompts → packages/prompts/src}/files/file.ts +1 -1
- package/{src/prompts → packages/prompts/src}/files/image.ts +1 -1
- package/{src/prompts → packages/prompts/src}/files/index.ts +1 -1
- package/packages/prompts/src/index.ts +5 -0
- package/{src/prompts → packages/prompts/src}/knowledgeBaseQA/chunk.ts +1 -1
- package/{src/prompts → packages/prompts/src}/knowledgeBaseQA/index.ts +5 -5
- package/{src/prompts → packages/prompts/src}/knowledgeBaseQA/knowledge.ts +1 -1
- package/{src/prompts → packages/prompts/src}/plugin/index.test.ts +1 -2
- package/packages/types/src/index.ts +3 -0
- package/packages/types/src/message/index.ts +1 -1
- package/src/chains/summaryHistory.ts +3 -2
- package/src/services/chat.ts +1 -2
- package/src/store/chat/slices/aiChat/actions/generateAIChat.ts +1 -1
- package/src/store/tool/selectors/tool.ts +1 -1
- /package/{src/prompts → packages/prompts/src}/files/index.test.ts +0 -0
- /package/{src/prompts → packages/prompts/src}/knowledgeBaseQA/__snapshots__/index.test.ts.snap +0 -0
- /package/{src/prompts → packages/prompts/src}/knowledgeBaseQA/index.test.ts +0 -0
- /package/{src/prompts → packages/prompts/src}/knowledgeBaseQA/userQuery.ts +0 -0
- /package/{src/prompts → packages/prompts/src}/plugin/index.ts +0 -0
- /package/{src/prompts → packages/prompts/src}/plugin/tools.test.ts +0 -0
- /package/{src/prompts → packages/prompts/src}/plugin/tools.ts +0 -0
- /package/{src/prompts → packages/prompts/src}/systemRole/index.ts +0 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.112.4](https://github.com/lobehub/lobe-chat/compare/v1.112.3...v1.112.4)
|
6
|
+
|
7
|
+
<sup>Released on **2025-08-16**</sup>
|
8
|
+
|
9
|
+
#### ♻ Code Refactoring
|
10
|
+
|
11
|
+
- **misc**: Refactor prompts folder to the `@lobechat/prompts` pacakge.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Code refactoring
|
19
|
+
|
20
|
+
- **misc**: Refactor prompts folder to the `@lobechat/prompts` pacakge, closes [#8810](https://github.com/lobehub/lobe-chat/issues/8810) ([d82e7bb](https://github.com/lobehub/lobe-chat/commit/d82e7bb))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
5
30
|
### [Version 1.112.3](https://github.com/lobehub/lobe-chat/compare/v1.112.2...v1.112.3)
|
6
31
|
|
7
32
|
<sup>Released on **2025-08-16**</sup>
|
package/changelog/v1.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.112.
|
3
|
+
"version": "1.112.4",
|
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",
|
@@ -145,6 +145,7 @@
|
|
145
145
|
"@lobechat/electron-server-ipc": "workspace:*",
|
146
146
|
"@lobechat/file-loaders": "workspace:*",
|
147
147
|
"@lobechat/model-runtime": "workspace:*",
|
148
|
+
"@lobechat/prompts": "workspace:*",
|
148
149
|
"@lobechat/web-crawler": "workspace:*",
|
149
150
|
"@lobehub/analytics": "^1.6.0",
|
150
151
|
"@lobehub/charts": "^2.0.0",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ChatSemanticSearchChunk } from '
|
1
|
+
import { ChatSemanticSearchChunk } from '@lobechat/types';
|
2
2
|
|
3
3
|
const chunkPrompt = (item: ChatSemanticSearchChunk) =>
|
4
4
|
`<chunk fileId="${item.fileId}" fileName="${item.fileName}" similarity="${item.similarity}" ${item.pageNumber ? ` pageNumber="${item.pageNumber}" ` : ''}>${item.text}</chunk>`;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
1
|
+
import { ChatSemanticSearchChunk, KnowledgeItem } from '@lobechat/types';
|
2
|
+
|
3
|
+
import { chunkPrompts } from './chunk';
|
4
|
+
import { knowledgePrompts } from './knowledge';
|
5
|
+
import { userQueryPrompt } from './userQuery';
|
6
6
|
|
7
7
|
export const knowledgeBaseQAPrompts = ({
|
8
8
|
chunks,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { KnowledgeItem } from '
|
1
|
+
import { KnowledgeItem } from '@lobechat/types';
|
2
2
|
|
3
3
|
const knowledgePrompt = (item: KnowledgeItem) =>
|
4
4
|
`<knowledge id="${item.id}" name="${item.name}" type="${item.type}"${item.fileType ? ` fileType="${item.fileType}" ` : ''}>${item.description || ''}</knowledge>`;
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { chatHistoryPrompts } from '
|
2
|
-
import { ChatMessage } from '
|
1
|
+
import { chatHistoryPrompts } from '@lobechat/prompts';
|
2
|
+
import { ChatMessage } from '@lobechat/types';
|
3
|
+
|
3
4
|
import { ChatStreamPayload } from '@/types/openai/chat';
|
4
5
|
|
5
6
|
export const chainSummaryHistory = (messages: ChatMessage[]): Partial<ChatStreamPayload> => ({
|
package/src/services/chat.ts
CHANGED
@@ -4,6 +4,7 @@ import {
|
|
4
4
|
ModelProvider,
|
5
5
|
ModelRuntime,
|
6
6
|
} from '@lobechat/model-runtime';
|
7
|
+
import { BuiltinSystemRolePrompts, filesPrompts } from '@lobechat/prompts';
|
7
8
|
import { ChatErrorType, TracePayload, TraceTagMap } from '@lobechat/types';
|
8
9
|
import { PluginRequestPayload, createHeadersWithPluginSettings } from '@lobehub/chat-plugin-sdk';
|
9
10
|
import { produce } from 'immer';
|
@@ -15,8 +16,6 @@ import { INBOX_SESSION_ID } from '@/const/session';
|
|
15
16
|
import { DEFAULT_AGENT_CONFIG } from '@/const/settings';
|
16
17
|
import { isDeprecatedEdition, isDesktop, isServerMode } from '@/const/version';
|
17
18
|
import { parseDataUri } from '@/libs/model-runtime/utils/uriParser';
|
18
|
-
import { filesPrompts } from '@/prompts/files';
|
19
|
-
import { BuiltinSystemRolePrompts } from '@/prompts/systemRole';
|
20
19
|
import { getAgentStoreState } from '@/store/agent';
|
21
20
|
import { agentChatConfigSelectors } from '@/store/agent/selectors';
|
22
21
|
import { aiModelSelectors, aiProviderSelectors, getAiInfraStoreState } from '@/store/aiInfra';
|
@@ -1,5 +1,6 @@
|
|
1
1
|
/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
|
2
2
|
// Disable the auto sort key eslint rule to make the code more logic and readable
|
3
|
+
import { knowledgeBaseQAPrompts } from '@lobechat/prompts';
|
3
4
|
import { TraceEventType, TraceNameMap } from '@lobechat/types';
|
4
5
|
import { t } from 'i18next';
|
5
6
|
import { produce } from 'immer';
|
@@ -8,7 +9,6 @@ import { StateCreator } from 'zustand/vanilla';
|
|
8
9
|
|
9
10
|
import { LOADING_FLAT, MESSAGE_CANCEL_FLAT } from '@/const/message';
|
10
11
|
import { isDesktop, isServerMode } from '@/const/version';
|
11
|
-
import { knowledgeBaseQAPrompts } from '@/prompts/knowledgeBaseQA';
|
12
12
|
import { chatService } from '@/services/chat';
|
13
13
|
import { messageService } from '@/services/message';
|
14
14
|
import { useAgentStore } from '@/store/agent';
|
@@ -1,6 +1,6 @@
|
|
1
|
+
import { pluginPrompts } from '@lobechat/prompts';
|
1
2
|
import { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk';
|
2
3
|
|
3
|
-
import { pluginPrompts } from '@/prompts/plugin';
|
4
4
|
import { MetaData } from '@/types/meta';
|
5
5
|
import { ChatCompletionTool } from '@/types/openai/chat';
|
6
6
|
import { LobeToolMeta } from '@/types/tool/tool';
|
File without changes
|
/package/{src/prompts → packages/prompts/src}/knowledgeBaseQA/__snapshots__/index.test.ts.snap
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|