@lobehub/lobehub 2.0.0-next.45 → 2.0.0-next.47
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/package.json +1 -1
- package/packages/database/src/models/file.ts +15 -1
- package/packages/database/src/repositories/aiInfra/index.test.ts +1 -1
- package/packages/database/src/repositories/dataExporter/index.test.ts +1 -1
- package/packages/database/src/repositories/tableViewer/index.test.ts +1 -1
- package/packages/types/src/aiProvider.ts +1 -1
- package/packages/types/src/document/index.ts +38 -38
- package/packages/types/src/exportConfig.ts +15 -15
- package/packages/types/src/generation/index.ts +5 -5
- package/packages/types/src/openai/chat.ts +15 -15
- package/packages/types/src/plugins/mcp.ts +29 -29
- package/packages/types/src/plugins/protocol.ts +43 -43
- package/packages/types/src/search.ts +4 -4
- package/packages/types/src/tool/plugin.ts +3 -3
- package/src/app/(backend)/f/[id]/route.ts +55 -0
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/ChatItem/Thread.tsx +1 -1
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/ChatItem/index.tsx +9 -16
- package/src/envs/app.ts +4 -3
- package/src/features/Conversation/Messages/Assistant/Actions/index.tsx +3 -5
- package/src/features/Conversation/Messages/Assistant/Extra/index.test.tsx +3 -3
- package/src/features/Conversation/Messages/Assistant/Extra/index.tsx +8 -5
- package/src/features/Conversation/Messages/Assistant/index.tsx +29 -15
- package/src/features/Conversation/Messages/Group/Actions/WithContentId.tsx +3 -5
- package/src/features/Conversation/Messages/Group/index.tsx +12 -20
- package/src/features/Conversation/Messages/Supervisor/index.tsx +14 -5
- package/src/features/Conversation/Messages/User/index.tsx +14 -8
- package/src/features/Conversation/Messages/index.tsx +16 -26
- package/src/features/Conversation/components/Extras/Usage/UsageDetail/index.tsx +7 -6
- package/src/features/Conversation/components/Extras/Usage/UsageDetail/tokens.ts +2 -5
- package/src/features/Conversation/components/Extras/Usage/index.tsx +13 -6
- package/src/features/Conversation/components/VirtualizedList/index.tsx +2 -1
- package/src/features/PluginsUI/Render/MCPType/index.tsx +26 -6
- package/src/server/modules/ContentChunk/index.test.ts +372 -0
- package/src/server/routers/desktop/mcp.ts +23 -8
- package/src/server/routers/tools/mcp.ts +24 -4
- package/src/server/services/file/impls/local.ts +4 -1
- package/src/server/services/file/index.ts +96 -1
- package/src/server/services/mcp/contentProcessor.ts +101 -0
- package/src/server/services/mcp/index.test.ts +52 -10
- package/src/server/services/mcp/index.ts +29 -26
- package/src/services/session/index.ts +0 -14
- package/src/utils/server/routeVariants.test.ts +340 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 2.0.0-next.47](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.46...v2.0.0-next.47)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2025-11-11**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Fix mcp server return image error.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Fix mcp server return image error, closes [#10113](https://github.com/lobehub/lobe-chat/issues/10113) ([e5640d4](https://github.com/lobehub/lobe-chat/commit/e5640d4))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## [Version 2.0.0-next.46](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.45...v2.0.0-next.46)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2025-11-11**</sup>
|
|
33
|
+
|
|
34
|
+
#### ♻ Code Refactoring
|
|
35
|
+
|
|
36
|
+
- **misc**: Fix thread display.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### Code refactoring
|
|
44
|
+
|
|
45
|
+
- **misc**: Fix thread display, closes [#10153](https://github.com/lobehub/lobe-chat/issues/10153) ([8fda83e](https://github.com/lobehub/lobe-chat/commit/8fda83e))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
## [Version 2.0.0-next.45](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.44...v2.0.0-next.45)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2025-11-10**</sup>
|
package/changelog/v1.json
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"children": {
|
|
4
|
+
"fixes": [
|
|
5
|
+
"Fix mcp server return image error."
|
|
6
|
+
]
|
|
7
|
+
},
|
|
8
|
+
"date": "2025-11-11",
|
|
9
|
+
"version": "2.0.0-next.47"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"children": {
|
|
13
|
+
"improvements": [
|
|
14
|
+
"Fix thread display."
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"date": "2025-11-11",
|
|
18
|
+
"version": "2.0.0-next.46"
|
|
19
|
+
},
|
|
2
20
|
{
|
|
3
21
|
"children": {
|
|
4
22
|
"improvements": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/lobehub",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.47",
|
|
4
4
|
"description": "LobeHub - an open-source,comprehensive AI Agent 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",
|
|
@@ -25,8 +25,22 @@ export class FileModel {
|
|
|
25
25
|
this.db = db;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Get file by ID without userId filter (public access)
|
|
30
|
+
* Use this for scenarios like file proxy where file should be accessible by ID alone
|
|
31
|
+
*
|
|
32
|
+
* @param db - Database instance
|
|
33
|
+
* @param id - File ID
|
|
34
|
+
* @returns File record or undefined
|
|
35
|
+
*/
|
|
36
|
+
static async getFileById(db: LobeChatDatabase, id: string): Promise<FileItem | undefined> {
|
|
37
|
+
return db.query.files.findFirst({
|
|
38
|
+
where: eq(files.id, id),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
28
42
|
create = async (
|
|
29
|
-
params: Omit<NewFile, 'id' | 'userId'> & { knowledgeBaseId?: string },
|
|
43
|
+
params: Omit<NewFile, 'id' | 'userId'> & { id?: string; knowledgeBaseId?: string },
|
|
30
44
|
insertToGlobalFiles?: boolean,
|
|
31
45
|
trx?: Transaction,
|
|
32
46
|
) => {
|
|
@@ -247,7 +247,7 @@ export const UpdateAiProviderConfigSchema = z.object({
|
|
|
247
247
|
z.string(),
|
|
248
248
|
z.union([
|
|
249
249
|
z.string().optional(),
|
|
250
|
-
z.record(z.string(), z.string()).optional(), //
|
|
250
|
+
z.record(z.string(), z.string()).optional(), // Support nested objects, e.g. customHeaders
|
|
251
251
|
]),
|
|
252
252
|
)
|
|
253
253
|
.optional(),
|
|
@@ -1,172 +1,172 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Document object in LobeChat
|
|
3
3
|
*/
|
|
4
4
|
export interface LobeDocument {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* File content
|
|
7
7
|
*/
|
|
8
8
|
content: string | null;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* File creation timestamp
|
|
11
11
|
*/
|
|
12
12
|
createdAt: Date;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* File type or extension
|
|
16
16
|
*/
|
|
17
17
|
fileType: string;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Original filename
|
|
21
21
|
*/
|
|
22
22
|
filename: string;
|
|
23
23
|
|
|
24
24
|
id: string;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* File-level metadata
|
|
28
|
+
* For example, title and author extracted from file properties, or errors when the entire file fails to load
|
|
29
29
|
*/
|
|
30
30
|
metadata: {
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Allow adding other file-level metadata
|
|
33
33
|
*/
|
|
34
34
|
[key: string]: any;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Document author (if available)
|
|
37
37
|
*/
|
|
38
38
|
author?: string;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Error information if the entire file fails to load
|
|
41
41
|
*/
|
|
42
42
|
error?: string;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
46
|
+
* Array containing all logical pages/blocks in the document
|
|
47
|
+
* Order typically corresponds to the natural order in the file
|
|
48
48
|
*/
|
|
49
49
|
pages?: LobeDocumentPage[];
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Full path of the original file
|
|
53
53
|
*/
|
|
54
54
|
source: string;
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Document title (if available)
|
|
58
58
|
*/
|
|
59
59
|
title?: string;
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
62
|
+
* Total character count of the entire document (sum of charCount of all Pages)
|
|
63
|
+
* Obtained after all Pages are loaded and calculated
|
|
64
64
|
*/
|
|
65
65
|
totalCharCount: number;
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
68
|
+
* Total line count of the entire document (sum of lineCount of all Pages)
|
|
69
|
+
* Obtained after all Pages are loaded and calculated
|
|
70
70
|
*/
|
|
71
71
|
totalLineCount: number;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* File last modified timestamp
|
|
75
75
|
*/
|
|
76
76
|
updatedAt: Date;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
80
|
+
* Represents a logical unit/page/block in a file
|
|
81
81
|
*/
|
|
82
82
|
export interface LobeDocumentPage {
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* Character count of this page/block content
|
|
85
85
|
*/
|
|
86
86
|
charCount: number;
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
89
|
+
* Line count of this page/block content
|
|
90
90
|
*/
|
|
91
91
|
lineCount: number;
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
94
|
+
* Metadata related to this page/block
|
|
95
95
|
*/
|
|
96
96
|
metadata: {
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
98
|
+
* Allow adding other page/block-specific metadata
|
|
99
99
|
*/
|
|
100
100
|
[key: string]: any;
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
103
|
+
* If the original file unit is further split into chunks, this is the index of the current chunk
|
|
104
104
|
*/
|
|
105
105
|
chunkIndex?: number;
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
|
-
*
|
|
108
|
+
* Errors that occurred while processing this page/block
|
|
109
109
|
*/
|
|
110
110
|
error?: string;
|
|
111
111
|
|
|
112
112
|
/**
|
|
113
|
-
*
|
|
113
|
+
* Ending line number of this page/block in the original file
|
|
114
114
|
*/
|
|
115
115
|
lineNumberEnd?: number;
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
|
-
*
|
|
118
|
+
* Starting line number of this page/block in the original file
|
|
119
119
|
*/
|
|
120
120
|
lineNumberStart?: number;
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
123
|
+
* Page number (applicable to PDF, DOCX)
|
|
124
124
|
*/
|
|
125
125
|
pageNumber?: number;
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
|
-
*
|
|
128
|
+
* Section title related to this page/block
|
|
129
129
|
*/
|
|
130
130
|
sectionTitle?: string;
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
|
-
*
|
|
133
|
+
* Worksheet name (applicable to XLSX)
|
|
134
134
|
*/
|
|
135
135
|
sheetName?: string;
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
|
-
*
|
|
138
|
+
* Slide number (applicable to PPTX)
|
|
139
139
|
*/
|
|
140
140
|
slideNumber?: number;
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
*
|
|
143
|
+
* If the original file unit is further split into chunks, this is the total number of chunks for that unit
|
|
144
144
|
*/
|
|
145
145
|
totalChunks?: number;
|
|
146
146
|
};
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
|
-
*
|
|
149
|
+
* Core text content of this page/block
|
|
150
150
|
*/
|
|
151
151
|
pageContent: string;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
|
-
*
|
|
155
|
+
* Document source type
|
|
156
156
|
*/
|
|
157
157
|
export enum DocumentSourceType {
|
|
158
158
|
/**
|
|
159
|
-
*
|
|
159
|
+
* Content from API
|
|
160
160
|
*/
|
|
161
161
|
API = 'api',
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
|
-
*
|
|
164
|
+
* Local or uploaded files
|
|
165
165
|
*/
|
|
166
166
|
FILE = 'file',
|
|
167
167
|
|
|
168
168
|
/**
|
|
169
|
-
*
|
|
169
|
+
* Web content
|
|
170
170
|
*/
|
|
171
171
|
WEB = 'web',
|
|
172
172
|
}
|
|
@@ -6,14 +6,14 @@ import { UserSettings } from './user/settings';
|
|
|
6
6
|
// ---------- TODO: this file need to be deleted in V2 ---------- //
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Export type
|
|
10
10
|
* @enum ['agents', 'sessions', 'singleSession', 'settings', 'all']
|
|
11
11
|
* @enumNames ['agents', 'sessions', 'singleSession', 'settings', 'all']
|
|
12
12
|
*/
|
|
13
13
|
export type ExportType = 'agents' | 'sessions' | 'singleSession' | 'settings' | 'all';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Config model map
|
|
17
17
|
*/
|
|
18
18
|
export interface ConfigModelMap {
|
|
19
19
|
agents: {
|
|
@@ -38,10 +38,10 @@ export interface ConfigModelMap {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
// =============
|
|
41
|
+
// ============= Config Data Structures ============= //
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Config state: Sessions
|
|
45
45
|
*/
|
|
46
46
|
export interface ConfigStateSessions {
|
|
47
47
|
messages: UIChatMessage[];
|
|
@@ -51,7 +51,7 @@ export interface ConfigStateSessions {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* Config state: Single session
|
|
55
55
|
*/
|
|
56
56
|
export interface ConfigStateSingleSession {
|
|
57
57
|
messages: UIChatMessage[];
|
|
@@ -60,7 +60,7 @@ export interface ConfigStateSingleSession {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* Config state: Agents
|
|
64
64
|
*/
|
|
65
65
|
export interface ConfigStateAgents {
|
|
66
66
|
sessionGroups: SessionGroupItem[];
|
|
@@ -68,21 +68,21 @@ export interface ConfigStateAgents {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
71
|
+
* Config state: Settings
|
|
72
72
|
*/
|
|
73
73
|
export interface ConfigStateSettings {
|
|
74
74
|
settings: UserSettings;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* Config state: All
|
|
79
79
|
*/
|
|
80
80
|
export interface ConfigStateAll extends ConfigStateSessions, ConfigStateSettings {}
|
|
81
81
|
|
|
82
|
-
// =============
|
|
82
|
+
// ============= Config File Types ============= //
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* Config file: Settings
|
|
86
86
|
*/
|
|
87
87
|
export interface ConfigFileSettings {
|
|
88
88
|
exportType: 'settings';
|
|
@@ -91,7 +91,7 @@ export interface ConfigFileSettings {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
94
|
+
* Config file: Sessions
|
|
95
95
|
*/
|
|
96
96
|
export interface ConfigFileSessions {
|
|
97
97
|
exportType: 'sessions';
|
|
@@ -100,7 +100,7 @@ export interface ConfigFileSessions {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
103
|
+
* Config file: Single session
|
|
104
104
|
*/
|
|
105
105
|
export interface ConfigFileSingleSession {
|
|
106
106
|
exportType: 'sessions';
|
|
@@ -109,7 +109,7 @@ export interface ConfigFileSingleSession {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
|
-
*
|
|
112
|
+
* Config file: Agents
|
|
113
113
|
*/
|
|
114
114
|
export interface ConfigFileAgents {
|
|
115
115
|
exportType: 'agents';
|
|
@@ -118,7 +118,7 @@ export interface ConfigFileAgents {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
|
-
*
|
|
121
|
+
* Config file: All
|
|
122
122
|
*/
|
|
123
123
|
export interface ConfigFileAll {
|
|
124
124
|
exportType: 'all';
|
|
@@ -127,6 +127,6 @@ export interface ConfigFileAll {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
-
*
|
|
130
|
+
* Config file
|
|
131
131
|
*/
|
|
132
132
|
export type ConfigFile = ConfigFileSettings | ConfigFileSessions | ConfigFileAll | ConfigFileAgents;
|
|
@@ -14,23 +14,23 @@ export interface BaseGenerationAsset {
|
|
|
14
14
|
|
|
15
15
|
export interface ImageGenerationAsset extends BaseGenerationAsset {
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Height of the image/video
|
|
18
18
|
*/
|
|
19
19
|
height?: number;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* CDN URL from the API provider, typically expires quickly
|
|
22
22
|
*/
|
|
23
23
|
originalUrl?: string;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Thumbnail URL - for images it's a resized version, for videos it's a thumbnail of the cover
|
|
26
26
|
*/
|
|
27
27
|
thumbnailUrl?: string;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* URL stored in own OSS, only the key is stored. The full URL needs to be obtained using FileService.getFullFileUrl
|
|
30
30
|
*/
|
|
31
31
|
url?: string;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Width of the image/video
|
|
34
34
|
*/
|
|
35
35
|
width?: number;
|
|
36
36
|
}
|
|
@@ -38,8 +38,8 @@ export type UserMessageContentPart = UserMessageContentPartText | UserMessageCon
|
|
|
38
38
|
|
|
39
39
|
export interface OpenAIChatMessage {
|
|
40
40
|
/**
|
|
41
|
-
* @title
|
|
42
|
-
* @description
|
|
41
|
+
* @title Content
|
|
42
|
+
* @description Message content
|
|
43
43
|
*/
|
|
44
44
|
content: string | UserMessageContentPart[];
|
|
45
45
|
|
|
@@ -49,8 +49,8 @@ export interface OpenAIChatMessage {
|
|
|
49
49
|
function_call?: OpenAIFunctionCall;
|
|
50
50
|
name?: string;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
53
|
-
* @description
|
|
52
|
+
* Role
|
|
53
|
+
* @description Role of the message sender
|
|
54
54
|
*/
|
|
55
55
|
role: LLMRoleType;
|
|
56
56
|
tool_call_id?: string;
|
|
@@ -62,36 +62,36 @@ export interface OpenAIChatMessage {
|
|
|
62
62
|
*/
|
|
63
63
|
export interface ChatStreamPayload {
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Whether search is enabled
|
|
66
66
|
*/
|
|
67
67
|
enabledSearch?: boolean;
|
|
68
68
|
/**
|
|
69
|
-
* @title
|
|
69
|
+
* @title Penalty coefficient in generated text to reduce repetitiveness
|
|
70
70
|
* @default 0
|
|
71
71
|
*/
|
|
72
72
|
frequency_penalty?: number;
|
|
73
73
|
/**
|
|
74
|
-
* @title
|
|
74
|
+
* @title Maximum length of generated text
|
|
75
75
|
*/
|
|
76
76
|
max_tokens?: number;
|
|
77
77
|
/**
|
|
78
|
-
* @title
|
|
78
|
+
* @title List of chat messages
|
|
79
79
|
*/
|
|
80
80
|
messages: OpenAIChatMessage[];
|
|
81
81
|
/**
|
|
82
|
-
* @title
|
|
82
|
+
* @title Model name
|
|
83
83
|
*/
|
|
84
84
|
model: string;
|
|
85
85
|
/**
|
|
86
|
-
* @title
|
|
86
|
+
* @title Number of texts to return
|
|
87
87
|
*/
|
|
88
88
|
n?: number;
|
|
89
89
|
/**
|
|
90
|
-
*
|
|
90
|
+
* List of enabled plugins
|
|
91
91
|
*/
|
|
92
92
|
plugins?: string[];
|
|
93
93
|
/**
|
|
94
|
-
* @title
|
|
94
|
+
* @title Penalty coefficient in generated text to reduce topic changes
|
|
95
95
|
* @default 0
|
|
96
96
|
*/
|
|
97
97
|
presence_penalty?: number;
|
|
@@ -102,19 +102,19 @@ export interface ChatStreamPayload {
|
|
|
102
102
|
responseMode?: 'stream' | 'json';
|
|
103
103
|
response_format?: ChatResponseFormat;
|
|
104
104
|
/**
|
|
105
|
-
* @title
|
|
105
|
+
* @title Whether to enable streaming requests
|
|
106
106
|
* @default true
|
|
107
107
|
*/
|
|
108
108
|
stream?: boolean;
|
|
109
109
|
/**
|
|
110
|
-
* @title
|
|
110
|
+
* @title Randomness measure for generated text, used to control creativity and diversity
|
|
111
111
|
* @default 1
|
|
112
112
|
*/
|
|
113
113
|
temperature: number;
|
|
114
114
|
tool_choice?: string;
|
|
115
115
|
tools?: ChatCompletionTool[];
|
|
116
116
|
/**
|
|
117
|
-
* @title
|
|
117
|
+
* @title Controls the single token with highest probability in generated text
|
|
118
118
|
* @default 1
|
|
119
119
|
*/
|
|
120
120
|
top_p?: number;
|