@valerypopoff/rivet2-core 2.1.9 → 2.3.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/README.md +1 -1
- package/dist/cjs/bundle.cjs +5618 -2533
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/cjs/webAppRuntime.cjs +333 -22
- package/dist/cjs/webAppRuntime.cjs.map +4 -4
- package/dist/esm/api/createProcessor.js +2 -0
- package/dist/esm/exports.js +1 -0
- package/dist/esm/integrations/CodeRunner.js +2 -7
- package/dist/esm/integrations/CodeRunnerOptions.js +7 -0
- package/dist/esm/model/AgentResponseTrace.js +558 -0
- package/dist/esm/model/ConnectedToolContinuationHost.js +33 -0
- package/dist/esm/model/GraphProcessor.js +165 -74
- package/dist/esm/model/NodeImpl.js +6 -0
- package/dist/esm/model/ProcessContextBuilder.js +3 -1
- package/dist/esm/model/RecordingPlayer.js +212 -25
- package/dist/esm/model/SplitRunProcessor.js +49 -8
- package/dist/esm/model/SubprocessorBridge.js +3 -0
- package/dist/esm/model/ToolCallContinuationCoordinator.js +7 -3
- package/dist/esm/model/UiGraph.js +21 -0
- package/dist/esm/model/UiGraphActionProtocol.js +3 -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/aiSdkTools.js +3 -2
- package/dist/esm/model/chat-v2/aiSdkBridge.js +146 -14
- package/dist/esm/model/chat-v2/chatV2CallObserver.js +11 -5
- package/dist/esm/model/chat-v2/chatV2CredentialNames.js +93 -0
- package/dist/esm/model/chat-v2/chatV2EditorCache.js +47 -20
- 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 +48 -108
- package/dist/esm/model/chat-v2/chatV2Pipeline.js +101 -149
- package/dist/esm/model/chat-v2/chatV2ProviderProfile.js +39 -4
- package/dist/esm/model/chat-v2/chatV2ProviderRegistry.js +9 -0
- package/dist/esm/model/chat-v2/chatV2RequestPlan.js +2 -3
- package/dist/esm/model/chat-v2/chatV2ResponseBodyCapture.js +63 -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 +7 -7
- package/dist/esm/model/chat-v2/chatV2Shared.js +1 -1
- package/dist/esm/model/chat-v2/chatV2Types.js +20 -8
- package/dist/esm/model/chat-v2/chatV2UsageAccounting.js +78 -0
- package/dist/esm/model/chat-v2/customProviderApi.js +40 -0
- package/dist/esm/model/chat-v2/index.js +15 -0
- package/dist/esm/model/chat-v2/llmChatV2Body.js +289 -0
- package/dist/esm/model/chat-v2/llmChatV2CacheBoundary.js +32 -0
- package/dist/esm/model/chat-v2/llmChatV2CachePolicy.js +25 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeData.js +13 -50
- package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +117 -24
- package/dist/esm/model/chat-v2/llmChatV2NodeMigration.js +24 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeRuntime.js +150 -199
- 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 +79 -0
- package/dist/esm/model/chat-v2/llmProfile.js +52 -65
- package/dist/esm/model/chat-v2/llmProfileBody.js +193 -0
- package/dist/esm/model/chat-v2/llmProfileFallback.js +442 -100
- package/dist/esm/model/chat-v2/llmProfileFieldRegistry.js +74 -0
- package/dist/esm/model/chat-v2/llmProfileHealthStore.js +326 -0
- package/dist/esm/model/chat-v2/llmProfileNodeRuntime.js +55 -33
- 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/modelRegistry.js +54 -4
- package/dist/esm/model/chat-v2/parallelToolCalls.js +9 -2
- package/dist/esm/model/chat-v2/providerOptions.js +116 -24
- 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 -35
- 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/ChatNode.js +6 -0
- package/dist/esm/model/nodes/ChatNodeBase.js +1 -0
- package/dist/esm/model/nodes/CodeNewNode.js +5 -47
- package/dist/esm/model/nodes/CodeNode.js +4 -46
- package/dist/esm/model/nodes/DelegateFunctionCallNode.js +19 -6
- package/dist/esm/model/nodes/ExpressionNode.js +5 -8
- package/dist/esm/model/nodes/LLMChatV2Node.js +121 -229
- package/dist/esm/model/nodes/LLMProfileNode.js +27 -8
- package/dist/esm/model/nodes/MatchNode.js +86 -41
- package/dist/esm/model/nodes/PromptNode.js +7 -0
- package/dist/esm/model/nodes/ToolNode.js +7 -0
- package/dist/esm/model/nodes/toolCallDelegation.js +177 -110
- package/dist/esm/plugins/anthropic/anthropic.js +4 -4
- package/dist/esm/plugins/anthropic/nodes/ChatAnthropicNode.js +7 -0
- package/dist/esm/plugins/gentrace/gentraceSdk.js +0 -1
- package/dist/esm/plugins/gentrace/index.js +0 -1
- package/dist/esm/plugins/gentrace/plugin.js +61 -179
- package/dist/esm/plugins/google/google.js +5 -9
- package/dist/esm/plugins/google/nodes/ChatGoogleNode.js +4 -1
- package/dist/esm/plugins.js +1 -2
- package/dist/esm/recording/ExecutionRecorder.js +62 -13
- package/dist/esm/utils/emitDetached.js +6 -3
- package/dist/esm/utils/openai.js +60 -16
- package/dist/esm/utils/serialization/serialization.js +2 -19
- package/dist/esm/webAppRuntime.js +3 -2
- package/dist/types/api/createProcessor.d.ts +3 -0
- package/dist/types/exports.d.ts +1 -0
- package/dist/types/integrations/CodeRunner.d.ts +10 -7
- package/dist/types/integrations/CodeRunnerOptions.d.ts +15 -0
- package/dist/types/model/AgentResponseTrace.d.ts +123 -0
- package/dist/types/model/ConnectedToolContinuationHost.d.ts +34 -0
- package/dist/types/model/EditorDefinition.d.ts +16 -0
- package/dist/types/model/ExecutorProtocol.d.ts +32 -11
- package/dist/types/model/GraphProcessor.d.ts +41 -9
- package/dist/types/model/NodeBase.d.ts +0 -10
- 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 +99 -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 +10 -3
- package/dist/types/model/UiGraph.d.ts +8 -0
- package/dist/types/model/UiGraphActionProtocol.d.ts +3 -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/chatV2CredentialNames.d.ts +30 -0
- package/dist/types/model/chat-v2/chatV2EditorCache.d.ts +2 -3
- package/dist/types/model/chat-v2/chatV2Outputs.d.ts +6 -16
- package/dist/types/model/chat-v2/chatV2Pipeline.d.ts +13 -17
- package/dist/types/model/chat-v2/chatV2ProviderProfile.d.ts +7 -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 +25 -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/chatV2RuntimeOptions.d.ts +3 -8
- package/dist/types/model/chat-v2/chatV2Types.d.ts +44 -10
- package/dist/types/model/chat-v2/chatV2UsageAccounting.d.ts +14 -0
- package/dist/types/model/chat-v2/customProviderApi.d.ts +22 -0
- package/dist/types/model/chat-v2/index.d.ts +15 -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 +19 -3
- package/dist/types/model/chat-v2/llmChatV2NodeMigration.d.ts +8 -0
- package/dist/types/model/chat-v2/llmChatV2NodeRuntime.d.ts +14 -16
- 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 +20 -0
- package/dist/types/model/chat-v2/llmProfile.d.ts +14 -0
- package/dist/types/model/chat-v2/llmProfileBody.d.ts +20 -0
- package/dist/types/model/chat-v2/llmProfileFallback.d.ts +36 -49
- package/dist/types/model/chat-v2/llmProfileFieldRegistry.d.ts +209 -0
- package/dist/types/model/chat-v2/llmProfileHealthStore.d.ts +111 -0
- package/dist/types/model/chat-v2/llmProfileNodeRuntime.d.ts +1 -1
- package/dist/types/model/chat-v2/llmProfileTypes.d.ts +4 -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 +12 -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/ChatNode.d.ts +2 -1
- package/dist/types/model/nodes/CodeNewNode.d.ts +0 -5
- package/dist/types/model/nodes/CodeNode.d.ts +0 -5
- 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/MatchNode.d.ts +6 -0
- package/dist/types/model/nodes/PromptNode.d.ts +4 -1
- 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/gentrace/gentraceSdk.d.ts +0 -1
- package/dist/types/plugins/gentrace/plugin.d.ts +55 -9
- package/dist/types/plugins/google/google.d.ts +2 -8
- package/dist/types/plugins.d.ts +1 -1
- package/dist/types/recording/ExecutionRecorder.d.ts +7 -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
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { DEFAULT_LLM_CHAT_V2_RETRY_ON_NON_200_COOLDOWN_MS, DEFAULT_LLM_CHAT_V2_RETRY_ON_NON_200_REPEAT_TIMES, } from './chatV2Retry.js';
|
|
2
|
-
import { anthropicCacheControlTtlOptions, anthropicEffortOptions, anthropicThinkingModeOptions, chatV2ProviderOptions, getChatV2ModelOptions, googleThinkingLevelOptions, openAIReasoningEffortOptions, openAIWebSearchContextSizeOptions, } from './providerOptions.js';
|
|
2
|
+
import { anthropicCacheControlTtlOptions, anthropicEffortOptions, anthropicThinkingModeOptions, chatV2ProviderOptions, customProviderApiOptions, getChatV2ModelOptions, googleThinkingLevelOptions, openAIReasoningEffortOptions, openAIWebSearchContextSizeOptions, } from './providerOptions.js';
|
|
3
3
|
import { LLM_CHAT_V2_PARALLEL_TOOL_CALLS_HELPER_MESSAGE, supportsLLMChatV2ParallelToolCalls, } from './parallelToolCalls.js';
|
|
4
|
+
import { DEFAULT_LLM_PROFILE_CIRCUIT_FAILURE_THRESHOLD, DEFAULT_LLM_PROFILE_CIRCUIT_FAILURE_WINDOW_MS, DEFAULT_LLM_PROFILE_CIRCUIT_OPEN_DURATION_MS, DEFAULT_LLM_PROFILE_FIRST_OUTPUT_TIMEOUT_MS, DEFAULT_LLM_PROFILE_STREAM_INACTIVITY_TIMEOUT_MS, } from './llmProfileHealthStore.js';
|
|
5
|
+
import { getChatV2CredentialNamesForDisplay, isChatV2BuiltInProvider } from './chatV2CredentialNames.js';
|
|
4
6
|
const hideUnlessProvider = (provider) => (data) => data.provider !== provider;
|
|
5
7
|
function group(label, editors, defaultOpen) {
|
|
6
8
|
return {
|
|
@@ -33,11 +35,14 @@ function getApiKeySourceHelperMessage(data) {
|
|
|
33
35
|
}
|
|
34
36
|
switch (data.provider) {
|
|
35
37
|
case 'openai':
|
|
36
|
-
return 'Configured key uses Settings > LLM > OpenAI API Key in the Rivet editor, with OPENAI_API_KEY as a desktop/Node fallback. Programmatic runs can pass openAiApiKey or set OPENAI_API_KEY.';
|
|
37
38
|
case 'anthropic':
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
case 'google': {
|
|
40
|
+
const names = getChatV2CredentialNamesForDisplay(data.provider, data.providerApiKeyNames?.[data.provider]);
|
|
41
|
+
const hasOverride = data.providerApiKeyNames?.[data.provider] != null;
|
|
42
|
+
return hasOverride
|
|
43
|
+
? `Configured key checks ${names.programmaticName} first, then ${names.environmentVariableName}. This explicit override does not fall back to the shared provider key.`
|
|
44
|
+
: `Configured key uses ${names.programmaticName} or ${names.environmentVariableName}, including the existing Settings > LLM provider key.`;
|
|
45
|
+
}
|
|
41
46
|
case 'custom': {
|
|
42
47
|
const programmaticName = data.customProviderApiKeyProgrammaticName?.trim();
|
|
43
48
|
const envVarName = data.customProviderApiKeyEnvVarName?.trim() || 'CUSTOM_PROVIDER_API_KEY';
|
|
@@ -61,7 +66,16 @@ function getModelEditors(modelOptions) {
|
|
|
61
66
|
dataKey: 'customProviderBaseURL',
|
|
62
67
|
useInputToggleDataKey: 'useCustomProviderBaseURLInput',
|
|
63
68
|
placeholder: 'https://api.cerebras.ai/v1',
|
|
64
|
-
helperMessage: 'OpenAI-compatible provider base URL. Full /chat/completions URLs are accepted and normalized.',
|
|
69
|
+
helperMessage: 'OpenAI-compatible provider base URL. Full /chat/completions or /responses URLs are accepted and normalized.',
|
|
70
|
+
hideIf: hideUnlessProvider('custom'),
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: 'segmented',
|
|
74
|
+
label: 'API',
|
|
75
|
+
ariaLabel: 'Custom provider API',
|
|
76
|
+
dataKey: 'customProviderApi',
|
|
77
|
+
defaultValue: 'completions',
|
|
78
|
+
options: [...customProviderApiOptions],
|
|
65
79
|
hideIf: hideUnlessProvider('custom'),
|
|
66
80
|
},
|
|
67
81
|
{
|
|
@@ -84,6 +98,12 @@ function getModelEditors(modelOptions) {
|
|
|
84
98
|
],
|
|
85
99
|
helperMessage: getApiKeySourceHelperMessage,
|
|
86
100
|
},
|
|
101
|
+
{
|
|
102
|
+
type: 'custom',
|
|
103
|
+
label: 'Configured API key names',
|
|
104
|
+
customEditorId: 'LLMChatV2CredentialNames',
|
|
105
|
+
hideIf: (data) => !isChatV2BuiltInProvider(data.provider) || data.apiKeySource === 'input',
|
|
106
|
+
},
|
|
87
107
|
{
|
|
88
108
|
type: 'string',
|
|
89
109
|
label: 'Alternative programmatic key name',
|
|
@@ -105,6 +125,75 @@ function getModelEditors(modelOptions) {
|
|
|
105
125
|
function getProviderEditors() {
|
|
106
126
|
return [getOpenAIProviderEditors(), getAnthropicProviderEditors(), getGoogleProviderEditors()];
|
|
107
127
|
}
|
|
128
|
+
function getCircuitBreakerEditors() {
|
|
129
|
+
return group('LLM profile suspension', [
|
|
130
|
+
{
|
|
131
|
+
type: 'info',
|
|
132
|
+
label: "It's a hosted runtime capability",
|
|
133
|
+
helperMessage: 'This configuration is enforced by Rivet Studio Server or another host that explicitly provides shared LLM profile reliability. It has no effect in standalone Rivet.',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
type: 'toggle',
|
|
137
|
+
label: 'Enable automatic suspension',
|
|
138
|
+
dataKey: 'enableCircuitBreaker',
|
|
139
|
+
helperMessage: 'After provider failures or timeouts, temporarily suspend this profile in the LLM profiles fallback chain. When the suspension ends, one recovery attempt checks whether the profile can resume.',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
type: 'number',
|
|
143
|
+
label: 'Useful output wait time, seconds',
|
|
144
|
+
dataKey: 'firstOutputTimeoutMs',
|
|
145
|
+
defaultValue: DEFAULT_LLM_PROFILE_FIRST_OUTPUT_TIMEOUT_MS,
|
|
146
|
+
storageMultiplier: 1_000,
|
|
147
|
+
min: 1_000,
|
|
148
|
+
step: 1_000,
|
|
149
|
+
helperMessage: 'Maximum wait time for a non-stream response (or the first useful streamed output). A call that reaches this deadline falls back immediately, even before this profile is suspended.',
|
|
150
|
+
hideIf: (data) => data.enableCircuitBreaker !== true,
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
type: 'number',
|
|
154
|
+
label: 'Stream inactivity timeout, seconds',
|
|
155
|
+
dataKey: 'streamInactivityTimeoutMs',
|
|
156
|
+
defaultValue: DEFAULT_LLM_PROFILE_STREAM_INACTIVITY_TIMEOUT_MS,
|
|
157
|
+
storageMultiplier: 1_000,
|
|
158
|
+
min: 1_000,
|
|
159
|
+
step: 1_000,
|
|
160
|
+
helperMessage: 'Maximum gap between streamed response events before falling back.',
|
|
161
|
+
hideIf: (data) => data.enableCircuitBreaker !== true,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
type: 'number',
|
|
165
|
+
label: 'Failures before suspension',
|
|
166
|
+
dataKey: 'circuitBreakerFailureThreshold',
|
|
167
|
+
defaultValue: DEFAULT_LLM_PROFILE_CIRCUIT_FAILURE_THRESHOLD,
|
|
168
|
+
min: 1,
|
|
169
|
+
step: 1,
|
|
170
|
+
helperMessage: 'Failed or timed-out profile attempts required within the failure window before suspending this profile.',
|
|
171
|
+
hideIf: (data) => data.enableCircuitBreaker !== true,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: 'number',
|
|
175
|
+
label: 'Failure window, seconds',
|
|
176
|
+
dataKey: 'circuitBreakerFailureWindowMs',
|
|
177
|
+
defaultValue: DEFAULT_LLM_PROFILE_CIRCUIT_FAILURE_WINDOW_MS,
|
|
178
|
+
storageMultiplier: 1_000,
|
|
179
|
+
min: 1_000,
|
|
180
|
+
step: 1_000,
|
|
181
|
+
helperMessage: 'Failed or timed-out profile attempts inside this rolling window count toward suspension.',
|
|
182
|
+
hideIf: (data) => data.enableCircuitBreaker !== true,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'number',
|
|
186
|
+
label: 'Suspension duration, seconds',
|
|
187
|
+
dataKey: 'circuitBreakerOpenDurationMs',
|
|
188
|
+
defaultValue: DEFAULT_LLM_PROFILE_CIRCUIT_OPEN_DURATION_MS,
|
|
189
|
+
storageMultiplier: 1_000,
|
|
190
|
+
min: 1_000,
|
|
191
|
+
step: 1_000,
|
|
192
|
+
helperMessage: 'How long the fallback chain skips this profile before allowing one recovery attempt.',
|
|
193
|
+
hideIf: (data) => data.enableCircuitBreaker !== true,
|
|
194
|
+
},
|
|
195
|
+
]);
|
|
196
|
+
}
|
|
108
197
|
function getOpenAIProviderEditors() {
|
|
109
198
|
return providerGroup('openai', 'OpenAI', [
|
|
110
199
|
{
|
|
@@ -309,8 +398,8 @@ function getReasoningEditors() {
|
|
|
309
398
|
},
|
|
310
399
|
]);
|
|
311
400
|
}
|
|
312
|
-
function
|
|
313
|
-
return group('Response
|
|
401
|
+
function getResponseSettingsEditors() {
|
|
402
|
+
return group('Response settings', [
|
|
314
403
|
{
|
|
315
404
|
type: 'dropdown',
|
|
316
405
|
label: 'Response format',
|
|
@@ -324,6 +413,12 @@ function getResponseFormatEditors() {
|
|
|
324
413
|
defaultValue: '',
|
|
325
414
|
helperMessage: 'Uses Vercel AI SDK structured-output response formatting when supported by the provider. JSON schema adds a Response Schema input port.',
|
|
326
415
|
},
|
|
416
|
+
{
|
|
417
|
+
type: 'toggle',
|
|
418
|
+
label: 'Stream response',
|
|
419
|
+
dataKey: 'useAsGraphPartialOutput',
|
|
420
|
+
helperMessage: 'Shows streamed response updates in the node output while running in the editor. Other nodes only receive the final response after it is complete.',
|
|
421
|
+
},
|
|
327
422
|
{
|
|
328
423
|
type: 'string',
|
|
329
424
|
label: 'Schema name',
|
|
@@ -375,7 +470,9 @@ function getToolEditors() {
|
|
|
375
470
|
type: 'toggle',
|
|
376
471
|
label: 'Allow parallel toolcalls',
|
|
377
472
|
dataKey: 'parallelToolCalls',
|
|
378
|
-
helperMessage:
|
|
473
|
+
helperMessage: (data) => data.configurationMode === 'profile'
|
|
474
|
+
? `${LLM_CHAT_V2_PARALLEL_TOOL_CALLS_HELPER_MESSAGE} In From profile mode, it applies only to candidates whose providers support parallel tool calls; unsupported candidates ignore it.`
|
|
475
|
+
: LLM_CHAT_V2_PARALLEL_TOOL_CALLS_HELPER_MESSAGE,
|
|
379
476
|
hideIf: (data) => !data.useToolCalling ||
|
|
380
477
|
(data.configurationMode !== 'profile' && !supportsLLMChatV2ParallelToolCalls(data.provider)),
|
|
381
478
|
},
|
|
@@ -388,8 +485,9 @@ function getToolEditors() {
|
|
|
388
485
|
},
|
|
389
486
|
{
|
|
390
487
|
type: 'number',
|
|
391
|
-
label: '
|
|
488
|
+
label: 'Maximum tool rounds',
|
|
392
489
|
dataKey: 'maxToolRounds',
|
|
490
|
+
helperMessage: 'Each round may contain multiple parallel tool calls if not disallowed.',
|
|
393
491
|
min: 1,
|
|
394
492
|
step: 1,
|
|
395
493
|
hideIf: (data) => !data.useToolCalling || !data.autoContinueToolCalls,
|
|
@@ -412,9 +510,9 @@ function getOutputEditors() {
|
|
|
412
510
|
},
|
|
413
511
|
{
|
|
414
512
|
type: 'toggle',
|
|
415
|
-
label: 'Output
|
|
416
|
-
dataKey: '
|
|
417
|
-
helperMessage: 'Adds
|
|
513
|
+
label: 'Output LLM attempts',
|
|
514
|
+
dataKey: 'outputLLMAttempts',
|
|
515
|
+
helperMessage: 'Adds one chronological record for every profile configuration, provider request, and response-validation attempt. Records include provider, model, retry status, and provider error details when available.',
|
|
418
516
|
},
|
|
419
517
|
{
|
|
420
518
|
type: 'toggle',
|
|
@@ -424,9 +522,9 @@ function getOutputEditors() {
|
|
|
424
522
|
},
|
|
425
523
|
{
|
|
426
524
|
type: 'toggle',
|
|
427
|
-
label: '
|
|
428
|
-
dataKey: '
|
|
429
|
-
helperMessage: '
|
|
525
|
+
label: 'Output response body',
|
|
526
|
+
dataKey: 'outputResponseBody',
|
|
527
|
+
helperMessage: 'Adds the complete LLM response body captured at the provider HTTP boundary. JSON responses are parsed for inspection; other responses remain text. Rivet does not redact or truncate captured content.',
|
|
430
528
|
},
|
|
431
529
|
{
|
|
432
530
|
type: 'toggle',
|
|
@@ -453,7 +551,7 @@ function getProviderAdvancedEditors() {
|
|
|
453
551
|
dataKey: 'extraProviderOptions',
|
|
454
552
|
useInputToggleDataKey: 'useExtraProviderOptionsInput',
|
|
455
553
|
language: 'json',
|
|
456
|
-
helperMessage: '
|
|
554
|
+
helperMessage: 'Adds these exact top-level JSON fields to the provider request body. Field names are preserved, and these values override generated request fields with the same name.',
|
|
457
555
|
enableFolding: true,
|
|
458
556
|
},
|
|
459
557
|
]);
|
|
@@ -488,12 +586,6 @@ function getErrorBehaviorEditors() {
|
|
|
488
586
|
helperMessage: 'Milliseconds to wait between repeats',
|
|
489
587
|
hideIf: (data) => !data.retryOnNon200,
|
|
490
588
|
},
|
|
491
|
-
{
|
|
492
|
-
type: 'toggle',
|
|
493
|
-
label: 'Output response error',
|
|
494
|
-
dataKey: 'outputRequestError',
|
|
495
|
-
helperMessage: 'Adds a Response Error output. Provider request failures become excluded outputs instead of node errors. Retry mode returns errors for each physical request; an LLM Profile array groups errors by profile.',
|
|
496
|
-
},
|
|
497
589
|
]);
|
|
498
590
|
}
|
|
499
591
|
export async function getLLMChatV2Editors(data, context) {
|
|
@@ -512,7 +604,7 @@ export async function getLLMChatV2Editors(data, context) {
|
|
|
512
604
|
...(data.provider === 'custom' ? [] : [getReasoningEditors()]),
|
|
513
605
|
]
|
|
514
606
|
: []),
|
|
515
|
-
|
|
607
|
+
getResponseSettingsEditors(),
|
|
516
608
|
getToolEditors(),
|
|
517
609
|
getOutputEditors(),
|
|
518
610
|
...(!usesProfile ? [getProviderAdvancedEditors()] : []),
|
|
@@ -526,6 +618,7 @@ export async function getLLMProfileEditors(data, context) {
|
|
|
526
618
|
...getProviderEditors(),
|
|
527
619
|
getParameterEditors(),
|
|
528
620
|
...(profileData.provider === 'custom' ? [] : [getReasoningEditors()]),
|
|
621
|
+
getCircuitBreakerEditors(),
|
|
529
622
|
getProviderAdvancedEditors(),
|
|
530
623
|
];
|
|
531
624
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serialized LLM Chat migrations live beside the node contract, rather than
|
|
3
|
+
* making generic project serialization understand LLM-specific settings.
|
|
4
|
+
* This is deliberately idempotent because deserialization can normalize a
|
|
5
|
+
* graph more than once while it is imported or embedded in a prefab.
|
|
6
|
+
*/
|
|
7
|
+
export function normalizeSerializedLLMChatV2Node(node) {
|
|
8
|
+
if (node.type !== 'llmChatV2' || node.data == null || typeof node.data !== 'object') {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const data = node.data;
|
|
12
|
+
const hadLegacyRequestDiagnostics = data.outputRequestStatus === true || data.outputRequestError === true;
|
|
13
|
+
if (hadLegacyRequestDiagnostics && !Object.hasOwn(data, 'outputLLMAttempts')) {
|
|
14
|
+
data.outputLLMAttempts = true;
|
|
15
|
+
}
|
|
16
|
+
// The original request-details switch also enabled request-body capture.
|
|
17
|
+
// Preserve that still-supported diagnostic independently from the retired
|
|
18
|
+
// status/error ports.
|
|
19
|
+
if (data.outputRequestStatus === true && !Object.hasOwn(data, 'outputRequestBody')) {
|
|
20
|
+
data.outputRequestBody = true;
|
|
21
|
+
}
|
|
22
|
+
delete data.outputRequestStatus;
|
|
23
|
+
delete data.outputRequestError;
|
|
24
|
+
}
|