@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.
Files changed (188) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/bundle.cjs +5618 -2533
  3. package/dist/cjs/bundle.cjs.map +4 -4
  4. package/dist/cjs/webAppRuntime.cjs +333 -22
  5. package/dist/cjs/webAppRuntime.cjs.map +4 -4
  6. package/dist/esm/api/createProcessor.js +2 -0
  7. package/dist/esm/exports.js +1 -0
  8. package/dist/esm/integrations/CodeRunner.js +2 -7
  9. package/dist/esm/integrations/CodeRunnerOptions.js +7 -0
  10. package/dist/esm/model/AgentResponseTrace.js +558 -0
  11. package/dist/esm/model/ConnectedToolContinuationHost.js +33 -0
  12. package/dist/esm/model/GraphProcessor.js +165 -74
  13. package/dist/esm/model/NodeImpl.js +6 -0
  14. package/dist/esm/model/ProcessContextBuilder.js +3 -1
  15. package/dist/esm/model/RecordingPlayer.js +212 -25
  16. package/dist/esm/model/SplitRunProcessor.js +49 -8
  17. package/dist/esm/model/SubprocessorBridge.js +3 -0
  18. package/dist/esm/model/ToolCallContinuationCoordinator.js +7 -3
  19. package/dist/esm/model/UiGraph.js +21 -0
  20. package/dist/esm/model/UiGraphActionProtocol.js +3 -0
  21. package/dist/esm/model/UiGraphBrowserRuntime.js +133 -4
  22. package/dist/esm/model/UiGraphRendererStyles.js +221 -0
  23. package/dist/esm/model/UiGraphRuntimeModel.js +9 -3
  24. package/dist/esm/model/UiGraphSchema.js +7 -1
  25. package/dist/esm/model/chat/aiSdkTools.js +3 -2
  26. package/dist/esm/model/chat-v2/aiSdkBridge.js +146 -14
  27. package/dist/esm/model/chat-v2/chatV2CallObserver.js +11 -5
  28. package/dist/esm/model/chat-v2/chatV2CredentialNames.js +93 -0
  29. package/dist/esm/model/chat-v2/chatV2EditorCache.js +47 -20
  30. package/dist/esm/model/chat-v2/chatV2Errors.js +7 -19
  31. package/dist/esm/model/chat-v2/chatV2FeatureCompatibility.js +1 -1
  32. package/dist/esm/model/chat-v2/chatV2Outputs.js +48 -108
  33. package/dist/esm/model/chat-v2/chatV2Pipeline.js +101 -149
  34. package/dist/esm/model/chat-v2/chatV2ProviderProfile.js +39 -4
  35. package/dist/esm/model/chat-v2/chatV2ProviderRegistry.js +9 -0
  36. package/dist/esm/model/chat-v2/chatV2RequestPlan.js +2 -3
  37. package/dist/esm/model/chat-v2/chatV2ResponseBodyCapture.js +63 -0
  38. package/dist/esm/model/chat-v2/chatV2ResponseFormat.js +8 -4
  39. package/dist/esm/model/chat-v2/chatV2Retry.js +4 -3
  40. package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +7 -7
  41. package/dist/esm/model/chat-v2/chatV2Shared.js +1 -1
  42. package/dist/esm/model/chat-v2/chatV2Types.js +20 -8
  43. package/dist/esm/model/chat-v2/chatV2UsageAccounting.js +78 -0
  44. package/dist/esm/model/chat-v2/customProviderApi.js +40 -0
  45. package/dist/esm/model/chat-v2/index.js +15 -0
  46. package/dist/esm/model/chat-v2/llmChatV2Body.js +289 -0
  47. package/dist/esm/model/chat-v2/llmChatV2CacheBoundary.js +32 -0
  48. package/dist/esm/model/chat-v2/llmChatV2CachePolicy.js +25 -0
  49. package/dist/esm/model/chat-v2/llmChatV2NodeData.js +13 -50
  50. package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +117 -24
  51. package/dist/esm/model/chat-v2/llmChatV2NodeMigration.js +24 -0
  52. package/dist/esm/model/chat-v2/llmChatV2NodeRuntime.js +150 -199
  53. package/dist/esm/model/chat-v2/llmInvocationCoordinator.js +60 -0
  54. package/dist/esm/model/chat-v2/llmInvocationDecision.js +11 -0
  55. package/dist/esm/model/chat-v2/llmInvocationJournal.js +43 -0
  56. package/dist/esm/model/chat-v2/llmInvocationPlan.js +68 -0
  57. package/dist/esm/model/chat-v2/llmInvocationProjections.js +5 -0
  58. package/dist/esm/model/chat-v2/llmInvocationResultProjector.js +48 -0
  59. package/dist/esm/model/chat-v2/llmModelCandidate.js +79 -0
  60. package/dist/esm/model/chat-v2/llmProfile.js +52 -65
  61. package/dist/esm/model/chat-v2/llmProfileBody.js +193 -0
  62. package/dist/esm/model/chat-v2/llmProfileFallback.js +442 -100
  63. package/dist/esm/model/chat-v2/llmProfileFieldRegistry.js +74 -0
  64. package/dist/esm/model/chat-v2/llmProfileHealthStore.js +326 -0
  65. package/dist/esm/model/chat-v2/llmProfileNodeRuntime.js +55 -33
  66. package/dist/esm/model/chat-v2/llmProfileTypes.js +1 -18
  67. package/dist/esm/model/chat-v2/llmResponseMaterializer.js +42 -0
  68. package/dist/esm/model/chat-v2/modelRegistry.js +54 -4
  69. package/dist/esm/model/chat-v2/parallelToolCalls.js +9 -2
  70. package/dist/esm/model/chat-v2/providerOptions.js +116 -24
  71. package/dist/esm/model/chat-v2/rivetToolRegistry.js +9 -0
  72. package/dist/esm/model/chat-v2/toolCallCodec.js +52 -0
  73. package/dist/esm/model/chat-v2/toolContinuation.js +72 -35
  74. package/dist/esm/model/chat-v2/toolHandlerResolver.js +23 -0
  75. package/dist/esm/model/chat-v2/toolRoundExecutor.js +12 -0
  76. package/dist/esm/model/nodes/ChatNode.js +6 -0
  77. package/dist/esm/model/nodes/ChatNodeBase.js +1 -0
  78. package/dist/esm/model/nodes/CodeNewNode.js +5 -47
  79. package/dist/esm/model/nodes/CodeNode.js +4 -46
  80. package/dist/esm/model/nodes/DelegateFunctionCallNode.js +19 -6
  81. package/dist/esm/model/nodes/ExpressionNode.js +5 -8
  82. package/dist/esm/model/nodes/LLMChatV2Node.js +121 -229
  83. package/dist/esm/model/nodes/LLMProfileNode.js +27 -8
  84. package/dist/esm/model/nodes/MatchNode.js +86 -41
  85. package/dist/esm/model/nodes/PromptNode.js +7 -0
  86. package/dist/esm/model/nodes/ToolNode.js +7 -0
  87. package/dist/esm/model/nodes/toolCallDelegation.js +177 -110
  88. package/dist/esm/plugins/anthropic/anthropic.js +4 -4
  89. package/dist/esm/plugins/anthropic/nodes/ChatAnthropicNode.js +7 -0
  90. package/dist/esm/plugins/gentrace/gentraceSdk.js +0 -1
  91. package/dist/esm/plugins/gentrace/index.js +0 -1
  92. package/dist/esm/plugins/gentrace/plugin.js +61 -179
  93. package/dist/esm/plugins/google/google.js +5 -9
  94. package/dist/esm/plugins/google/nodes/ChatGoogleNode.js +4 -1
  95. package/dist/esm/plugins.js +1 -2
  96. package/dist/esm/recording/ExecutionRecorder.js +62 -13
  97. package/dist/esm/utils/emitDetached.js +6 -3
  98. package/dist/esm/utils/openai.js +60 -16
  99. package/dist/esm/utils/serialization/serialization.js +2 -19
  100. package/dist/esm/webAppRuntime.js +3 -2
  101. package/dist/types/api/createProcessor.d.ts +3 -0
  102. package/dist/types/exports.d.ts +1 -0
  103. package/dist/types/integrations/CodeRunner.d.ts +10 -7
  104. package/dist/types/integrations/CodeRunnerOptions.d.ts +15 -0
  105. package/dist/types/model/AgentResponseTrace.d.ts +123 -0
  106. package/dist/types/model/ConnectedToolContinuationHost.d.ts +34 -0
  107. package/dist/types/model/EditorDefinition.d.ts +16 -0
  108. package/dist/types/model/ExecutorProtocol.d.ts +32 -11
  109. package/dist/types/model/GraphProcessor.d.ts +41 -9
  110. package/dist/types/model/NodeBase.d.ts +0 -10
  111. package/dist/types/model/NodeImpl.d.ts +18 -1
  112. package/dist/types/model/Nodes.d.ts +2 -2
  113. package/dist/types/model/ProcessContext.d.ts +99 -0
  114. package/dist/types/model/ProcessContextBuilder.d.ts +3 -1
  115. package/dist/types/model/RecordingPlayer.d.ts +6 -0
  116. package/dist/types/model/SplitRunProcessor.d.ts +10 -3
  117. package/dist/types/model/UiGraph.d.ts +8 -0
  118. package/dist/types/model/UiGraphActionProtocol.d.ts +3 -0
  119. package/dist/types/model/UiGraphBrowserRuntime.d.ts +11 -2
  120. package/dist/types/model/UiGraphRendererStyles.d.ts +1 -1
  121. package/dist/types/model/UiGraphRuntimeModel.d.ts +2 -0
  122. package/dist/types/model/UiGraphSchema.d.ts +1 -0
  123. package/dist/types/model/chat-v2/chatV2CallObserver.d.ts +2 -0
  124. package/dist/types/model/chat-v2/chatV2CredentialNames.d.ts +30 -0
  125. package/dist/types/model/chat-v2/chatV2EditorCache.d.ts +2 -3
  126. package/dist/types/model/chat-v2/chatV2Outputs.d.ts +6 -16
  127. package/dist/types/model/chat-v2/chatV2Pipeline.d.ts +13 -17
  128. package/dist/types/model/chat-v2/chatV2ProviderProfile.d.ts +7 -0
  129. package/dist/types/model/chat-v2/chatV2ProviderRegistry.d.ts +8 -0
  130. package/dist/types/model/chat-v2/chatV2RequestPlan.d.ts +2 -2
  131. package/dist/types/model/chat-v2/chatV2ResponseBodyCapture.d.ts +25 -0
  132. package/dist/types/model/chat-v2/chatV2ResponseFormat.d.ts +3 -2
  133. package/dist/types/model/chat-v2/chatV2Retry.d.ts +2 -0
  134. package/dist/types/model/chat-v2/chatV2RuntimeOptions.d.ts +3 -8
  135. package/dist/types/model/chat-v2/chatV2Types.d.ts +44 -10
  136. package/dist/types/model/chat-v2/chatV2UsageAccounting.d.ts +14 -0
  137. package/dist/types/model/chat-v2/customProviderApi.d.ts +22 -0
  138. package/dist/types/model/chat-v2/index.d.ts +15 -0
  139. package/dist/types/model/chat-v2/llmChatV2Body.d.ts +24 -0
  140. package/dist/types/model/chat-v2/llmChatV2CacheBoundary.d.ts +10 -0
  141. package/dist/types/model/chat-v2/llmChatV2CachePolicy.d.ts +13 -0
  142. package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +19 -3
  143. package/dist/types/model/chat-v2/llmChatV2NodeMigration.d.ts +8 -0
  144. package/dist/types/model/chat-v2/llmChatV2NodeRuntime.d.ts +14 -16
  145. package/dist/types/model/chat-v2/llmInvocationCoordinator.d.ts +16 -0
  146. package/dist/types/model/chat-v2/llmInvocationDecision.d.ts +21 -0
  147. package/dist/types/model/chat-v2/llmInvocationJournal.d.ts +38 -0
  148. package/dist/types/model/chat-v2/llmInvocationPlan.d.ts +41 -0
  149. package/dist/types/model/chat-v2/llmInvocationProjections.d.ts +3 -0
  150. package/dist/types/model/chat-v2/llmInvocationResultProjector.d.ts +26 -0
  151. package/dist/types/model/chat-v2/llmModelCandidate.d.ts +20 -0
  152. package/dist/types/model/chat-v2/llmProfile.d.ts +14 -0
  153. package/dist/types/model/chat-v2/llmProfileBody.d.ts +20 -0
  154. package/dist/types/model/chat-v2/llmProfileFallback.d.ts +36 -49
  155. package/dist/types/model/chat-v2/llmProfileFieldRegistry.d.ts +209 -0
  156. package/dist/types/model/chat-v2/llmProfileHealthStore.d.ts +111 -0
  157. package/dist/types/model/chat-v2/llmProfileNodeRuntime.d.ts +1 -1
  158. package/dist/types/model/chat-v2/llmProfileTypes.d.ts +4 -1
  159. package/dist/types/model/chat-v2/llmResponseMaterializer.d.ts +20 -0
  160. package/dist/types/model/chat-v2/modelRegistry.d.ts +17 -187
  161. package/dist/types/model/chat-v2/parallelToolCalls.d.ts +3 -1
  162. package/dist/types/model/chat-v2/providerOptions.d.ts +12 -0
  163. package/dist/types/model/chat-v2/rivetToolRegistry.d.ts +11 -0
  164. package/dist/types/model/chat-v2/toolCallCodec.d.ts +7 -0
  165. package/dist/types/model/chat-v2/toolContinuation.d.ts +3 -3
  166. package/dist/types/model/chat-v2/toolHandlerResolver.d.ts +25 -0
  167. package/dist/types/model/chat-v2/toolRoundExecutor.d.ts +18 -0
  168. package/dist/types/model/nodes/ChatNode.d.ts +2 -1
  169. package/dist/types/model/nodes/CodeNewNode.d.ts +0 -5
  170. package/dist/types/model/nodes/CodeNode.d.ts +0 -5
  171. package/dist/types/model/nodes/DelegateFunctionCallNode.d.ts +2 -1
  172. package/dist/types/model/nodes/LLMChatV2Node.d.ts +2 -1
  173. package/dist/types/model/nodes/LLMProfileNode.d.ts +2 -1
  174. package/dist/types/model/nodes/MatchNode.d.ts +6 -0
  175. package/dist/types/model/nodes/PromptNode.d.ts +4 -1
  176. package/dist/types/model/nodes/ToolNode.d.ts +2 -1
  177. package/dist/types/model/nodes/toolCallDelegation.d.ts +10 -3
  178. package/dist/types/plugins/anthropic/anthropic.d.ts +1 -0
  179. package/dist/types/plugins/gentrace/gentraceSdk.d.ts +0 -1
  180. package/dist/types/plugins/gentrace/plugin.d.ts +55 -9
  181. package/dist/types/plugins/google/google.d.ts +2 -8
  182. package/dist/types/plugins.d.ts +1 -1
  183. package/dist/types/recording/ExecutionRecorder.d.ts +7 -1
  184. package/dist/types/recording/RecordedEvents.d.ts +6 -0
  185. package/dist/types/utils/emitDetached.d.ts +3 -2
  186. package/dist/types/utils/openai.d.ts +49 -0
  187. package/dist/types/webAppRuntime.d.ts +4 -2
  188. 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
- return 'Configured key uses Settings > LLM > Anthropic API Key in the Rivet editor, with ANTHROPIC_API_KEY as a desktop/Node fallback. Programmatic runs can pass anthropicApiKey or set ANTHROPIC_API_KEY.';
39
- case 'google':
40
- return 'Configured key uses Settings > LLM > Google API Key in the Rivet editor, with GOOGLE_GENERATIVE_AI_API_KEY as a desktop/Node fallback. Programmatic runs can pass googleApiKey or set GOOGLE_GENERATIVE_AI_API_KEY.';
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 getResponseFormatEditors() {
313
- return group('Response format', [
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: LLM_CHAT_V2_PARALLEL_TOOL_CALLS_HELPER_MESSAGE,
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: 'Max tool rounds',
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 response status',
416
- dataKey: 'outputRequestStatus',
417
- helperMessage: 'Adds a Response Status output. Retry mode returns statuses for each physical request. An LLM Profile array groups values by profile, while a profile with one request stays a number.',
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: 'Stream response',
428
- dataKey: 'useAsGraphPartialOutput',
429
- 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.',
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: 'Power-user Vercel providerOptions for the selected provider. Enter a JSON object; visible settings above override conflicting fields.',
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
- getResponseFormatEditors(),
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
+ }