@librechat/agents-types 2.2.5 → 2.2.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/package.json +1 -1
- package/stream.ts +36 -2
package/package.json
CHANGED
package/stream.ts
CHANGED
@@ -240,8 +240,35 @@ export type BedrockReasoningContentText = {
|
|
240
240
|
reasoningText: { text?: string; signature?: string; }
|
241
241
|
};
|
242
242
|
|
243
|
+
/**
|
244
|
+
* A call to a tool.
|
245
|
+
*/
|
246
|
+
export type ToolCallPart = {
|
247
|
+
/** Type ("tool_call") according to Assistants Tool Call Structure */
|
248
|
+
type: ContentTypes.TOOL_CALL;
|
249
|
+
/** The name of the tool to be called */
|
250
|
+
name: string;
|
251
|
+
/** The arguments to the tool call */
|
252
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
253
|
+
args?: string | Record<string, any>;
|
254
|
+
|
255
|
+
/** If provided, an identifier associated with the tool call */
|
256
|
+
id?: string;
|
257
|
+
/** If provided, the output of the tool call */
|
258
|
+
output?: string;
|
259
|
+
/** Auth URL */
|
260
|
+
auth?: string;
|
261
|
+
/** Expiration time */
|
262
|
+
expires_at?: number;
|
263
|
+
};
|
264
|
+
|
265
|
+
export type ToolCallContent = {
|
266
|
+
type: ContentTypes.TOOL_CALL;
|
267
|
+
tool_call?: ToolCallPart;
|
268
|
+
};
|
269
|
+
|
243
270
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
244
|
-
export type MessageContentComplex = (ThinkingContentText | AgentUpdate | ReasoningContentText | MessageContentText | MessageContentImageUrl | (Record<string, any> & {
|
271
|
+
export type MessageContentComplex = (ThinkingContentText | AgentUpdate | ToolCallContent | ReasoningContentText | MessageContentText | MessageContentImageUrl | (Record<string, any> & {
|
245
272
|
type?: 'text' | 'image_url' | 'think' | 'thinking' | string;
|
246
273
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
247
274
|
}) | (Record<string, any> & {
|
@@ -249,7 +276,14 @@ export type MessageContentComplex = (ThinkingContentText | AgentUpdate | Reasoni
|
|
249
276
|
})) & {
|
250
277
|
tool_call_ids?: string[];
|
251
278
|
};
|
252
|
-
|
279
|
+
|
280
|
+
export interface TMessage {
|
281
|
+
role?: string;
|
282
|
+
content?: MessageContentComplex[] | string;
|
283
|
+
[key: string]: any;
|
284
|
+
}
|
285
|
+
|
286
|
+
export type TPayload = Array<Partial<TMessage>>;
|
253
287
|
|
254
288
|
export type CustomChunk = Partial<OpenAITypes.ChatCompletionChunk> & {
|
255
289
|
choices?: Partial<Array<Partial<OpenAITypes.Chat.Completions.ChatCompletionChunk.Choice> & {
|