@librechat/agents-types 1.4.8 → 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.
Files changed (3) hide show
  1. package/package.json +2 -2
  2. package/run.ts +4 -2
  3. package/stream.ts +14 -1
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@librechat/agents-types",
3
- "version": "1.4.8",
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.4.8"
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';
@@ -20,6 +21,7 @@ export type StandardGraphConfig = {
20
21
  toolMap?: t.ToolMap;
21
22
  additional_instructions?: string;
22
23
  streamBuffer?: number;
24
+ streamRate?: number;
23
25
  clientOptions?: Record<string, unknown>;
24
26
  };
25
27
 
@@ -54,7 +56,7 @@ export type RunConfig = {
54
56
  graphConfig: StandardGraphConfig | CollaborativeGraphConfig | TaskManagerGraphConfig;
55
57
  customHandlers?: Record<string, g.EventHandler>;
56
58
  returnContent?: boolean;
57
- /** The rate at which to process stream events */
58
- streamRate?: number;
59
59
  runId?: string;
60
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: