librechat-data-provider 0.8.402 → 0.8.404
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/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react-query/index.es.js +1 -1
- package/dist/react-query/index.es.js.map +1 -1
- package/dist/types/accessPermissions.d.ts +744 -0
- package/dist/types/actions.d.ts +118 -0
- package/dist/types/api-endpoints.d.ts +150 -0
- package/dist/types/artifacts.d.ts +97 -0
- package/dist/types/azure.d.ts +22 -0
- package/dist/types/bedrock.d.ts +1220 -0
- package/dist/types/config.d.ts +14849 -0
- package/dist/types/config.spec.d.ts +1 -0
- package/dist/types/createPayload.d.ts +5 -0
- package/dist/types/data-service.d.ts +287 -0
- package/dist/types/feedback.d.ts +36 -0
- package/dist/types/file-config.d.ts +263 -0
- package/dist/types/file-config.spec.d.ts +1 -0
- package/dist/types/generate.d.ts +597 -0
- package/dist/types/headers-helpers.d.ts +2 -0
- package/{src/index.ts → dist/types/index.d.ts} +0 -15
- package/dist/types/keys.d.ts +92 -0
- package/dist/types/mcp.d.ts +2760 -0
- package/dist/types/messages.d.ts +10 -0
- package/dist/types/models.d.ts +1547 -0
- package/dist/types/parameterSettings.d.ts +69 -0
- package/dist/types/parsers.d.ts +110 -0
- package/dist/types/permissions.d.ts +522 -0
- package/dist/types/react-query/react-query-service.d.ts +85 -0
- package/dist/types/request.d.ts +25 -0
- package/dist/types/roles.d.ts +554 -0
- package/dist/types/roles.spec.d.ts +1 -0
- package/dist/types/schemas.d.ts +5110 -0
- package/dist/types/schemas.spec.d.ts +1 -0
- package/dist/types/types/agents.d.ts +433 -0
- package/dist/types/types/assistants.d.ts +547 -0
- package/dist/types/types/files.d.ts +172 -0
- package/dist/types/types/graph.d.ts +135 -0
- package/{src/types/mcpServers.ts → dist/types/types/mcpServers.d.ts} +12 -18
- package/dist/types/types/mutations.d.ts +209 -0
- package/dist/types/types/queries.d.ts +169 -0
- package/dist/types/types/runs.d.ts +36 -0
- package/dist/types/types/web.d.ts +520 -0
- package/dist/types/types.d.ts +503 -0
- package/dist/types/utils.d.ts +12 -0
- package/package.json +5 -1
- package/babel.config.js +0 -4
- package/check_updates.sh +0 -52
- package/jest.config.js +0 -19
- package/react-query/package-lock.json +0 -292
- package/react-query/package.json +0 -10
- package/rollup.config.js +0 -74
- package/server-rollup.config.js +0 -40
- package/specs/actions.spec.ts +0 -2533
- package/specs/api-endpoints-subdir.spec.ts +0 -140
- package/specs/api-endpoints.spec.ts +0 -74
- package/specs/azure.spec.ts +0 -844
- package/specs/bedrock.spec.ts +0 -862
- package/specs/filetypes.spec.ts +0 -175
- package/specs/generate.spec.ts +0 -770
- package/specs/headers-helpers.spec.ts +0 -24
- package/specs/mcp.spec.ts +0 -147
- package/specs/openapiSpecs.ts +0 -524
- package/specs/parsers.spec.ts +0 -601
- package/specs/request-interceptor.spec.ts +0 -304
- package/specs/utils.spec.ts +0 -196
- package/src/accessPermissions.ts +0 -346
- package/src/actions.ts +0 -813
- package/src/api-endpoints.ts +0 -440
- package/src/artifacts.ts +0 -3104
- package/src/azure.ts +0 -328
- package/src/bedrock.ts +0 -425
- package/src/config.spec.ts +0 -315
- package/src/config.ts +0 -2006
- package/src/createPayload.ts +0 -46
- package/src/data-service.ts +0 -1087
- package/src/feedback.ts +0 -141
- package/src/file-config.spec.ts +0 -1248
- package/src/file-config.ts +0 -764
- package/src/generate.ts +0 -634
- package/src/headers-helpers.ts +0 -13
- package/src/keys.ts +0 -99
- package/src/mcp.ts +0 -271
- package/src/messages.ts +0 -50
- package/src/models.ts +0 -69
- package/src/parameterSettings.ts +0 -1111
- package/src/parsers.ts +0 -563
- package/src/permissions.ts +0 -188
- package/src/react-query/react-query-service.ts +0 -566
- package/src/request.ts +0 -171
- package/src/roles.spec.ts +0 -132
- package/src/roles.ts +0 -225
- package/src/schemas.spec.ts +0 -355
- package/src/schemas.ts +0 -1234
- package/src/types/agents.ts +0 -470
- package/src/types/assistants.ts +0 -654
- package/src/types/files.ts +0 -191
- package/src/types/graph.ts +0 -145
- package/src/types/mutations.ts +0 -422
- package/src/types/queries.ts +0 -208
- package/src/types/runs.ts +0 -40
- package/src/types/web.ts +0 -588
- package/src/types.ts +0 -676
- package/src/utils.ts +0 -85
- package/tsconfig.json +0 -28
- package/tsconfig.spec.json +0 -10
- /package/{src/react-query/index.ts → dist/types/react-query/index.d.ts} +0 -0
- /package/{src/types/index.ts → dist/types/types/index.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
import { StepTypes, ContentTypes, ToolCallTypes } from './runs';
|
|
2
|
+
import type { FunctionToolCall, SummaryContentPart } from './assistants';
|
|
3
|
+
import type { TAttachment, TPlugin } from 'src/schemas';
|
|
4
|
+
export declare namespace Agents {
|
|
5
|
+
type MessageType = 'human' | 'ai' | 'generic' | 'system' | 'function' | 'tool' | 'remove';
|
|
6
|
+
type ImageDetail = 'auto' | 'low' | 'high';
|
|
7
|
+
type ReasoningContentText = {
|
|
8
|
+
type: ContentTypes.THINK;
|
|
9
|
+
think: string;
|
|
10
|
+
};
|
|
11
|
+
type MessageContentText = {
|
|
12
|
+
type: ContentTypes.TEXT;
|
|
13
|
+
text: string;
|
|
14
|
+
tool_call_ids?: string[];
|
|
15
|
+
};
|
|
16
|
+
type AgentUpdate = {
|
|
17
|
+
type: ContentTypes.AGENT_UPDATE;
|
|
18
|
+
agent_update: {
|
|
19
|
+
index: number;
|
|
20
|
+
runId: string;
|
|
21
|
+
agentId: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type MessageContentImageUrl = {
|
|
25
|
+
type: ContentTypes.IMAGE_URL;
|
|
26
|
+
image_url: string | {
|
|
27
|
+
url: string;
|
|
28
|
+
detail?: ImageDetail;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
type MessageContentVideoUrl = {
|
|
32
|
+
type: ContentTypes.VIDEO_URL;
|
|
33
|
+
video_url: {
|
|
34
|
+
url: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
type MessageContentInputAudio = {
|
|
38
|
+
type: ContentTypes.INPUT_AUDIO;
|
|
39
|
+
input_audio: {
|
|
40
|
+
data: string;
|
|
41
|
+
format: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
type MessageContentComplex = ReasoningContentText | AgentUpdate | MessageContentText | MessageContentImageUrl | MessageContentVideoUrl | MessageContentInputAudio | SummaryContentPart | ToolCallContent | (Record<string, any> & {
|
|
45
|
+
type?: ContentTypes | string;
|
|
46
|
+
}) | (Record<string, any> & {
|
|
47
|
+
type?: never;
|
|
48
|
+
});
|
|
49
|
+
type MessageContent = string | MessageContentComplex[];
|
|
50
|
+
/**
|
|
51
|
+
* A call to a tool.
|
|
52
|
+
*/
|
|
53
|
+
type ToolCall = {
|
|
54
|
+
/** Type ("tool_call") according to Assistants Tool Call Structure */
|
|
55
|
+
type: ToolCallTypes.TOOL_CALL;
|
|
56
|
+
/** The name of the tool to be called */
|
|
57
|
+
name: string;
|
|
58
|
+
/** The arguments to the tool call */
|
|
59
|
+
args?: string | Record<string, any>;
|
|
60
|
+
/** If provided, an identifier associated with the tool call */
|
|
61
|
+
id?: string;
|
|
62
|
+
/** If provided, the output of the tool call */
|
|
63
|
+
output?: string;
|
|
64
|
+
/** Auth URL */
|
|
65
|
+
auth?: string;
|
|
66
|
+
/** Expiration time */
|
|
67
|
+
expires_at?: number;
|
|
68
|
+
};
|
|
69
|
+
type ToolEndEvent = {
|
|
70
|
+
/** The Step Id of the Tool Call */
|
|
71
|
+
id: string;
|
|
72
|
+
/** The Completed Tool Call */
|
|
73
|
+
tool_call?: ToolCall;
|
|
74
|
+
/** The content index of the tool call */
|
|
75
|
+
index: number;
|
|
76
|
+
};
|
|
77
|
+
type ToolCallContent = {
|
|
78
|
+
type: ContentTypes.TOOL_CALL;
|
|
79
|
+
tool_call?: ToolCall;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* A chunk of a tool call (e.g., as part of a stream).
|
|
83
|
+
* When merging ToolCallChunks (e.g., via AIMessageChunk.__add__),
|
|
84
|
+
* all string attributes are concatenated. Chunks are only merged if their
|
|
85
|
+
* values of `index` are equal and not None.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const leftChunks = [
|
|
90
|
+
* {
|
|
91
|
+
* name: "foo",
|
|
92
|
+
* args: '{"a":',
|
|
93
|
+
* index: 0
|
|
94
|
+
* }
|
|
95
|
+
* ];
|
|
96
|
+
*
|
|
97
|
+
* const leftAIMessageChunk = new AIMessageChunk({
|
|
98
|
+
* content: "",
|
|
99
|
+
* tool_call_chunks: leftChunks
|
|
100
|
+
* });
|
|
101
|
+
*
|
|
102
|
+
* const rightChunks = [
|
|
103
|
+
* {
|
|
104
|
+
* name: undefined,
|
|
105
|
+
* args: '1}',
|
|
106
|
+
* index: 0
|
|
107
|
+
* }
|
|
108
|
+
* ];
|
|
109
|
+
*
|
|
110
|
+
* const rightAIMessageChunk = new AIMessageChunk({
|
|
111
|
+
* content: "",
|
|
112
|
+
* tool_call_chunks: rightChunks
|
|
113
|
+
* });
|
|
114
|
+
*
|
|
115
|
+
* const result = leftAIMessageChunk.concat(rightAIMessageChunk);
|
|
116
|
+
* // result.tool_call_chunks is equal to:
|
|
117
|
+
* // [
|
|
118
|
+
* // {
|
|
119
|
+
* // name: "foo",
|
|
120
|
+
* // args: '{"a":1}'
|
|
121
|
+
* // index: 0
|
|
122
|
+
* // }
|
|
123
|
+
* // ]
|
|
124
|
+
* ```
|
|
125
|
+
*
|
|
126
|
+
* @property {string} [name] - If provided, a substring of the name of the tool to be called
|
|
127
|
+
* @property {string} [args] - If provided, a JSON substring of the arguments to the tool call
|
|
128
|
+
* @property {string} [id] - If provided, a substring of an identifier for the tool call
|
|
129
|
+
* @property {number} [index] - If provided, the index of the tool call in a sequence
|
|
130
|
+
*/
|
|
131
|
+
type ToolCallChunk = {
|
|
132
|
+
name?: string;
|
|
133
|
+
args?: string;
|
|
134
|
+
id?: string;
|
|
135
|
+
index?: number;
|
|
136
|
+
type?: 'tool_call_chunk';
|
|
137
|
+
};
|
|
138
|
+
/** Event names are of the format: on_[runnable_type]_(start|stream|end).
|
|
139
|
+
|
|
140
|
+
Runnable types are one of:
|
|
141
|
+
|
|
142
|
+
llm - used by non chat models
|
|
143
|
+
chat_model - used by chat models
|
|
144
|
+
prompt -- e.g., ChatPromptTemplate
|
|
145
|
+
tool -- LangChain tools
|
|
146
|
+
chain - most Runnables are of this type
|
|
147
|
+
Further, the events are categorized as one of:
|
|
148
|
+
|
|
149
|
+
start - when the runnable starts
|
|
150
|
+
stream - when the runnable is streaming
|
|
151
|
+
end - when the runnable ends
|
|
152
|
+
start, stream and end are associated with slightly different data payload.
|
|
153
|
+
|
|
154
|
+
Please see the documentation for EventData for more details. */
|
|
155
|
+
type EventName = string;
|
|
156
|
+
type RunStep = {
|
|
157
|
+
type: StepTypes;
|
|
158
|
+
id: string;
|
|
159
|
+
runId?: string;
|
|
160
|
+
agentId?: string;
|
|
161
|
+
index: number;
|
|
162
|
+
stepIndex?: number;
|
|
163
|
+
/** Group ID for parallel content - parts with same groupId are displayed in columns */
|
|
164
|
+
groupId?: number;
|
|
165
|
+
stepDetails: StepDetails;
|
|
166
|
+
summary?: SummaryContentPart;
|
|
167
|
+
usage: null | object;
|
|
168
|
+
};
|
|
169
|
+
/** Content part for aggregated message content */
|
|
170
|
+
interface ContentPart {
|
|
171
|
+
type: string;
|
|
172
|
+
text?: string;
|
|
173
|
+
[key: string]: unknown;
|
|
174
|
+
}
|
|
175
|
+
/** User message metadata for rebuilding submission on reconnect */
|
|
176
|
+
interface UserMessageMeta {
|
|
177
|
+
messageId: string;
|
|
178
|
+
parentMessageId?: string;
|
|
179
|
+
conversationId?: string;
|
|
180
|
+
text?: string;
|
|
181
|
+
}
|
|
182
|
+
/** State data sent to reconnecting clients */
|
|
183
|
+
interface ResumeState {
|
|
184
|
+
runSteps: RunStep[];
|
|
185
|
+
/** Aggregated content parts - can be MessageContentComplex[] or ContentPart[] */
|
|
186
|
+
aggregatedContent?: MessageContentComplex[];
|
|
187
|
+
userMessage?: UserMessageMeta;
|
|
188
|
+
responseMessageId?: string;
|
|
189
|
+
conversationId?: string;
|
|
190
|
+
sender?: string;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Represents a run step delta i.e. any changed fields on a run step during
|
|
194
|
+
* streaming.
|
|
195
|
+
*/
|
|
196
|
+
interface RunStepDeltaEvent {
|
|
197
|
+
/**
|
|
198
|
+
* The identifier of the run step, which can be referenced in API endpoints.
|
|
199
|
+
*/
|
|
200
|
+
id: string;
|
|
201
|
+
/**
|
|
202
|
+
* The delta containing the fields that have changed on the run step.
|
|
203
|
+
*/
|
|
204
|
+
delta: ToolCallDelta;
|
|
205
|
+
}
|
|
206
|
+
type StepDetails = MessageCreationDetails | ToolCallsDetails;
|
|
207
|
+
type MessageCreationDetails = {
|
|
208
|
+
type: StepTypes.MESSAGE_CREATION;
|
|
209
|
+
message_creation: {
|
|
210
|
+
message_id: string;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
type ToolCallsDetails = {
|
|
214
|
+
type: StepTypes.TOOL_CALLS;
|
|
215
|
+
tool_calls: AgentToolCall[];
|
|
216
|
+
};
|
|
217
|
+
type ToolCallDelta = {
|
|
218
|
+
type: StepTypes.TOOL_CALLS | string;
|
|
219
|
+
tool_calls?: ToolCallChunk[];
|
|
220
|
+
auth?: string;
|
|
221
|
+
expires_at?: number;
|
|
222
|
+
};
|
|
223
|
+
type AgentToolCall = FunctionToolCall | ToolCall;
|
|
224
|
+
interface ExtendedMessageContent {
|
|
225
|
+
type?: string;
|
|
226
|
+
text?: string;
|
|
227
|
+
input?: string;
|
|
228
|
+
index?: number;
|
|
229
|
+
id?: string;
|
|
230
|
+
name?: string;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Represents a message delta i.e. any changed fields on a message during
|
|
234
|
+
* streaming.
|
|
235
|
+
*/
|
|
236
|
+
interface MessageDeltaEvent {
|
|
237
|
+
/**
|
|
238
|
+
* The identifier of the message, which can be referenced in API endpoints.
|
|
239
|
+
*/
|
|
240
|
+
id: string;
|
|
241
|
+
/**
|
|
242
|
+
* The delta containing the fields that have changed on the Message.
|
|
243
|
+
*/
|
|
244
|
+
delta: MessageDelta;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* The delta containing the fields that have changed on the Message.
|
|
248
|
+
*/
|
|
249
|
+
interface MessageDelta {
|
|
250
|
+
/**
|
|
251
|
+
* The content of the message in array of text and/or images.
|
|
252
|
+
*/
|
|
253
|
+
content?: Agents.MessageContentComplex[];
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Represents a reasoning delta i.e. any changed fields on a message during
|
|
257
|
+
* streaming.
|
|
258
|
+
*/
|
|
259
|
+
interface ReasoningDeltaEvent {
|
|
260
|
+
/**
|
|
261
|
+
* The identifier of the message, which can be referenced in API endpoints.
|
|
262
|
+
*/
|
|
263
|
+
id: string;
|
|
264
|
+
/**
|
|
265
|
+
* The delta containing the fields that have changed.
|
|
266
|
+
*/
|
|
267
|
+
delta: ReasoningDelta;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* The reasoning delta containing the fields that have changed on the Message.
|
|
271
|
+
*/
|
|
272
|
+
interface ReasoningDelta {
|
|
273
|
+
/**
|
|
274
|
+
* The content of the message in array of text and/or images.
|
|
275
|
+
*/
|
|
276
|
+
content?: MessageContentComplex[];
|
|
277
|
+
}
|
|
278
|
+
type ReasoningDeltaUpdate = {
|
|
279
|
+
type: ContentTypes.THINK;
|
|
280
|
+
think: string;
|
|
281
|
+
};
|
|
282
|
+
type ContentType = ContentTypes.THINK | ContentTypes.TEXT | ContentTypes.IMAGE_URL | ContentTypes.VIDEO_URL | ContentTypes.INPUT_AUDIO | string;
|
|
283
|
+
interface SummarizeStartEvent {
|
|
284
|
+
agentId: string;
|
|
285
|
+
provider: string;
|
|
286
|
+
model?: string;
|
|
287
|
+
messagesToRefineCount: number;
|
|
288
|
+
summaryVersion: number;
|
|
289
|
+
}
|
|
290
|
+
interface SummarizeDeltaEvent {
|
|
291
|
+
id: string;
|
|
292
|
+
delta: {
|
|
293
|
+
summary: SummaryContentPart;
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
interface SummarizeCompleteEvent {
|
|
297
|
+
id: string;
|
|
298
|
+
agentId: string;
|
|
299
|
+
summary?: SummaryContentPart;
|
|
300
|
+
error?: string;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
export type ToolCallResult = {
|
|
304
|
+
user: string;
|
|
305
|
+
toolId: string;
|
|
306
|
+
result?: unknown;
|
|
307
|
+
messageId: string;
|
|
308
|
+
partIndex?: number;
|
|
309
|
+
blockIndex?: number;
|
|
310
|
+
conversationId: string;
|
|
311
|
+
attachments?: TAttachment[];
|
|
312
|
+
};
|
|
313
|
+
export declare enum AuthTypeEnum {
|
|
314
|
+
ServiceHttp = "service_http",
|
|
315
|
+
OAuth = "oauth",
|
|
316
|
+
None = "none"
|
|
317
|
+
}
|
|
318
|
+
export declare enum AuthorizationTypeEnum {
|
|
319
|
+
Bearer = "bearer",
|
|
320
|
+
Basic = "basic",
|
|
321
|
+
Custom = "custom"
|
|
322
|
+
}
|
|
323
|
+
export declare enum TokenExchangeMethodEnum {
|
|
324
|
+
DefaultPost = "default_post",
|
|
325
|
+
BasicAuthHeader = "basic_auth_header"
|
|
326
|
+
}
|
|
327
|
+
export type Action = {
|
|
328
|
+
action_id: string;
|
|
329
|
+
type?: string;
|
|
330
|
+
settings?: Record<string, unknown>;
|
|
331
|
+
metadata: ActionMetadata;
|
|
332
|
+
version: number | string;
|
|
333
|
+
} & ({
|
|
334
|
+
assistant_id: string;
|
|
335
|
+
agent_id?: never;
|
|
336
|
+
} | {
|
|
337
|
+
assistant_id?: never;
|
|
338
|
+
agent_id: string;
|
|
339
|
+
});
|
|
340
|
+
export type ActionMetadata = {
|
|
341
|
+
api_key?: string;
|
|
342
|
+
auth?: ActionAuth;
|
|
343
|
+
domain?: string;
|
|
344
|
+
privacy_policy_url?: string;
|
|
345
|
+
raw_spec?: string;
|
|
346
|
+
oauth_client_id?: string;
|
|
347
|
+
oauth_client_secret?: string;
|
|
348
|
+
};
|
|
349
|
+
export type ActionAuth = {
|
|
350
|
+
authorization_type?: AuthorizationTypeEnum;
|
|
351
|
+
custom_auth_header?: string;
|
|
352
|
+
type?: AuthTypeEnum;
|
|
353
|
+
authorization_content_type?: string;
|
|
354
|
+
authorization_url?: string;
|
|
355
|
+
client_url?: string;
|
|
356
|
+
scope?: string;
|
|
357
|
+
token_exchange_method?: TokenExchangeMethodEnum;
|
|
358
|
+
};
|
|
359
|
+
export type ActionMetadataRuntime = ActionMetadata & {
|
|
360
|
+
oauth_access_token?: string;
|
|
361
|
+
oauth_refresh_token?: string;
|
|
362
|
+
oauth_token_expires_at?: Date;
|
|
363
|
+
};
|
|
364
|
+
export type MCP = {
|
|
365
|
+
serverName: string;
|
|
366
|
+
metadata: MCPMetadata;
|
|
367
|
+
} & ({
|
|
368
|
+
assistant_id: string;
|
|
369
|
+
agent_id?: never;
|
|
370
|
+
} | {
|
|
371
|
+
assistant_id?: never;
|
|
372
|
+
agent_id?: string;
|
|
373
|
+
});
|
|
374
|
+
export type MCPMetadata = Omit<ActionMetadata, 'auth'> & {
|
|
375
|
+
name?: string;
|
|
376
|
+
description?: string;
|
|
377
|
+
url?: string;
|
|
378
|
+
tools?: string[];
|
|
379
|
+
auth?: MCPAuth;
|
|
380
|
+
icon?: string;
|
|
381
|
+
trust?: boolean;
|
|
382
|
+
};
|
|
383
|
+
export type MCPAuth = ActionAuth;
|
|
384
|
+
export type AgentToolType = {
|
|
385
|
+
tool_id: string;
|
|
386
|
+
metadata: ToolMetadata;
|
|
387
|
+
} & ({
|
|
388
|
+
assistant_id: string;
|
|
389
|
+
agent_id?: never;
|
|
390
|
+
} | {
|
|
391
|
+
assistant_id?: never;
|
|
392
|
+
agent_id?: string;
|
|
393
|
+
});
|
|
394
|
+
export type ToolMetadata = TPlugin;
|
|
395
|
+
export interface BaseMessage {
|
|
396
|
+
content: string;
|
|
397
|
+
role?: string;
|
|
398
|
+
[key: string]: unknown;
|
|
399
|
+
}
|
|
400
|
+
export interface BaseGraphState {
|
|
401
|
+
[key: string]: unknown;
|
|
402
|
+
}
|
|
403
|
+
export type GraphEdge = {
|
|
404
|
+
/** Agent ID, use a list for multiple sources */
|
|
405
|
+
from: string | string[];
|
|
406
|
+
/** Agent ID, use a list for multiple destinations */
|
|
407
|
+
to: string | string[];
|
|
408
|
+
description?: string;
|
|
409
|
+
/** Can return boolean or specific destination(s) */
|
|
410
|
+
condition?: (state: BaseGraphState) => boolean | string | string[];
|
|
411
|
+
/** 'handoff' creates tools for dynamic routing, 'direct' creates direct edges, which also allow parallel execution */
|
|
412
|
+
edgeType?: 'handoff' | 'direct';
|
|
413
|
+
/**
|
|
414
|
+
* For direct edges: Optional prompt to add when transitioning through this edge.
|
|
415
|
+
* String prompts can include variables like {results} which will be replaced with
|
|
416
|
+
* messages from startIndex onwards. When {results} is used, excludeResults defaults to true.
|
|
417
|
+
*
|
|
418
|
+
* For handoff edges: Description for the input parameter that the handoff tool accepts,
|
|
419
|
+
* allowing the supervisor to pass specific instructions/context to the transferred agent.
|
|
420
|
+
*/
|
|
421
|
+
prompt?: string | ((messages: BaseMessage[], runStartIndex: number) => string | undefined);
|
|
422
|
+
/**
|
|
423
|
+
* When true, excludes messages from startIndex when adding prompt.
|
|
424
|
+
* Automatically set to true when {results} variable is used in prompt.
|
|
425
|
+
*/
|
|
426
|
+
excludeResults?: boolean;
|
|
427
|
+
/**
|
|
428
|
+
* For handoff edges: Customizes the parameter name for the handoff input.
|
|
429
|
+
* Defaults to "instructions" if not specified.
|
|
430
|
+
* Only applies when prompt is provided for handoff edges.
|
|
431
|
+
*/
|
|
432
|
+
promptKey?: string;
|
|
433
|
+
};
|