@lobehub/chat 1.66.4 → 1.66.6
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/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/changelog/v1.json +18 -0
- package/package.json +6 -6
- package/src/app/[variants]/(main)/chat/(workspace)/_layout/Desktop/Portal.tsx +29 -30
- package/src/app/[variants]/(main)/chat/(workspace)/_layout/Desktop/TopicPanel.tsx +21 -23
- package/src/components/AnimatedCollapsed/index.tsx +59 -0
- package/src/config/aiModels/openai.ts +29 -5
- package/src/database/server/models/__tests__/message.test.ts +2 -2
- package/src/features/Conversation/Messages/Assistant/Tool/index.tsx +12 -27
- package/src/tools/web-browsing/Portal/ResultList/index.tsx +1 -1
- package/src/tools/web-browsing/Portal/index.tsx +30 -18
- package/src/tools/web-browsing/Render/SearchResult/SearchResultItem.tsx +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.66.6](https://github.com/lobehub/lobe-chat/compare/v1.66.5...v1.66.6)
|
6
|
+
|
7
|
+
<sup>Released on **2025-03-02**</sup>
|
8
|
+
|
9
|
+
#### 💄 Styles
|
10
|
+
|
11
|
+
- **misc**: Add `gpt-4.5-preview` for OpenAI.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Styles
|
19
|
+
|
20
|
+
- **misc**: Add `gpt-4.5-preview` for OpenAI, closes [#6618](https://github.com/lobehub/lobe-chat/issues/6618) ([3ec3af0](https://github.com/lobehub/lobe-chat/commit/3ec3af0))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.66.5](https://github.com/lobehub/lobe-chat/compare/v1.66.4...v1.66.5)
|
31
|
+
|
32
|
+
<sup>Released on **2025-02-28**</sup>
|
33
|
+
|
34
|
+
#### 💄 Styles
|
35
|
+
|
36
|
+
- **misc**: Improve portal style.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### Styles
|
44
|
+
|
45
|
+
- **misc**: Improve portal style, closes [#6588](https://github.com/lobehub/lobe-chat/issues/6588) ([55b5416](https://github.com/lobehub/lobe-chat/commit/55b5416))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.66.4](https://github.com/lobehub/lobe-chat/compare/v1.66.3...v1.66.4)
|
6
56
|
|
7
57
|
<sup>Released on **2025-02-28**</sup>
|
package/README.md
CHANGED
@@ -329,7 +329,7 @@ In addition, these plugins are not limited to news aggregation, but can also ext
|
|
329
329
|
| [Bing_websearch](https://lobechat.com/discover/plugin/Bingsearch-identifier)<br/><sup>By **FineHow** on **2024-12-22**</sup> | Search for information from the internet base BingApi<br/>`bingsearch` |
|
330
330
|
| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)<br/><sup>By **portfoliometa** on **2024-12-22**</sup> | Analyze stocks and get comprehensive real-time investment data and analytics.<br/>`stock` |
|
331
331
|
|
332
|
-
> 📊 Total plugins: [<kbd>**
|
332
|
+
> 📊 Total plugins: [<kbd>**47**</kbd>](https://lobechat.com/discover/plugins)
|
333
333
|
|
334
334
|
<!-- PLUGIN LIST -->
|
335
335
|
|
package/README.zh-CN.md
CHANGED
@@ -322,7 +322,7 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
322
322
|
| [必应网页搜索](https://lobechat.com/discover/plugin/Bingsearch-identifier)<br/><sup>By **FineHow** on **2024-12-22**</sup> | 通过 BingApi 搜索互联网上的信息<br/>`bingsearch` |
|
323
323
|
| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)<br/><sup>By **portfoliometa** on **2024-12-22**</sup> | 分析股票并获取全面的实时投资数据和分析。<br/>`股票` |
|
324
324
|
|
325
|
-
> 📊 Total plugins: [<kbd>**
|
325
|
+
> 📊 Total plugins: [<kbd>**47**</kbd>](https://lobechat.com/discover/plugins)
|
326
326
|
|
327
327
|
<!-- PLUGIN LIST -->
|
328
328
|
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"improvements": [
|
5
|
+
"Add gpt-4.5-preview for OpenAI."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-03-02",
|
9
|
+
"version": "1.66.6"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {
|
13
|
+
"improvements": [
|
14
|
+
"Improve portal style."
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"date": "2025-02-28",
|
18
|
+
"version": "1.66.5"
|
19
|
+
},
|
2
20
|
{
|
3
21
|
"children": {
|
4
22
|
"improvements": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.66.
|
3
|
+
"version": "1.66.6",
|
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",
|
@@ -105,7 +105,7 @@
|
|
105
105
|
"@ant-design/icons": "^5.5.2",
|
106
106
|
"@ant-design/pro-components": "^2.8.3",
|
107
107
|
"@anthropic-ai/sdk": "^0.37.0",
|
108
|
-
"@auth/core": "^0.
|
108
|
+
"@auth/core": "^0.38.0",
|
109
109
|
"@aws-sdk/client-bedrock-runtime": "^3.723.0",
|
110
110
|
"@aws-sdk/client-s3": "^3.723.0",
|
111
111
|
"@aws-sdk/s3-request-presigner": "^3.723.0",
|
@@ -156,7 +156,7 @@
|
|
156
156
|
"debug": "^4.4.0",
|
157
157
|
"dexie": "^3.2.7",
|
158
158
|
"diff": "^7.0.0",
|
159
|
-
"drizzle-orm": "^0.
|
159
|
+
"drizzle-orm": "^0.40.0",
|
160
160
|
"drizzle-zod": "^0.5.1",
|
161
161
|
"fast-deep-equal": "^3.1.3",
|
162
162
|
"file-type": "^20.0.0",
|
@@ -174,7 +174,7 @@
|
|
174
174
|
"langfuse": "3.29.1",
|
175
175
|
"langfuse-core": "3.29.1",
|
176
176
|
"lodash-es": "^4.17.21",
|
177
|
-
"lucide-react": "^0.
|
177
|
+
"lucide-react": "^0.477.0",
|
178
178
|
"mammoth": "^1.9.0",
|
179
179
|
"mdast-util-to-markdown": "^2.1.2",
|
180
180
|
"modern-screenshot": "^4.5.5",
|
@@ -210,7 +210,7 @@
|
|
210
210
|
"react-lazy-load": "^4.0.1",
|
211
211
|
"react-pdf": "^9.2.1",
|
212
212
|
"react-rnd": "^10.4.14",
|
213
|
-
"react-scan": "^0.
|
213
|
+
"react-scan": "^0.2.0",
|
214
214
|
"react-virtuoso": "^4.12.3",
|
215
215
|
"react-wrap-balancer": "^1.1.1",
|
216
216
|
"remark": "^15.0.1",
|
@@ -320,7 +320,7 @@
|
|
320
320
|
"vitest": "~1.2.2",
|
321
321
|
"vitest-canvas-mock": "^0.3.3"
|
322
322
|
},
|
323
|
-
"packageManager": "pnpm@9.15.
|
323
|
+
"packageManager": "pnpm@9.15.6",
|
324
324
|
"publishConfig": {
|
325
325
|
"access": "public",
|
326
326
|
"registry": "https://registry.npmjs.org"
|
@@ -25,6 +25,7 @@ const useStyles = createStyles(({ css, token, isDarkMode }) => ({
|
|
25
25
|
`,
|
26
26
|
drawer: css`
|
27
27
|
z-index: 10;
|
28
|
+
height: 100%;
|
28
29
|
background: ${token.colorBgLayout};
|
29
30
|
`,
|
30
31
|
header: css`
|
@@ -71,38 +72,36 @@ const PortalPanel = memo(({ children }: PropsWithChildren) => {
|
|
71
72
|
};
|
72
73
|
|
73
74
|
return (
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
75
|
+
<DraggablePanel
|
76
|
+
className={styles.drawer}
|
77
|
+
classNames={{
|
78
|
+
content: styles.content,
|
79
|
+
}}
|
80
|
+
defaultSize={{ width: tmpWidth }}
|
81
|
+
expand={showInspector}
|
82
|
+
hanlderStyle={{ display: 'none' }}
|
83
|
+
maxWidth={CHAT_PORTAL_MAX_WIDTH}
|
84
|
+
minWidth={
|
85
|
+
showArtifactUI || showToolUI || showThread ? CHAT_PORTAL_TOOL_UI_WIDTH : CHAT_PORTAL_WIDTH
|
86
|
+
}
|
87
|
+
mode={md ? 'fixed' : 'float'}
|
88
|
+
onSizeChange={handleSizeChange}
|
89
|
+
placement={'right'}
|
90
|
+
showHandlerWhenUnexpand={false}
|
91
|
+
showHandlerWideArea={false}
|
92
|
+
size={{ height: '100%', width: portalWidth }}
|
93
|
+
>
|
94
|
+
<DraggablePanelContainer
|
95
|
+
style={{
|
96
|
+
flex: 'none',
|
97
|
+
height: '100%',
|
98
|
+
maxHeight: '100vh',
|
99
|
+
minWidth: CHAT_PORTAL_WIDTH,
|
79
100
|
}}
|
80
|
-
defaultSize={{ width: tmpWidth }}
|
81
|
-
expand
|
82
|
-
hanlderStyle={{ display: 'none' }}
|
83
|
-
maxWidth={CHAT_PORTAL_MAX_WIDTH}
|
84
|
-
minWidth={
|
85
|
-
showArtifactUI || showToolUI || showThread ? CHAT_PORTAL_TOOL_UI_WIDTH : CHAT_PORTAL_WIDTH
|
86
|
-
}
|
87
|
-
mode={md ? 'fixed' : 'float'}
|
88
|
-
onSizeChange={handleSizeChange}
|
89
|
-
placement={'right'}
|
90
|
-
showHandlerWhenUnexpand={false}
|
91
|
-
showHandlerWideArea={false}
|
92
|
-
size={{ height: '100%', width: portalWidth }}
|
93
101
|
>
|
94
|
-
<
|
95
|
-
|
96
|
-
|
97
|
-
height: '100%',
|
98
|
-
maxHeight: '100vh',
|
99
|
-
minWidth: CHAT_PORTAL_WIDTH,
|
100
|
-
}}
|
101
|
-
>
|
102
|
-
<Flexbox className={cx(styles.panel, showThread && styles.thread)}>{children}</Flexbox>
|
103
|
-
</DraggablePanelContainer>
|
104
|
-
</DraggablePanel>
|
105
|
-
)
|
102
|
+
<Flexbox className={cx(styles.panel, showThread && styles.thread)}>{children}</Flexbox>
|
103
|
+
</DraggablePanelContainer>
|
104
|
+
</DraggablePanel>
|
106
105
|
);
|
107
106
|
});
|
108
107
|
|
@@ -49,31 +49,29 @@ const TopicPanel = memo(({ children }: PropsWithChildren) => {
|
|
49
49
|
}, [lg, cacheExpand]);
|
50
50
|
|
51
51
|
return (
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
52
|
+
<DraggablePanel
|
53
|
+
className={styles.drawer}
|
54
|
+
classNames={{
|
55
|
+
content: styles.content,
|
56
|
+
}}
|
57
|
+
expand={showTopic && !showPortal}
|
58
|
+
minWidth={CHAT_SIDEBAR_WIDTH}
|
59
|
+
mode={md ? 'fixed' : 'float'}
|
60
|
+
onExpandChange={handleExpand}
|
61
|
+
placement={'right'}
|
62
|
+
showHandlerWideArea={false}
|
63
|
+
>
|
64
|
+
<DraggablePanelContainer
|
65
|
+
style={{
|
66
|
+
flex: 'none',
|
67
|
+
height: '100%',
|
68
|
+
maxHeight: '100vh',
|
69
|
+
minWidth: CHAT_SIDEBAR_WIDTH,
|
57
70
|
}}
|
58
|
-
expand={showTopic}
|
59
|
-
minWidth={CHAT_SIDEBAR_WIDTH}
|
60
|
-
mode={md ? 'fixed' : 'float'}
|
61
|
-
onExpandChange={handleExpand}
|
62
|
-
placement={'right'}
|
63
|
-
showHandlerWideArea={false}
|
64
71
|
>
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
height: '100%',
|
69
|
-
maxHeight: '100vh',
|
70
|
-
minWidth: CHAT_SIDEBAR_WIDTH,
|
71
|
-
}}
|
72
|
-
>
|
73
|
-
{children}
|
74
|
-
</DraggablePanelContainer>
|
75
|
-
</DraggablePanel>
|
76
|
-
)
|
72
|
+
{children}
|
73
|
+
</DraggablePanelContainer>
|
74
|
+
</DraggablePanel>
|
77
75
|
);
|
78
76
|
});
|
79
77
|
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
2
|
+
import { CSSProperties, ReactNode, memo } from 'react';
|
3
|
+
|
4
|
+
interface AnimatedCollapsedProps {
|
5
|
+
children: ReactNode;
|
6
|
+
height?: {
|
7
|
+
collapsed?: string | number;
|
8
|
+
open?: string | number;
|
9
|
+
};
|
10
|
+
open: boolean;
|
11
|
+
style?: CSSProperties;
|
12
|
+
styles?: {
|
13
|
+
collapsed?: CSSProperties;
|
14
|
+
open?: CSSProperties;
|
15
|
+
};
|
16
|
+
width?: {
|
17
|
+
collapsed?: string | number;
|
18
|
+
open?: string | number;
|
19
|
+
};
|
20
|
+
}
|
21
|
+
|
22
|
+
const AnimatedCollapsed = memo<AnimatedCollapsedProps>(
|
23
|
+
({ open, children, styles, style, width, height }) => {
|
24
|
+
return (
|
25
|
+
<AnimatePresence initial={false}>
|
26
|
+
{open && (
|
27
|
+
<motion.div
|
28
|
+
animate="open"
|
29
|
+
exit="collapsed"
|
30
|
+
initial="collapsed"
|
31
|
+
style={style}
|
32
|
+
transition={{
|
33
|
+
duration: 0.2,
|
34
|
+
ease: [0.4, 0, 0.2, 1], // 使用 ease-out 缓动函数
|
35
|
+
}}
|
36
|
+
variants={{
|
37
|
+
collapsed: {
|
38
|
+
...(styles?.collapsed as any),
|
39
|
+
height: height?.collapsed ?? 0,
|
40
|
+
opacity: 0,
|
41
|
+
width: width?.collapsed ?? 0,
|
42
|
+
},
|
43
|
+
open: {
|
44
|
+
...(styles?.open as any),
|
45
|
+
height: height?.open ?? 'auto',
|
46
|
+
opacity: 1,
|
47
|
+
width: width?.open ?? 'auto',
|
48
|
+
},
|
49
|
+
}}
|
50
|
+
>
|
51
|
+
{children}
|
52
|
+
</motion.div>
|
53
|
+
)}
|
54
|
+
</AnimatePresence>
|
55
|
+
);
|
56
|
+
},
|
57
|
+
);
|
58
|
+
|
59
|
+
export default AnimatedCollapsed;
|
@@ -21,6 +21,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
21
21
|
id: 'o3-mini',
|
22
22
|
maxOutput: 100_000,
|
23
23
|
pricing: {
|
24
|
+
cachedInput: 0.55,
|
24
25
|
input: 1.1,
|
25
26
|
output: 4.4,
|
26
27
|
},
|
@@ -39,6 +40,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
39
40
|
id: 'o1-mini',
|
40
41
|
maxOutput: 65_536,
|
41
42
|
pricing: {
|
43
|
+
cachedInput: 0.55,
|
42
44
|
input: 1.1,
|
43
45
|
output: 4.4,
|
44
46
|
},
|
@@ -58,6 +60,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
58
60
|
id: 'o1',
|
59
61
|
maxOutput: 100_000,
|
60
62
|
pricing: {
|
63
|
+
cachedInput: 7.5,
|
61
64
|
input: 15,
|
62
65
|
output: 60,
|
63
66
|
},
|
@@ -82,6 +85,26 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
82
85
|
releasedAt: '2024-09-12',
|
83
86
|
type: 'chat',
|
84
87
|
},
|
88
|
+
{
|
89
|
+
abilities: {
|
90
|
+
functionCall: true,
|
91
|
+
vision: true,
|
92
|
+
},
|
93
|
+
contextWindowTokens: 128_000,
|
94
|
+
description:
|
95
|
+
'GPT-4.5 的研究预览版,它是我们迄今为止最大、最强大的 GPT 模型。它拥有广泛的世界知识,并能更好地理解用户意图,使其在创造性任务和自主规划方面表现出色。GPT-4.5 可接受文本和图像输入,并生成文本输出(包括结构化输出)。支持关键的开发者功能,如函数调用、批量 API 和流式输出。在需要创造性、开放式思考和对话的任务(如写作、学习或探索新想法)中,GPT-4.5 表现尤为出色。知识截止日期为 2023 年 10 月。',
|
96
|
+
displayName: 'GPT-4.5 Preview',
|
97
|
+
enabled: true,
|
98
|
+
id: 'gpt-4.5-preview',
|
99
|
+
maxOutput: 16_384,
|
100
|
+
pricing: {
|
101
|
+
cachedInput: 37.5,
|
102
|
+
input: 75,
|
103
|
+
output: 150,
|
104
|
+
},
|
105
|
+
releasedAt: '2025-02-27',
|
106
|
+
type: 'chat',
|
107
|
+
},
|
85
108
|
{
|
86
109
|
abilities: {
|
87
110
|
functionCall: true,
|
@@ -93,8 +116,9 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
93
116
|
displayName: 'GPT-4o mini',
|
94
117
|
enabled: true,
|
95
118
|
id: 'gpt-4o-mini',
|
96
|
-
maxOutput:
|
119
|
+
maxOutput: 16_384,
|
97
120
|
pricing: {
|
121
|
+
cachedInput: 0.075,
|
98
122
|
input: 0.15,
|
99
123
|
output: 0.6,
|
100
124
|
},
|
@@ -110,7 +134,6 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
110
134
|
description:
|
111
135
|
'ChatGPT-4o 是一款动态模型,实时更新以保持当前最新版本。它结合了强大的语言理解与生成能力,适合于大规模应用场景,包括客户服务、教育和技术支持。',
|
112
136
|
displayName: 'GPT-4o 1120',
|
113
|
-
enabled: true,
|
114
137
|
id: 'gpt-4o-2024-11-20',
|
115
138
|
pricing: {
|
116
139
|
input: 2.5,
|
@@ -131,6 +154,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
131
154
|
enabled: true,
|
132
155
|
id: 'gpt-4o',
|
133
156
|
pricing: {
|
157
|
+
cachedInput: 1.25,
|
134
158
|
input: 2.5,
|
135
159
|
output: 10,
|
136
160
|
},
|
@@ -350,7 +374,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
350
374
|
abilities: {
|
351
375
|
functionCall: true,
|
352
376
|
},
|
353
|
-
contextWindowTokens:
|
377
|
+
contextWindowTokens: 16_384,
|
354
378
|
description:
|
355
379
|
'GPT 3.5 Turbo,适用于各种文本生成和理解任务,Currently points to gpt-3.5-turbo-0125',
|
356
380
|
displayName: 'GPT-3.5 Turbo',
|
@@ -365,7 +389,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
365
389
|
abilities: {
|
366
390
|
functionCall: true,
|
367
391
|
},
|
368
|
-
contextWindowTokens:
|
392
|
+
contextWindowTokens: 16_384,
|
369
393
|
description:
|
370
394
|
'GPT 3.5 Turbo,适用于各种文本生成和理解任务,Currently points to gpt-3.5-turbo-0125',
|
371
395
|
displayName: 'GPT-3.5 Turbo 0125',
|
@@ -381,7 +405,7 @@ export const openaiChatModels: AIChatModelCard[] = [
|
|
381
405
|
abilities: {
|
382
406
|
functionCall: true,
|
383
407
|
},
|
384
|
-
contextWindowTokens:
|
408
|
+
contextWindowTokens: 16_384,
|
385
409
|
description:
|
386
410
|
'GPT 3.5 Turbo,适用于各种文本生成和理解任务,Currently points to gpt-3.5-turbo-0125',
|
387
411
|
displayName: 'GPT-3.5 Turbo 1106',
|
@@ -1271,7 +1271,7 @@ describe('MessageModel', () => {
|
|
1271
1271
|
const result = await messageModel.getHeatmaps();
|
1272
1272
|
|
1273
1273
|
// 断言结果
|
1274
|
-
expect(result.length).
|
1274
|
+
expect(result.length).toBeGreaterThanOrEqual(366);
|
1275
1275
|
expect(result.length).toBeLessThan(368);
|
1276
1276
|
|
1277
1277
|
// 检查两天前的数据
|
@@ -1389,7 +1389,7 @@ describe('MessageModel', () => {
|
|
1389
1389
|
const result = await messageModel.getHeatmaps();
|
1390
1390
|
|
1391
1391
|
// 断言结果
|
1392
|
-
expect(result.length).
|
1392
|
+
expect(result.length).toBeGreaterThanOrEqual(366);
|
1393
1393
|
expect(result.length).toBeLessThan(368);
|
1394
1394
|
|
1395
1395
|
// 检查所有数据的 count 和 level 是否为 0
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import { AnimatePresence, motion } from 'framer-motion';
|
2
1
|
import { CSSProperties, memo, useState } from 'react';
|
3
2
|
import { Flexbox } from 'react-layout-kit';
|
4
3
|
|
4
|
+
import AnimatedCollapsed from '@/components/AnimatedCollapsed';
|
5
|
+
|
5
6
|
import Inspectors from './Inspector';
|
6
7
|
import Render from './Render';
|
7
8
|
|
@@ -36,32 +37,16 @@ const Tool = memo<InspectorProps>(
|
|
36
37
|
showPluginRender={showPluginRender}
|
37
38
|
showRender={showRender}
|
38
39
|
/>
|
39
|
-
<
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
variants={{
|
50
|
-
collapsed: { height: 0, opacity: 0, width: 0 },
|
51
|
-
open: { height: 'auto', opacity: 1, width: 'auto' },
|
52
|
-
}}
|
53
|
-
>
|
54
|
-
<Render
|
55
|
-
messageId={messageId}
|
56
|
-
requestArgs={requestArgs}
|
57
|
-
setShowPluginRender={setShowPluginRender}
|
58
|
-
showPluginRender={showPluginRender}
|
59
|
-
toolCallId={id}
|
60
|
-
toolIndex={index}
|
61
|
-
/>
|
62
|
-
</motion.div>
|
63
|
-
)}
|
64
|
-
</AnimatePresence>
|
40
|
+
<AnimatedCollapsed open={showRender}>
|
41
|
+
<Render
|
42
|
+
messageId={messageId}
|
43
|
+
requestArgs={requestArgs}
|
44
|
+
setShowPluginRender={setShowPluginRender}
|
45
|
+
showPluginRender={showPluginRender}
|
46
|
+
toolCallId={id}
|
47
|
+
toolIndex={index}
|
48
|
+
/>
|
49
|
+
</AnimatedCollapsed>
|
65
50
|
</Flexbox>
|
66
51
|
);
|
67
52
|
},
|
@@ -11,7 +11,7 @@ interface ResultListProps {
|
|
11
11
|
|
12
12
|
const ResultList = memo<ResultListProps>(({ dataSources }) => {
|
13
13
|
const itemContent = useCallback(
|
14
|
-
(index: number, result: SearchResult) => <Item {...result} highlight={index <
|
14
|
+
(index: number, result: SearchResult) => <Item {...result} highlight={index < 15} />,
|
15
15
|
[],
|
16
16
|
);
|
17
17
|
|
@@ -29,16 +29,17 @@ const Inspector = memo<InspectorUIProps<SearchArguments, SearchResponse>>(
|
|
29
29
|
const defaultEngines = engines.length > 0 ? engines : args.searchEngine || [];
|
30
30
|
const loading = useChatStore(chatToolSelectors.isSearXNGSearching(messageId));
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
<
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
32
|
+
if (loading) {
|
33
|
+
return (
|
34
|
+
<Flexbox gap={12} height={'100%'}>
|
35
|
+
<SearchBar
|
36
|
+
aiSummary={false}
|
37
|
+
defaultEngines={defaultEngines}
|
38
|
+
defaultQuery={args.query}
|
39
|
+
messageId={messageId}
|
40
|
+
tooltip={false}
|
41
|
+
/>
|
42
|
+
|
42
43
|
<Flexbox gap={16} paddingBlock={16} paddingInline={12}>
|
43
44
|
{[1, 2, 3, 4, 6].map((id) => (
|
44
45
|
<Skeleton
|
@@ -49,14 +50,25 @@ const Inspector = memo<InspectorUIProps<SearchArguments, SearchResponse>>(
|
|
49
50
|
/>
|
50
51
|
))}
|
51
52
|
</Flexbox>
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
53
|
+
</Flexbox>
|
54
|
+
);
|
55
|
+
}
|
56
|
+
|
57
|
+
return (
|
58
|
+
<Flexbox gap={0} height={'100%'}>
|
59
|
+
<Flexbox gap={12} height={'100%'}>
|
60
|
+
<SearchBar
|
61
|
+
aiSummary={false}
|
62
|
+
defaultEngines={defaultEngines}
|
63
|
+
defaultQuery={args.query}
|
64
|
+
messageId={messageId}
|
65
|
+
tooltip={false}
|
66
|
+
/>
|
67
|
+
<Flexbox height={'100%'} width={'100%'}>
|
68
|
+
<ResultList dataSources={state.results} />
|
69
|
+
</Flexbox>
|
70
|
+
</Flexbox>
|
71
|
+
<Footer />
|
60
72
|
</Flexbox>
|
61
73
|
);
|
62
74
|
},
|