@librechat/agents-types 1.4.9 → 1.5.0
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 +2 -2
- package/run.ts +3 -0
- package/stream.ts +14 -1
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@librechat/agents-types",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.5.0",
|
4
4
|
"description": "Type definitions for @librechat/agents",
|
5
5
|
"types": "index.d.ts",
|
6
6
|
"scripts": {
|
7
7
|
"build": "tsc"
|
8
8
|
},
|
9
9
|
"peerDependencies": {
|
10
|
-
"@librechat/agents": "^1.
|
10
|
+
"@librechat/agents": "^1.5.0"
|
11
11
|
}
|
12
12
|
}
|
package/run.ts
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
import type * as z from 'zod';
|
3
3
|
import type { BaseMessage } from '@langchain/core/messages';
|
4
4
|
import type { StructuredTool } from '@langchain/core/tools';
|
5
|
+
import type { BaseCallbackHandler, CallbackHandlerMethods } from '@langchain/core/callbacks/base';
|
5
6
|
import type * as e from '@/common/enum';
|
6
7
|
import type * as g from '@/types/graph';
|
7
8
|
import type * as t from '@/types/tools';
|
@@ -57,3 +58,5 @@ export type RunConfig = {
|
|
57
58
|
returnContent?: boolean;
|
58
59
|
runId?: string;
|
59
60
|
};
|
61
|
+
|
62
|
+
export type ProvidedCallbacks = (BaseCallbackHandler | CallbackHandlerMethods)[] | undefined;
|
package/stream.ts
CHANGED
@@ -1,8 +1,21 @@
|
|
1
1
|
// src/types/stream.ts
|
2
|
-
import type { MessageContentImageUrl, MessageContentText, ToolMessage } from '@langchain/core/messages';
|
2
|
+
import type { MessageContentImageUrl, MessageContentText, ToolMessage, BaseMessage } from '@langchain/core/messages';
|
3
3
|
import type { ToolCall, ToolCallChunk } from '@langchain/core/messages/tool';
|
4
|
+
import type { LLMResult, Generation } from '@langchain/core/outputs';
|
4
5
|
import { StepTypes, ContentTypes } from '@/common/enum';
|
5
6
|
|
7
|
+
export type HandleLLMEnd = (output: LLMResult, runId: string, parentRunId?: string, tags?: string[]) => void;
|
8
|
+
|
9
|
+
export type MetadataAggregatorResult = {
|
10
|
+
handleLLMEnd: HandleLLMEnd;
|
11
|
+
collected: Record<string, unknown>[];
|
12
|
+
};
|
13
|
+
|
14
|
+
export type StreamGeneration = Generation & {
|
15
|
+
text?: string;
|
16
|
+
message?: BaseMessage
|
17
|
+
};
|
18
|
+
|
6
19
|
/** Event names are of the format: on_[runnable_type]_(start|stream|end).
|
7
20
|
|
8
21
|
Runnable types are one of:
|