@valerypopoff/rivet2-core 2.1.8 → 2.1.10
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/cjs/bundle.cjs +4457 -1809
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/cjs/webAppRuntime.cjs +298 -21
- package/dist/cjs/webAppRuntime.cjs.map +4 -4
- package/dist/esm/exports.js +1 -0
- package/dist/esm/model/AgentResponseTrace.js +448 -0
- package/dist/esm/model/ConnectedToolContinuationHost.js +33 -0
- package/dist/esm/model/GraphProcessor.js +152 -74
- package/dist/esm/model/NodeImpl.js +6 -0
- package/dist/esm/model/ProcessContextBuilder.js +3 -1
- package/dist/esm/model/RecordingPlayer.js +164 -22
- package/dist/esm/model/SplitRunProcessor.js +68 -18
- package/dist/esm/model/SubprocessorBridge.js +2 -0
- package/dist/esm/model/ToolCallContinuationCoordinator.js +13 -4
- package/dist/esm/model/UiGraph.js +21 -0
- package/dist/esm/model/UiGraphActionProtocol.js +2 -0
- package/dist/esm/model/UiGraphBrowserRuntime.js +133 -4
- package/dist/esm/model/UiGraphRendererStyles.js +221 -0
- package/dist/esm/model/UiGraphRuntimeModel.js +9 -3
- package/dist/esm/model/UiGraphSchema.js +7 -1
- package/dist/esm/model/chat/aiSdkMessages.js +8 -0
- package/dist/esm/model/chat/aiSdkTools.js +3 -2
- package/dist/esm/model/chat-v2/chatV2CallObserver.js +11 -5
- package/dist/esm/model/chat-v2/chatV2EditorCache.js +58 -10
- package/dist/esm/model/chat-v2/chatV2Errors.js +7 -19
- package/dist/esm/model/chat-v2/chatV2FeatureCompatibility.js +1 -1
- package/dist/esm/model/chat-v2/chatV2Outputs.js +56 -106
- package/dist/esm/model/chat-v2/chatV2Pipeline.js +142 -149
- package/dist/esm/model/chat-v2/chatV2ProviderProfile.js +9 -2
- package/dist/esm/model/chat-v2/chatV2ProviderRegistry.js +9 -0
- package/dist/esm/model/chat-v2/chatV2RequestPlan.js +5 -5
- package/dist/esm/model/chat-v2/chatV2ResponseBodyCapture.js +55 -0
- package/dist/esm/model/chat-v2/chatV2ResponseFormat.js +8 -4
- package/dist/esm/model/chat-v2/chatV2Retry.js +4 -3
- package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +6 -1
- package/dist/esm/model/chat-v2/chatV2Shared.js +1 -6
- package/dist/esm/model/chat-v2/chatV2Types.js +7 -1
- package/dist/esm/model/chat-v2/chatV2UsageAccounting.js +78 -0
- package/dist/esm/model/chat-v2/customProviderApi.js +42 -0
- package/dist/esm/model/chat-v2/developerMessageRoles.js +45 -0
- package/dist/esm/model/chat-v2/index.js +12 -0
- package/dist/esm/model/chat-v2/llmChatV2Body.js +281 -0
- package/dist/esm/model/chat-v2/llmChatV2CacheBoundary.js +32 -0
- package/dist/esm/model/chat-v2/llmChatV2CachePolicy.js +20 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeData.js +8 -54
- package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +41 -20
- package/dist/esm/model/chat-v2/llmChatV2NodeMigration.js +24 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeRuntime.js +178 -94
- package/dist/esm/model/chat-v2/llmInvocationCoordinator.js +60 -0
- package/dist/esm/model/chat-v2/llmInvocationDecision.js +11 -0
- package/dist/esm/model/chat-v2/llmInvocationJournal.js +43 -0
- package/dist/esm/model/chat-v2/llmInvocationPlan.js +68 -0
- package/dist/esm/model/chat-v2/llmInvocationProjections.js +5 -0
- package/dist/esm/model/chat-v2/llmInvocationResultProjector.js +48 -0
- package/dist/esm/model/chat-v2/llmModelCandidate.js +75 -0
- package/dist/esm/model/chat-v2/llmProfile.js +31 -65
- package/dist/esm/model/chat-v2/llmProfileBody.js +183 -0
- package/dist/esm/model/chat-v2/llmProfileFallback.js +244 -0
- package/dist/esm/model/chat-v2/llmProfileFieldRegistry.js +67 -0
- package/dist/esm/model/chat-v2/llmProfileNodeRuntime.js +3 -0
- package/dist/esm/model/chat-v2/llmProfileTypes.js +1 -18
- package/dist/esm/model/chat-v2/llmResponseMaterializer.js +42 -0
- package/dist/esm/model/chat-v2/messageConverter.js +14 -0
- package/dist/esm/model/chat-v2/modelRegistry.js +54 -4
- package/dist/esm/model/chat-v2/parallelToolCalls.js +9 -2
- package/dist/esm/model/chat-v2/providerOptions.js +120 -21
- package/dist/esm/model/chat-v2/rivetToolRegistry.js +9 -0
- package/dist/esm/model/chat-v2/toolCallCodec.js +52 -0
- package/dist/esm/model/chat-v2/toolContinuation.js +72 -39
- package/dist/esm/model/chat-v2/toolHandlerResolver.js +23 -0
- package/dist/esm/model/chat-v2/toolRoundExecutor.js +12 -0
- package/dist/esm/model/nodes/AssembleMessageNode.js +6 -0
- package/dist/esm/model/nodes/ChatNode.js +6 -0
- package/dist/esm/model/nodes/ChatNodeBase.js +1 -0
- package/dist/esm/model/nodes/DelegateFunctionCallNode.js +26 -1
- package/dist/esm/model/nodes/LLMChatV2Node.js +131 -144
- package/dist/esm/model/nodes/LLMProfileNode.js +27 -8
- package/dist/esm/model/nodes/PromptNode.js +16 -2
- package/dist/esm/model/nodes/ToolNode.js +7 -0
- package/dist/esm/model/nodes/toolCallDelegation.js +193 -110
- package/dist/esm/plugins/anthropic/anthropic.js +4 -4
- package/dist/esm/plugins/anthropic/nodes/ChatAnthropicNode.js +29 -28
- package/dist/esm/plugins/google/google.js +25 -18
- package/dist/esm/plugins/google/nodes/ChatGoogleNode.js +21 -7
- package/dist/esm/recording/ExecutionRecorder.js +13 -5
- package/dist/esm/utils/chatMessageToOpenAIChatCompletionMessage.js +4 -0
- package/dist/esm/utils/emitDetached.js +6 -3
- package/dist/esm/utils/openai.js +60 -16
- package/dist/esm/utils/serialization/serialization.js +2 -0
- package/dist/esm/webAppRuntime.js +3 -2
- package/dist/types/exports.d.ts +1 -0
- package/dist/types/model/AgentResponseTrace.d.ts +110 -0
- package/dist/types/model/ConnectedToolContinuationHost.d.ts +34 -0
- package/dist/types/model/DataValue.d.ts +7 -1
- package/dist/types/model/ExecutorProtocol.d.ts +25 -7
- package/dist/types/model/GraphProcessor.d.ts +27 -5
- package/dist/types/model/NodeBase.d.ts +6 -0
- package/dist/types/model/NodeImpl.d.ts +18 -1
- package/dist/types/model/Nodes.d.ts +2 -2
- package/dist/types/model/ProcessContext.d.ts +51 -0
- package/dist/types/model/ProcessContextBuilder.d.ts +3 -1
- package/dist/types/model/RecordingPlayer.d.ts +6 -0
- package/dist/types/model/SplitRunProcessor.d.ts +11 -3
- package/dist/types/model/UiGraph.d.ts +8 -0
- package/dist/types/model/UiGraphActionProtocol.d.ts +2 -0
- package/dist/types/model/UiGraphBrowserRuntime.d.ts +11 -2
- package/dist/types/model/UiGraphRendererStyles.d.ts +1 -1
- package/dist/types/model/UiGraphRuntimeModel.d.ts +2 -0
- package/dist/types/model/UiGraphSchema.d.ts +1 -0
- package/dist/types/model/chat-v2/chatV2CallObserver.d.ts +2 -0
- package/dist/types/model/chat-v2/chatV2EditorCache.d.ts +3 -1
- package/dist/types/model/chat-v2/chatV2Outputs.d.ts +7 -17
- package/dist/types/model/chat-v2/chatV2Pipeline.d.ts +29 -0
- package/dist/types/model/chat-v2/chatV2ProviderProfile.d.ts +5 -0
- package/dist/types/model/chat-v2/chatV2ProviderRegistry.d.ts +8 -0
- package/dist/types/model/chat-v2/chatV2RequestPlan.d.ts +2 -2
- package/dist/types/model/chat-v2/chatV2ResponseBodyCapture.d.ts +19 -0
- package/dist/types/model/chat-v2/chatV2ResponseFormat.d.ts +3 -2
- package/dist/types/model/chat-v2/chatV2Retry.d.ts +2 -0
- package/dist/types/model/chat-v2/chatV2Shared.d.ts +0 -1
- package/dist/types/model/chat-v2/chatV2Types.d.ts +35 -1
- package/dist/types/model/chat-v2/chatV2UsageAccounting.d.ts +14 -0
- package/dist/types/model/chat-v2/customProviderApi.d.ts +23 -0
- package/dist/types/model/chat-v2/developerMessageRoles.d.ts +10 -0
- package/dist/types/model/chat-v2/index.d.ts +12 -0
- package/dist/types/model/chat-v2/llmChatV2Body.d.ts +24 -0
- package/dist/types/model/chat-v2/llmChatV2CacheBoundary.d.ts +10 -0
- package/dist/types/model/chat-v2/llmChatV2CachePolicy.d.ts +13 -0
- package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +13 -3
- package/dist/types/model/chat-v2/llmChatV2NodeMigration.d.ts +8 -0
- package/dist/types/model/chat-v2/llmChatV2NodeRuntime.d.ts +18 -4
- package/dist/types/model/chat-v2/llmInvocationCoordinator.d.ts +16 -0
- package/dist/types/model/chat-v2/llmInvocationDecision.d.ts +21 -0
- package/dist/types/model/chat-v2/llmInvocationJournal.d.ts +38 -0
- package/dist/types/model/chat-v2/llmInvocationPlan.d.ts +41 -0
- package/dist/types/model/chat-v2/llmInvocationProjections.d.ts +3 -0
- package/dist/types/model/chat-v2/llmInvocationResultProjector.d.ts +26 -0
- package/dist/types/model/chat-v2/llmModelCandidate.d.ts +18 -0
- package/dist/types/model/chat-v2/llmProfile.d.ts +7 -0
- package/dist/types/model/chat-v2/llmProfileBody.d.ts +20 -0
- package/dist/types/model/chat-v2/llmProfileFallback.d.ts +47 -0
- package/dist/types/model/chat-v2/llmProfileFieldRegistry.d.ts +189 -0
- package/dist/types/model/chat-v2/llmProfileTypes.d.ts +1 -1
- package/dist/types/model/chat-v2/llmResponseMaterializer.d.ts +20 -0
- package/dist/types/model/chat-v2/modelRegistry.d.ts +17 -187
- package/dist/types/model/chat-v2/parallelToolCalls.d.ts +3 -1
- package/dist/types/model/chat-v2/providerOptions.d.ts +11 -0
- package/dist/types/model/chat-v2/rivetToolRegistry.d.ts +11 -0
- package/dist/types/model/chat-v2/toolCallCodec.d.ts +7 -0
- package/dist/types/model/chat-v2/toolContinuation.d.ts +3 -3
- package/dist/types/model/chat-v2/toolHandlerResolver.d.ts +25 -0
- package/dist/types/model/chat-v2/toolRoundExecutor.d.ts +18 -0
- package/dist/types/model/nodes/AssembleMessageNode.d.ts +2 -1
- package/dist/types/model/nodes/ChatNode.d.ts +2 -1
- package/dist/types/model/nodes/DelegateFunctionCallNode.d.ts +2 -1
- package/dist/types/model/nodes/LLMChatV2Node.d.ts +2 -1
- package/dist/types/model/nodes/LLMProfileNode.d.ts +2 -1
- package/dist/types/model/nodes/PromptNode.d.ts +6 -3
- package/dist/types/model/nodes/ToolNode.d.ts +2 -1
- package/dist/types/model/nodes/toolCallDelegation.d.ts +10 -3
- package/dist/types/plugins/anthropic/anthropic.d.ts +1 -0
- package/dist/types/plugins/google/google.d.ts +14 -9
- package/dist/types/plugins/google/nodes/ChatGoogleNode.d.ts +2 -1
- package/dist/types/recording/RecordedEvents.d.ts +6 -0
- package/dist/types/utils/emitDetached.d.ts +3 -2
- package/dist/types/utils/openai.d.ts +49 -0
- package/dist/types/webAppRuntime.d.ts +4 -2
- package/package.json +2 -2
|
@@ -2,139 +2,19 @@ import type { ChatV2Provider } from './chatV2Types.js';
|
|
|
2
2
|
export type ChatV2ModelInfo = {
|
|
3
3
|
maxTokens: number;
|
|
4
4
|
displayName: string;
|
|
5
|
-
|
|
5
|
+
/** USD per token, not per thousand tokens. Omitted when Rivet cannot estimate this model safely. */
|
|
6
|
+
cost?: {
|
|
6
7
|
prompt: number;
|
|
7
8
|
completion: number;
|
|
8
9
|
};
|
|
9
10
|
};
|
|
11
|
+
type TokenUsageForCost = {
|
|
12
|
+
inputTokens?: number | undefined;
|
|
13
|
+
outputTokens?: number | undefined;
|
|
14
|
+
};
|
|
10
15
|
export declare function getChatV2ModelRegistry(): {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
maxTokens: number;
|
|
14
|
-
cost: {
|
|
15
|
-
prompt: number;
|
|
16
|
-
completion: number;
|
|
17
|
-
};
|
|
18
|
-
displayName: string;
|
|
19
|
-
supported: {
|
|
20
|
-
parallelFunctionCalls: true;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
'gpt-5-mini': {
|
|
24
|
-
maxTokens: number;
|
|
25
|
-
cost: {
|
|
26
|
-
prompt: number;
|
|
27
|
-
completion: number;
|
|
28
|
-
};
|
|
29
|
-
displayName: string;
|
|
30
|
-
supported: {
|
|
31
|
-
parallelFunctionCalls: true;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
'gpt-5-nano': {
|
|
35
|
-
maxTokens: number;
|
|
36
|
-
cost: {
|
|
37
|
-
prompt: number;
|
|
38
|
-
completion: number;
|
|
39
|
-
};
|
|
40
|
-
displayName: string;
|
|
41
|
-
supported: {
|
|
42
|
-
parallelFunctionCalls: true;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
'gpt-4o': {
|
|
46
|
-
maxTokens: number;
|
|
47
|
-
cost: {
|
|
48
|
-
prompt: number;
|
|
49
|
-
completion: number;
|
|
50
|
-
};
|
|
51
|
-
displayName: string;
|
|
52
|
-
};
|
|
53
|
-
'gpt-4o-mini': {
|
|
54
|
-
maxTokens: number;
|
|
55
|
-
cost: {
|
|
56
|
-
prompt: number;
|
|
57
|
-
completion: number;
|
|
58
|
-
};
|
|
59
|
-
displayName: string;
|
|
60
|
-
};
|
|
61
|
-
o1: {
|
|
62
|
-
maxTokens: number;
|
|
63
|
-
cost: {
|
|
64
|
-
prompt: number;
|
|
65
|
-
completion: number;
|
|
66
|
-
};
|
|
67
|
-
displayName: string;
|
|
68
|
-
supported: {
|
|
69
|
-
parallelFunctionCalls: false;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
'o1-mini': {
|
|
73
|
-
maxTokens: number;
|
|
74
|
-
cost: {
|
|
75
|
-
prompt: number;
|
|
76
|
-
completion: number;
|
|
77
|
-
};
|
|
78
|
-
displayName: string;
|
|
79
|
-
supported: {
|
|
80
|
-
parallelFunctionCalls: false;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
'o3-mini': {
|
|
84
|
-
maxTokens: number;
|
|
85
|
-
cost: {
|
|
86
|
-
prompt: number;
|
|
87
|
-
completion: number;
|
|
88
|
-
};
|
|
89
|
-
displayName: string;
|
|
90
|
-
supported: {
|
|
91
|
-
parallelFunctionCalls: false;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
'gpt-4o-audio-preview': {
|
|
95
|
-
maxTokens: number;
|
|
96
|
-
cost: {
|
|
97
|
-
prompt: number;
|
|
98
|
-
completion: number;
|
|
99
|
-
audioPrompt: number;
|
|
100
|
-
audioCompletion: number;
|
|
101
|
-
};
|
|
102
|
-
displayName: string;
|
|
103
|
-
};
|
|
104
|
-
'gpt-4.1': {
|
|
105
|
-
maxTokens: number;
|
|
106
|
-
cost: {
|
|
107
|
-
prompt: number;
|
|
108
|
-
completion: number;
|
|
109
|
-
};
|
|
110
|
-
displayName: string;
|
|
111
|
-
};
|
|
112
|
-
o3: {
|
|
113
|
-
maxTokens: number;
|
|
114
|
-
cost: {
|
|
115
|
-
prompt: number;
|
|
116
|
-
completion: number;
|
|
117
|
-
};
|
|
118
|
-
displayName: string;
|
|
119
|
-
};
|
|
120
|
-
'o4-mini': {
|
|
121
|
-
maxTokens: number;
|
|
122
|
-
cost: {
|
|
123
|
-
prompt: number;
|
|
124
|
-
completion: number;
|
|
125
|
-
};
|
|
126
|
-
displayName: string;
|
|
127
|
-
};
|
|
128
|
-
'local-model': {
|
|
129
|
-
maxTokens: number;
|
|
130
|
-
cost: {
|
|
131
|
-
prompt: number;
|
|
132
|
-
completion: number;
|
|
133
|
-
};
|
|
134
|
-
displayName: string;
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
readonly anthropic: {
|
|
16
|
+
openai: Record<string, ChatV2ModelInfo>;
|
|
17
|
+
anthropic: {
|
|
138
18
|
'claude-instant-1': {
|
|
139
19
|
maxTokens: number;
|
|
140
20
|
cost: {
|
|
@@ -232,65 +112,15 @@ export declare function getChatV2ModelRegistry(): {
|
|
|
232
112
|
displayName: string;
|
|
233
113
|
};
|
|
234
114
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
maxTokens: number;
|
|
238
|
-
cost: {
|
|
239
|
-
prompt: number;
|
|
240
|
-
completion: number;
|
|
241
|
-
};
|
|
242
|
-
displayName: string;
|
|
243
|
-
};
|
|
244
|
-
'gemini-2.5-flash': {
|
|
245
|
-
maxTokens: number;
|
|
246
|
-
cost: {
|
|
247
|
-
prompt: number;
|
|
248
|
-
completion: number;
|
|
249
|
-
};
|
|
250
|
-
displayName: string;
|
|
251
|
-
};
|
|
252
|
-
'gemini-2.5-flash-lite-preview-06-17': {
|
|
253
|
-
maxTokens: number;
|
|
254
|
-
cost: {
|
|
255
|
-
prompt: number;
|
|
256
|
-
completion: number;
|
|
257
|
-
};
|
|
258
|
-
displayName: string;
|
|
259
|
-
};
|
|
260
|
-
'gemini-2.0-flash': {
|
|
261
|
-
maxTokens: number;
|
|
262
|
-
cost: {
|
|
263
|
-
prompt: number;
|
|
264
|
-
completion: number;
|
|
265
|
-
};
|
|
266
|
-
displayName: string;
|
|
267
|
-
};
|
|
268
|
-
'gemini-2.0-flash-lite': {
|
|
269
|
-
maxTokens: number;
|
|
270
|
-
cost: {
|
|
271
|
-
prompt: number;
|
|
272
|
-
completion: number;
|
|
273
|
-
};
|
|
274
|
-
displayName: string;
|
|
275
|
-
};
|
|
276
|
-
'gemini-1.5-pro': {
|
|
277
|
-
maxTokens: number;
|
|
278
|
-
cost: {
|
|
279
|
-
prompt: number;
|
|
280
|
-
completion: number;
|
|
281
|
-
};
|
|
282
|
-
displayName: string;
|
|
283
|
-
};
|
|
284
|
-
'gemini-1.5-flash': {
|
|
285
|
-
maxTokens: number;
|
|
286
|
-
cost: {
|
|
287
|
-
prompt: number;
|
|
288
|
-
completion: number;
|
|
289
|
-
};
|
|
290
|
-
displayName: string;
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
readonly custom: {};
|
|
115
|
+
google: Record<string, ChatV2ModelInfo>;
|
|
116
|
+
custom: {};
|
|
294
117
|
};
|
|
295
118
|
export declare function getChatV2ModelInfo(provider: ChatV2Provider, modelId: string): ChatV2ModelInfo | undefined;
|
|
296
119
|
export declare function calculateChatV2Cost(provider: ChatV2Provider, modelId: string, promptTokens: number, completionTokens: number): number | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Estimates a call only when the provider reported both billable text-token
|
|
122
|
+
* counts. Cache discounts, long-context premiums, and provider tool fees stay
|
|
123
|
+
* outside this baseline estimate until their billing inputs are modeled.
|
|
124
|
+
*/
|
|
125
|
+
export declare function calculateChatV2UsageCost(provider: ChatV2Provider, modelId: string, usage: TokenUsageForCost | undefined): number | undefined;
|
|
126
|
+
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ChatV2Provider, ChatV2ProviderOptions } from './chatV2Types.js';
|
|
2
|
-
|
|
2
|
+
import { type CustomProviderApi } from './customProviderApi.js';
|
|
3
|
+
export declare const LLM_CHAT_V2_PARALLEL_TOOL_CALLS_HELPER_MESSAGE = "Allows the model to request multiple tool calls in one round.";
|
|
3
4
|
export declare function supportsLLMChatV2ParallelToolCalls(provider: ChatV2Provider): boolean;
|
|
4
5
|
export declare function applyLLMChatV2ParallelToolCallProviderOptions(params: {
|
|
5
6
|
provider: ChatV2Provider;
|
|
6
7
|
useToolCalling: boolean | undefined;
|
|
7
8
|
parallelToolCalls: boolean | undefined;
|
|
9
|
+
customProviderApi?: CustomProviderApi | undefined;
|
|
8
10
|
providerOptions: ChatV2ProviderOptions | undefined;
|
|
9
11
|
}): ChatV2ProviderOptions | undefined;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
2
|
+
import { type CustomProviderApi } from './customProviderApi.js';
|
|
2
3
|
import type { ChatV2Model, ChatV2Provider } from './chatV2Types.js';
|
|
4
|
+
export { customProviderApiOptions, getCustomProviderApiContract, parseCustomProviderApi, type CustomProviderApi, type CustomProviderApiContract, } from './customProviderApi.js';
|
|
3
5
|
export declare const chatV2ProviderOptions: readonly [{
|
|
4
6
|
readonly value: "openai";
|
|
5
7
|
readonly label: "OpenAI";
|
|
@@ -49,11 +51,20 @@ export type CreateChatV2ModelOptions = {
|
|
|
49
51
|
baseURL?: string | undefined;
|
|
50
52
|
headers?: Record<string, string> | undefined;
|
|
51
53
|
onRequestBody?: ((body: unknown) => void) | undefined;
|
|
54
|
+
onResponseBody?: ((response: Response) => void) | undefined;
|
|
55
|
+
transformRequestBody?: ((body: unknown) => unknown) | undefined;
|
|
56
|
+
customProviderApi?: CustomProviderApi | undefined;
|
|
57
|
+
endpointQuery?: ReadonlyArray<readonly [string, string]> | undefined;
|
|
52
58
|
};
|
|
53
59
|
export type ResolveChatV2ProviderConfigContext = Pick<InternalProcessContext, 'getPluginConfig' | 'settings'>;
|
|
54
60
|
export type ResolvedChatV2ProviderConfig = {
|
|
55
61
|
baseURL?: string | undefined;
|
|
56
62
|
headers?: Record<string, string> | undefined;
|
|
63
|
+
endpointQuery?: Array<[string, string]> | undefined;
|
|
64
|
+
};
|
|
65
|
+
export declare function normalizeOpenAICompatibleEndpoint(endpoint: string): {
|
|
66
|
+
baseURL: string;
|
|
67
|
+
endpointQuery: Array<[string, string]>;
|
|
57
68
|
};
|
|
58
69
|
export declare function openAICompatibleEndpointToBaseURL(endpoint: string): string;
|
|
59
70
|
export declare function resolveChatV2ProviderConfig(provider: ChatV2Provider, _modelId: string, context: ResolveChatV2ProviderConfigContext, options?: CreateChatV2ModelOptions): Promise<ResolvedChatV2ProviderConfig>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GptFunction } from '../DataValue.js';
|
|
2
|
+
/**
|
|
3
|
+
* Canonical Rivet tool declaration lookup. Provider projections historically
|
|
4
|
+
* use last declaration wins for duplicate names; retain that compatibility in
|
|
5
|
+
* one explicit place.
|
|
6
|
+
*/
|
|
7
|
+
export type RivetToolRegistry = {
|
|
8
|
+
byName: ReadonlyMap<string, GptFunction>;
|
|
9
|
+
names: ReadonlySet<string>;
|
|
10
|
+
};
|
|
11
|
+
export declare function createRivetToolRegistry(functions: readonly GptFunction[] | undefined): RivetToolRegistry;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChatMessage, ParsedAssistantChatMessageFunctionCall } from '../DataValue.js';
|
|
2
|
+
import type { DelegatedToolCallRecord } from '../nodes/toolCallDelegation.js';
|
|
3
|
+
/** Provider/tool boundary codec shared by internal and connected delegation. */
|
|
4
|
+
export declare function normalizeToolCall(input: unknown): ParsedAssistantChatMessageFunctionCall;
|
|
5
|
+
export declare function createToolResultMessage(toolCall: ParsedAssistantChatMessageFunctionCall, output: string): ChatMessage;
|
|
6
|
+
export declare function createDelegatedToolCallRecord(toolCall: ParsedAssistantChatMessageFunctionCall, output: string, executionTimeMs?: number): DelegatedToolCallRecord;
|
|
7
|
+
export declare function stringifyToolResult(output: unknown): string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { ChatMessageDataValue, GptFunction } from '../DataValue.js';
|
|
2
|
-
import type { ChatV2PipelineResult,
|
|
2
|
+
import type { ChatV2PipelineResult, ChatV2PipelineRoundOptions } from './chatV2Types.js';
|
|
3
3
|
import type { StreamedFunctionCall } from '../chat/streamChatResponse.js';
|
|
4
4
|
import type { DelegatedToolCallRecord } from '../nodes/toolCallDelegation.js';
|
|
5
|
-
export type ToolContinuationOptions =
|
|
5
|
+
export type ToolContinuationOptions = ChatV2PipelineRoundOptions & {
|
|
6
6
|
autoContinue: boolean;
|
|
7
7
|
maxToolRounds: number;
|
|
8
8
|
functions: GptFunction[] | undefined;
|
|
9
9
|
delegateToolCall: (toolCall: StreamedFunctionCall) => Promise<ToolContinuationToolResult>;
|
|
10
10
|
delegateToolCallRound?: (toolCalls: StreamedFunctionCall[], preToolMessage: string) => Promise<ToolContinuationToolResult[]>;
|
|
11
|
-
runPipeline
|
|
11
|
+
runPipeline: (options: ChatV2PipelineRoundOptions) => Promise<ChatV2PipelineResult>;
|
|
12
12
|
};
|
|
13
13
|
export type ToolContinuationToolResult = ChatMessageDataValue & {
|
|
14
14
|
delegatedToolCall?: DelegatedToolCallRecord;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { GraphId } from '../NodeGraph.js';
|
|
2
|
+
import type { Project } from '../Project.js';
|
|
3
|
+
import type { ToolCallDelegationConfig } from '../nodes/toolCallDelegation.js';
|
|
4
|
+
export type ResolvedToolHandler = {
|
|
5
|
+
kind: 'graph';
|
|
6
|
+
graphId: GraphId;
|
|
7
|
+
graphName?: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'external';
|
|
10
|
+
name: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'unknown';
|
|
13
|
+
graphId: GraphId;
|
|
14
|
+
};
|
|
15
|
+
export declare function findAutoDelegateGraphCandidate<T>(candidates: readonly T[], toolName: string, getGraphName: (candidate: T) => string | undefined): T | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Preserves legacy exact-name then first fuzzy auto-delegation matching in a
|
|
18
|
+
* single resolver, making all runtime paths use identical routing.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveToolHandler(params: {
|
|
21
|
+
project: Project;
|
|
22
|
+
toolName: string;
|
|
23
|
+
config: ToolCallDelegationConfig;
|
|
24
|
+
hasExternalFunction: boolean;
|
|
25
|
+
}): ResolvedToolHandler | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StreamedFunctionCall } from '../chat/streamChatResponse.js';
|
|
2
|
+
import type { ToolContinuationToolResult } from './toolContinuation.js';
|
|
3
|
+
/** Provider-neutral contract for one complete model tool-call round. */
|
|
4
|
+
export type ToolRoundExecutor = {
|
|
5
|
+
executeRound(params: {
|
|
6
|
+
calls: readonly StreamedFunctionCall[];
|
|
7
|
+
assistantMessage: string;
|
|
8
|
+
}): Promise<readonly ToolContinuationToolResult[]>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Adapts the legacy individual/round callbacks without changing their
|
|
12
|
+
* concurrency semantics: a connected host owns a full round; internal
|
|
13
|
+
* delegation starts independent calls in parallel.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createCallbackToolRoundExecutor(params: {
|
|
16
|
+
delegateOne: (call: StreamedFunctionCall) => Promise<ToolContinuationToolResult>;
|
|
17
|
+
delegateRound?: ((calls: StreamedFunctionCall[], assistantMessage: string) => Promise<ToolContinuationToolResult[]>) | undefined;
|
|
18
|
+
}): ToolRoundExecutor;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type ChartNode, type NodeConnection, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
2
|
import { NodeImpl, type NodeBody, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
+
import { type ChatMessage } from '../DataValue.js';
|
|
3
4
|
import { type Inputs, type Outputs } from '../GraphProcessor.js';
|
|
4
5
|
import type { EditorDefinition } from '../EditorDefinition.js';
|
|
5
6
|
import type { RivetUIContext } from '../RivetUIContext.js';
|
|
6
7
|
export type AssembleMessageNode = ChartNode<'assembleMessage', AssembleMessageNodeData>;
|
|
7
8
|
export type AssembleMessageNodeData = {
|
|
8
|
-
type: '
|
|
9
|
+
type: ChatMessage['type'];
|
|
9
10
|
useTypeInput: boolean;
|
|
10
11
|
toolCallId: string;
|
|
11
12
|
useToolCallIdInput?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ChartNode, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
-
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
2
|
+
import { NodeImpl, type NodeRunActivityDescriptor, type NodeUIData } from '../NodeImpl.js';
|
|
3
3
|
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
4
4
|
import { type InternalProcessContext } from '../ProcessContext.js';
|
|
5
5
|
import { type EditorDefinition } from '../../index.js';
|
|
@@ -9,6 +9,7 @@ export declare class ChatNodeImpl extends NodeImpl<ChatNode> {
|
|
|
9
9
|
static create(): ChatNode;
|
|
10
10
|
getInputDefinitions(): NodeInputDefinition[];
|
|
11
11
|
getOutputDefinitions(): NodeOutputDefinition[];
|
|
12
|
+
getRunActivityDescriptor(): NodeRunActivityDescriptor;
|
|
12
13
|
static getUIData(): NodeUIData;
|
|
13
14
|
getEditors(): EditorDefinition<ChatNode>[];
|
|
14
15
|
getBody(): string | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChartNode, NodeInputDefinition, NodeOutputDefinition } from '../NodeBase.js';
|
|
2
2
|
import type { GraphId } from '../NodeGraph.js';
|
|
3
|
-
import { NodeImpl, type NodeBody, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
+
import { NodeImpl, type NodeBody, type NodeRunActivityDescriptor, type NodeUIData } from '../NodeImpl.js';
|
|
4
4
|
import type { EditorDefinition } from '../EditorDefinition.js';
|
|
5
5
|
import type { RivetUIContext } from '../RivetUIContext.js';
|
|
6
6
|
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
@@ -20,6 +20,7 @@ export declare class DelegateFunctionCallNodeImpl extends NodeImpl<DelegateFunct
|
|
|
20
20
|
static create(): DelegateFunctionCallNode;
|
|
21
21
|
getInputDefinitions(): NodeInputDefinition[];
|
|
22
22
|
getOutputDefinitions(): NodeOutputDefinition[];
|
|
23
|
+
getRunActivityDescriptor(): NodeRunActivityDescriptor;
|
|
23
24
|
static getUIData(): NodeUIData;
|
|
24
25
|
getEditors(): EditorDefinition<DelegateFunctionCallNode>[];
|
|
25
26
|
getBody(context: RivetUIContext): NodeBody;
|
|
@@ -2,7 +2,7 @@ import type { EditorDefinition } from '../EditorDefinition.js';
|
|
|
2
2
|
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
3
3
|
import type { NodeInputDefinition, NodeOutputDefinition } from '../NodeBase.js';
|
|
4
4
|
import type { NodeBodySpec } from '../NodeBodySpec.js';
|
|
5
|
-
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
5
|
+
import { NodeImpl, type NodeRunActivityDescriptor, type NodeUIData } from '../NodeImpl.js';
|
|
6
6
|
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
7
7
|
import type { RivetUIContext } from '../RivetUIContext.js';
|
|
8
8
|
import { type LLMChatV2Node } from '../chat-v2/llmChatV2NodeData.js';
|
|
@@ -11,6 +11,7 @@ export type { LLMChatV2ApiKeySource, LLMChatV2EditorCacheKeyParts, LLMChatV2Node
|
|
|
11
11
|
export { buildLLMChatV2EditorCacheKey, resolveLLMChatV2RuntimeProviderOptions };
|
|
12
12
|
export declare class LLMChatV2NodeImpl extends NodeImpl<LLMChatV2Node> {
|
|
13
13
|
static create(): LLMChatV2Node;
|
|
14
|
+
getRunActivityDescriptor(): NodeRunActivityDescriptor;
|
|
14
15
|
getInputDefinitions(): NodeInputDefinition[];
|
|
15
16
|
getOutputDefinitions(): NodeOutputDefinition[];
|
|
16
17
|
static getUIData(): NodeUIData;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorDefinition } from '../EditorDefinition.js';
|
|
2
2
|
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
3
3
|
import type { ChartNode, NodeInputDefinition, NodeOutputDefinition } from '../NodeBase.js';
|
|
4
|
+
import type { NodeBodySpec } from '../NodeBodySpec.js';
|
|
4
5
|
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
5
6
|
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
6
7
|
import type { RivetUIContext } from '../RivetUIContext.js';
|
|
@@ -13,7 +14,7 @@ export declare class LLMProfileNodeImpl extends NodeImpl<LLMProfileNode> {
|
|
|
13
14
|
getInputDefinitions(): NodeInputDefinition[];
|
|
14
15
|
getOutputDefinitions(): NodeOutputDefinition[];
|
|
15
16
|
getEditors(context: RivetUIContext): Promise<EditorDefinition<LLMProfileNode>[]>;
|
|
16
|
-
getBody():
|
|
17
|
+
getBody(): NodeBodySpec;
|
|
17
18
|
static getUIData(): NodeUIData;
|
|
18
19
|
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
19
20
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type ChartNode, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
1
|
+
import { type ChartNode, type NodeInputDefinition, type PortId, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
2
|
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
-
import { type EditorDefinition, type Inputs, type InternalProcessContext, type NodeBodySpec, type Outputs } from '../../index.js';
|
|
3
|
+
import { type ChatMessage, type EditorDefinition, type Inputs, type InternalProcessContext, type NodeBodySpec, type Outputs } from '../../index.js';
|
|
4
4
|
export type PromptNode = ChartNode<'prompt', PromptNodeData>;
|
|
5
5
|
export type PromptNodeData = {
|
|
6
|
-
type: '
|
|
6
|
+
type: ChatMessage['type'];
|
|
7
7
|
useTypeInput: boolean;
|
|
8
8
|
promptText: string;
|
|
9
9
|
name?: string;
|
|
@@ -17,6 +17,9 @@ export declare class PromptNodeImpl extends NodeImpl<PromptNode> {
|
|
|
17
17
|
static create(): PromptNode;
|
|
18
18
|
getInputDefinitions(): NodeInputDefinition[];
|
|
19
19
|
getOutputDefinitions(): NodeOutputDefinition[];
|
|
20
|
+
getRunActivityDescriptor(): {
|
|
21
|
+
primaryOutputPortId: PortId;
|
|
22
|
+
};
|
|
20
23
|
getEditors(): EditorDefinition<PromptNode>[];
|
|
21
24
|
getBody(): string | NodeBodySpec | NodeBodySpec[] | undefined;
|
|
22
25
|
static getUIData(): NodeUIData;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ChartNode, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
-
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
2
|
+
import { NodeImpl, type NodeRunActivityDescriptor, type NodeUIData } from '../NodeImpl.js';
|
|
3
3
|
import { type EditorDefinition } from '../EditorDefinition.js';
|
|
4
4
|
import { type NodeBodySpec } from '../NodeBodySpec.js';
|
|
5
5
|
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
@@ -19,6 +19,7 @@ export declare class GptFunctionNodeImpl extends NodeImpl<GptFunctionNode> {
|
|
|
19
19
|
static create(): GptFunctionNode;
|
|
20
20
|
getInputDefinitions(): NodeInputDefinition[];
|
|
21
21
|
getOutputDefinitions(): NodeOutputDefinition[];
|
|
22
|
+
getRunActivityDescriptor(): NodeRunActivityDescriptor;
|
|
22
23
|
getEditors(): EditorDefinition<GptFunctionNode>[];
|
|
23
24
|
getBody(): string | NodeBodySpec | undefined;
|
|
24
25
|
static getUIData(): NodeUIData;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChatMessage } from '../DataValue.js';
|
|
2
2
|
import type { GraphId } from '../NodeGraph.js';
|
|
3
3
|
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
4
4
|
import type { Outputs } from '../GraphProcessor.js';
|
|
5
|
+
import { normalizeToolCall } from '../chat-v2/toolCallCodec.js';
|
|
6
|
+
import { findAutoDelegateGraphCandidate } from '../chat-v2/toolHandlerResolver.js';
|
|
5
7
|
export type ToolCallDelegationConfig = {
|
|
6
8
|
handlers: {
|
|
7
9
|
key: string | undefined;
|
|
@@ -18,6 +20,8 @@ export type ToolCallDelegationResult = {
|
|
|
18
20
|
record: DelegatedToolCallRecord;
|
|
19
21
|
/** Cost from this live delegation. Kept out of the replay record so replay cannot charge it again. */
|
|
20
22
|
cost?: number;
|
|
23
|
+
/** Internal trace disposition; never exposed through node ports. */
|
|
24
|
+
traceOutcome?: 'success' | 'passthrough-error';
|
|
21
25
|
};
|
|
22
26
|
export type DelegatedToolCallRecord = {
|
|
23
27
|
delegatedToolCall: true;
|
|
@@ -25,6 +29,8 @@ export type DelegatedToolCallRecord = {
|
|
|
25
29
|
arguments: Record<string, unknown>;
|
|
26
30
|
id?: string;
|
|
27
31
|
output: string;
|
|
32
|
+
/** Milliseconds spent running the handler graph or external function. Absent on legacy records. */
|
|
33
|
+
executionTimeMs?: number;
|
|
28
34
|
message: ChatMessage;
|
|
29
35
|
};
|
|
30
36
|
/**
|
|
@@ -35,8 +41,9 @@ export type DelegatedToolCallRecord = {
|
|
|
35
41
|
* entries and uses their map keys. Keeping that distinction here preserves the
|
|
36
42
|
* existing behavior for malformed projects where those identities disagree.
|
|
37
43
|
*/
|
|
38
|
-
export
|
|
44
|
+
export { findAutoDelegateGraphCandidate };
|
|
39
45
|
export declare function isDelegatedToolCallRecord(input: unknown): input is DelegatedToolCallRecord;
|
|
40
46
|
export declare function buildDelegatedToolCallOutputs(records: DelegatedToolCallRecord[], preToolMessage?: string, cost?: number): Outputs;
|
|
41
|
-
|
|
47
|
+
/** @deprecated Use normalizeToolCall from the canonical chat-v2 codec. */
|
|
48
|
+
export declare const normalizeFunctionCallInput: typeof normalizeToolCall;
|
|
42
49
|
export declare function delegateToolCall(rawFunctionCall: unknown, context: InternalProcessContext, config: ToolCallDelegationConfig): Promise<ToolCallDelegationResult>;
|
|
@@ -69,19 +69,13 @@ export declare const generativeAiGoogleModels: {
|
|
|
69
69
|
};
|
|
70
70
|
'gemini-1.5-pro': {
|
|
71
71
|
maxTokens: number;
|
|
72
|
-
cost: {
|
|
73
|
-
prompt: number;
|
|
74
|
-
completion: number;
|
|
75
|
-
};
|
|
76
72
|
displayName: string;
|
|
73
|
+
pricing: "unpriced";
|
|
77
74
|
};
|
|
78
75
|
'gemini-1.5-flash': {
|
|
79
76
|
maxTokens: number;
|
|
80
|
-
cost: {
|
|
81
|
-
prompt: number;
|
|
82
|
-
completion: number;
|
|
83
|
-
};
|
|
84
77
|
displayName: string;
|
|
78
|
+
pricing: "unpriced";
|
|
85
79
|
};
|
|
86
80
|
};
|
|
87
81
|
export type GenerativeAiGoogleModel = keyof typeof generativeAiGoogleModels;
|
|
@@ -98,6 +92,7 @@ export type ChatCompletionOptions = {
|
|
|
98
92
|
location: string;
|
|
99
93
|
applicationCredentials: string;
|
|
100
94
|
model: GoogleModelsDeprecated;
|
|
95
|
+
systemPrompt?: string;
|
|
101
96
|
prompt: Content[];
|
|
102
97
|
max_output_tokens: number;
|
|
103
98
|
temperature?: number;
|
|
@@ -111,6 +106,16 @@ export type ChatCompletionChunk = {
|
|
|
111
106
|
finish_reason: 'FINISH_REASON_UNSPECIFIED' | 'FINISH_REASON_STOP' | 'FINISH_REASON_MAX_TOKENS' | 'FINISH_REASON_SAFETY' | 'FINISH_REASON_RECITATION' | 'FINISH_REASON_OTHER' | undefined;
|
|
112
107
|
model: string;
|
|
113
108
|
};
|
|
109
|
+
export declare function getVertexGenerativeModelOptions(options: Pick<ChatCompletionOptions, 'model' | 'systemPrompt' | 'max_output_tokens' | 'temperature' | 'top_p' | 'top_k'>): {
|
|
110
|
+
model: "gemini-pro" | "gemini-pro-vision";
|
|
111
|
+
systemInstruction: string | undefined;
|
|
112
|
+
generationConfig: {
|
|
113
|
+
maxOutputTokens: number;
|
|
114
|
+
temperature: number | undefined;
|
|
115
|
+
topP: number | undefined;
|
|
116
|
+
topK: number | undefined;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
114
119
|
export type StreamGenerativeAiOptions = {
|
|
115
120
|
apiKey: string;
|
|
116
121
|
model: GenerativeAiGoogleModel;
|
|
@@ -126,4 +131,4 @@ export type StreamGenerativeAiOptions = {
|
|
|
126
131
|
additionalHeaders?: Record<string, string>;
|
|
127
132
|
};
|
|
128
133
|
export declare function streamGenerativeAi({ apiKey, model, systemPrompt, prompt, maxOutputTokens, temperature, topP, topK, signal, tools, thinkingBudget, additionalHeaders, }: StreamGenerativeAiOptions): AsyncGenerator<ChatCompletionChunk>;
|
|
129
|
-
export declare function streamChatCompletions({ project, location, applicationCredentials, model, signal, max_output_tokens, temperature, top_p, top_k, prompt, }: ChatCompletionOptions): AsyncGenerator<ChatCompletionChunk>;
|
|
134
|
+
export declare function streamChatCompletions({ project, location, applicationCredentials, model, signal, max_output_tokens, temperature, top_p, top_k, systemPrompt, prompt, }: ChatCompletionOptions): AsyncGenerator<ChatCompletionChunk>;
|
|
@@ -31,5 +31,6 @@ export type ChatGoogleNodeData = ChatGoogleNodeConfigData & {
|
|
|
31
31
|
export declare const ChatGoogleNodeImpl: PluginNodeImpl<ChatGoogleNode>;
|
|
32
32
|
export declare const chatGoogleNode: import("../../../index.js").PluginNodeDefinition<ChatGoogleNode>;
|
|
33
33
|
export declare function getChatGoogleNodeMessages(inputs: Inputs): {
|
|
34
|
-
messages: import("../../../index.js").
|
|
34
|
+
messages: (import("../../../index.js").UserChatMessage | import("../../../index.js").AssistantChatMessage | import("../../../index.js").FunctionResponseChatMessage)[];
|
|
35
|
+
systemPrompt: string | undefined;
|
|
35
36
|
};
|
|
@@ -42,13 +42,16 @@ export type RecordedEventsMap = OverrideProperties<ProcessEvents, {
|
|
|
42
42
|
nodeStart: WithOptionalExecution<{
|
|
43
43
|
nodeId: NodeId;
|
|
44
44
|
inputs: Inputs;
|
|
45
|
+
inputConnections?: ProcessEvents['nodeStart']['inputConnections'];
|
|
45
46
|
processId: ProcessId;
|
|
47
|
+
resultOrigin?: ProcessEvents['nodeStart']['resultOrigin'];
|
|
46
48
|
}>;
|
|
47
49
|
/** Called when a node has finished processing, with the output values for the node. */
|
|
48
50
|
nodeFinish: WithOptionalExecution<{
|
|
49
51
|
nodeId: NodeId;
|
|
50
52
|
outputs: Outputs;
|
|
51
53
|
processId: ProcessId;
|
|
54
|
+
resultOrigin?: ProcessEvents['nodeFinish']['resultOrigin'];
|
|
52
55
|
durationMs?: number;
|
|
53
56
|
splitRunDurationMs?: Record<number, number>;
|
|
54
57
|
}>;
|
|
@@ -57,6 +60,7 @@ export type RecordedEventsMap = OverrideProperties<ProcessEvents, {
|
|
|
57
60
|
nodeId: NodeId;
|
|
58
61
|
error: string;
|
|
59
62
|
processId: ProcessId;
|
|
63
|
+
resultOrigin?: ProcessEvents['nodeError']['resultOrigin'];
|
|
60
64
|
durationMs?: number;
|
|
61
65
|
splitRunDurationMs?: Record<number, number>;
|
|
62
66
|
}>;
|
|
@@ -67,6 +71,7 @@ export type RecordedEventsMap = OverrideProperties<ProcessEvents, {
|
|
|
67
71
|
inputs: Inputs;
|
|
68
72
|
outputs: Outputs;
|
|
69
73
|
reason: string;
|
|
74
|
+
resultOrigin?: ProcessEvents['nodeExcluded']['resultOrigin'];
|
|
70
75
|
}>;
|
|
71
76
|
/** Called when a user input node requires user input. Call the callback when finished, or call userInput() on the GraphProcessor with the results. */
|
|
72
77
|
userInput: WithOptionalExecution<{
|
|
@@ -83,6 +88,7 @@ export type RecordedEventsMap = OverrideProperties<ProcessEvents, {
|
|
|
83
88
|
outputs: Outputs;
|
|
84
89
|
index: number;
|
|
85
90
|
processId: ProcessId;
|
|
91
|
+
resultOrigin?: ProcessEvents['partialOutput']['resultOrigin'];
|
|
86
92
|
}>;
|
|
87
93
|
progress: WithOptionalExecution<{
|
|
88
94
|
nodeId: NodeId;
|
|
@@ -5,7 +5,8 @@ import type Emittery from 'emittery';
|
|
|
5
5
|
* Use this instead of inline `// eslint-disable-next-line @typescript-eslint/no-floating-promises`
|
|
6
6
|
* to make the "detached async" intent explicit and auditable.
|
|
7
7
|
*
|
|
8
|
-
* The returned promise is intentionally
|
|
9
|
-
*
|
|
8
|
+
* The returned promise is intentionally detached and listener failures are
|
|
9
|
+
* contained. Call this only for observer events where listener completion or
|
|
10
|
+
* failure must not affect processor ordering.
|
|
10
11
|
*/
|
|
11
12
|
export declare function emitDetached<T extends Record<string, unknown>>(emitter: Emittery<T>, event: keyof T & string, data: T[keyof T & string]): void;
|