@valerypopoff/rivet2-core 2.1.9 → 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.
Files changed (155) hide show
  1. package/dist/cjs/bundle.cjs +3596 -1745
  2. package/dist/cjs/bundle.cjs.map +4 -4
  3. package/dist/cjs/webAppRuntime.cjs +298 -21
  4. package/dist/cjs/webAppRuntime.cjs.map +4 -4
  5. package/dist/esm/exports.js +1 -0
  6. package/dist/esm/model/AgentResponseTrace.js +448 -0
  7. package/dist/esm/model/ConnectedToolContinuationHost.js +33 -0
  8. package/dist/esm/model/GraphProcessor.js +151 -74
  9. package/dist/esm/model/NodeImpl.js +6 -0
  10. package/dist/esm/model/ProcessContextBuilder.js +3 -1
  11. package/dist/esm/model/RecordingPlayer.js +164 -22
  12. package/dist/esm/model/SplitRunProcessor.js +49 -8
  13. package/dist/esm/model/SubprocessorBridge.js +2 -0
  14. package/dist/esm/model/ToolCallContinuationCoordinator.js +7 -3
  15. package/dist/esm/model/UiGraph.js +21 -0
  16. package/dist/esm/model/UiGraphActionProtocol.js +2 -0
  17. package/dist/esm/model/UiGraphBrowserRuntime.js +133 -4
  18. package/dist/esm/model/UiGraphRendererStyles.js +221 -0
  19. package/dist/esm/model/UiGraphRuntimeModel.js +9 -3
  20. package/dist/esm/model/UiGraphSchema.js +7 -1
  21. package/dist/esm/model/chat/aiSdkTools.js +3 -2
  22. package/dist/esm/model/chat-v2/chatV2CallObserver.js +9 -5
  23. package/dist/esm/model/chat-v2/chatV2EditorCache.js +42 -16
  24. package/dist/esm/model/chat-v2/chatV2Errors.js +7 -19
  25. package/dist/esm/model/chat-v2/chatV2FeatureCompatibility.js +1 -1
  26. package/dist/esm/model/chat-v2/chatV2Outputs.js +48 -108
  27. package/dist/esm/model/chat-v2/chatV2Pipeline.js +61 -146
  28. package/dist/esm/model/chat-v2/chatV2ProviderProfile.js +8 -2
  29. package/dist/esm/model/chat-v2/chatV2ProviderRegistry.js +9 -0
  30. package/dist/esm/model/chat-v2/chatV2RequestPlan.js +2 -3
  31. package/dist/esm/model/chat-v2/chatV2ResponseBodyCapture.js +55 -0
  32. package/dist/esm/model/chat-v2/chatV2ResponseFormat.js +8 -4
  33. package/dist/esm/model/chat-v2/chatV2Retry.js +4 -3
  34. package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +6 -1
  35. package/dist/esm/model/chat-v2/chatV2Types.js +5 -9
  36. package/dist/esm/model/chat-v2/chatV2UsageAccounting.js +78 -0
  37. package/dist/esm/model/chat-v2/customProviderApi.js +42 -0
  38. package/dist/esm/model/chat-v2/index.js +12 -0
  39. package/dist/esm/model/chat-v2/llmChatV2Body.js +281 -0
  40. package/dist/esm/model/chat-v2/llmChatV2CacheBoundary.js +32 -0
  41. package/dist/esm/model/chat-v2/llmChatV2CachePolicy.js +20 -0
  42. package/dist/esm/model/chat-v2/llmChatV2NodeData.js +6 -50
  43. package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +25 -13
  44. package/dist/esm/model/chat-v2/llmChatV2NodeMigration.js +24 -0
  45. package/dist/esm/model/chat-v2/llmChatV2NodeRuntime.js +121 -193
  46. package/dist/esm/model/chat-v2/llmInvocationCoordinator.js +60 -0
  47. package/dist/esm/model/chat-v2/llmInvocationDecision.js +11 -0
  48. package/dist/esm/model/chat-v2/llmInvocationJournal.js +43 -0
  49. package/dist/esm/model/chat-v2/llmInvocationPlan.js +68 -0
  50. package/dist/esm/model/chat-v2/llmInvocationProjections.js +5 -0
  51. package/dist/esm/model/chat-v2/llmInvocationResultProjector.js +48 -0
  52. package/dist/esm/model/chat-v2/llmModelCandidate.js +75 -0
  53. package/dist/esm/model/chat-v2/llmProfile.js +10 -65
  54. package/dist/esm/model/chat-v2/llmProfileBody.js +183 -0
  55. package/dist/esm/model/chat-v2/llmProfileFallback.js +55 -99
  56. package/dist/esm/model/chat-v2/llmProfileFieldRegistry.js +67 -0
  57. package/dist/esm/model/chat-v2/llmProfileNodeRuntime.js +3 -0
  58. package/dist/esm/model/chat-v2/llmProfileTypes.js +1 -18
  59. package/dist/esm/model/chat-v2/llmResponseMaterializer.js +42 -0
  60. package/dist/esm/model/chat-v2/modelRegistry.js +54 -4
  61. package/dist/esm/model/chat-v2/parallelToolCalls.js +9 -2
  62. package/dist/esm/model/chat-v2/providerOptions.js +86 -20
  63. package/dist/esm/model/chat-v2/rivetToolRegistry.js +9 -0
  64. package/dist/esm/model/chat-v2/toolCallCodec.js +52 -0
  65. package/dist/esm/model/chat-v2/toolContinuation.js +72 -35
  66. package/dist/esm/model/chat-v2/toolHandlerResolver.js +23 -0
  67. package/dist/esm/model/chat-v2/toolRoundExecutor.js +12 -0
  68. package/dist/esm/model/nodes/ChatNode.js +6 -0
  69. package/dist/esm/model/nodes/ChatNodeBase.js +1 -0
  70. package/dist/esm/model/nodes/DelegateFunctionCallNode.js +19 -6
  71. package/dist/esm/model/nodes/LLMChatV2Node.js +112 -229
  72. package/dist/esm/model/nodes/LLMProfileNode.js +27 -8
  73. package/dist/esm/model/nodes/PromptNode.js +7 -0
  74. package/dist/esm/model/nodes/ToolNode.js +7 -0
  75. package/dist/esm/model/nodes/toolCallDelegation.js +177 -110
  76. package/dist/esm/plugins/anthropic/anthropic.js +4 -4
  77. package/dist/esm/plugins/anthropic/nodes/ChatAnthropicNode.js +7 -0
  78. package/dist/esm/plugins/google/google.js +5 -9
  79. package/dist/esm/plugins/google/nodes/ChatGoogleNode.js +4 -1
  80. package/dist/esm/recording/ExecutionRecorder.js +13 -5
  81. package/dist/esm/utils/emitDetached.js +6 -3
  82. package/dist/esm/utils/openai.js +60 -16
  83. package/dist/esm/utils/serialization/serialization.js +2 -19
  84. package/dist/esm/webAppRuntime.js +3 -2
  85. package/dist/types/exports.d.ts +1 -0
  86. package/dist/types/model/AgentResponseTrace.d.ts +110 -0
  87. package/dist/types/model/ConnectedToolContinuationHost.d.ts +34 -0
  88. package/dist/types/model/ExecutorProtocol.d.ts +25 -7
  89. package/dist/types/model/GraphProcessor.d.ts +27 -5
  90. package/dist/types/model/NodeImpl.d.ts +18 -1
  91. package/dist/types/model/Nodes.d.ts +2 -2
  92. package/dist/types/model/ProcessContext.d.ts +47 -0
  93. package/dist/types/model/ProcessContextBuilder.d.ts +3 -1
  94. package/dist/types/model/RecordingPlayer.d.ts +6 -0
  95. package/dist/types/model/SplitRunProcessor.d.ts +10 -3
  96. package/dist/types/model/UiGraph.d.ts +8 -0
  97. package/dist/types/model/UiGraphActionProtocol.d.ts +2 -0
  98. package/dist/types/model/UiGraphBrowserRuntime.d.ts +11 -2
  99. package/dist/types/model/UiGraphRendererStyles.d.ts +1 -1
  100. package/dist/types/model/UiGraphRuntimeModel.d.ts +2 -0
  101. package/dist/types/model/UiGraphSchema.d.ts +1 -0
  102. package/dist/types/model/chat-v2/chatV2CallObserver.d.ts +2 -0
  103. package/dist/types/model/chat-v2/chatV2EditorCache.d.ts +1 -3
  104. package/dist/types/model/chat-v2/chatV2Outputs.d.ts +6 -16
  105. package/dist/types/model/chat-v2/chatV2Pipeline.d.ts +13 -17
  106. package/dist/types/model/chat-v2/chatV2ProviderProfile.d.ts +4 -0
  107. package/dist/types/model/chat-v2/chatV2ProviderRegistry.d.ts +8 -0
  108. package/dist/types/model/chat-v2/chatV2RequestPlan.d.ts +2 -2
  109. package/dist/types/model/chat-v2/chatV2ResponseBodyCapture.d.ts +19 -0
  110. package/dist/types/model/chat-v2/chatV2ResponseFormat.d.ts +3 -2
  111. package/dist/types/model/chat-v2/chatV2Retry.d.ts +2 -0
  112. package/dist/types/model/chat-v2/chatV2Types.d.ts +20 -10
  113. package/dist/types/model/chat-v2/chatV2UsageAccounting.d.ts +14 -0
  114. package/dist/types/model/chat-v2/customProviderApi.d.ts +23 -0
  115. package/dist/types/model/chat-v2/index.d.ts +12 -0
  116. package/dist/types/model/chat-v2/llmChatV2Body.d.ts +24 -0
  117. package/dist/types/model/chat-v2/llmChatV2CacheBoundary.d.ts +10 -0
  118. package/dist/types/model/chat-v2/llmChatV2CachePolicy.d.ts +13 -0
  119. package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +10 -3
  120. package/dist/types/model/chat-v2/llmChatV2NodeMigration.d.ts +8 -0
  121. package/dist/types/model/chat-v2/llmChatV2NodeRuntime.d.ts +14 -16
  122. package/dist/types/model/chat-v2/llmInvocationCoordinator.d.ts +16 -0
  123. package/dist/types/model/chat-v2/llmInvocationDecision.d.ts +21 -0
  124. package/dist/types/model/chat-v2/llmInvocationJournal.d.ts +38 -0
  125. package/dist/types/model/chat-v2/llmInvocationPlan.d.ts +41 -0
  126. package/dist/types/model/chat-v2/llmInvocationProjections.d.ts +3 -0
  127. package/dist/types/model/chat-v2/llmInvocationResultProjector.d.ts +26 -0
  128. package/dist/types/model/chat-v2/llmModelCandidate.d.ts +18 -0
  129. package/dist/types/model/chat-v2/llmProfileBody.d.ts +20 -0
  130. package/dist/types/model/chat-v2/llmProfileFallback.d.ts +17 -49
  131. package/dist/types/model/chat-v2/llmProfileFieldRegistry.d.ts +189 -0
  132. package/dist/types/model/chat-v2/llmProfileTypes.d.ts +1 -1
  133. package/dist/types/model/chat-v2/llmResponseMaterializer.d.ts +20 -0
  134. package/dist/types/model/chat-v2/modelRegistry.d.ts +17 -187
  135. package/dist/types/model/chat-v2/parallelToolCalls.d.ts +3 -1
  136. package/dist/types/model/chat-v2/providerOptions.d.ts +10 -0
  137. package/dist/types/model/chat-v2/rivetToolRegistry.d.ts +11 -0
  138. package/dist/types/model/chat-v2/toolCallCodec.d.ts +7 -0
  139. package/dist/types/model/chat-v2/toolContinuation.d.ts +3 -3
  140. package/dist/types/model/chat-v2/toolHandlerResolver.d.ts +25 -0
  141. package/dist/types/model/chat-v2/toolRoundExecutor.d.ts +18 -0
  142. package/dist/types/model/nodes/ChatNode.d.ts +2 -1
  143. package/dist/types/model/nodes/DelegateFunctionCallNode.d.ts +2 -1
  144. package/dist/types/model/nodes/LLMChatV2Node.d.ts +2 -1
  145. package/dist/types/model/nodes/LLMProfileNode.d.ts +2 -1
  146. package/dist/types/model/nodes/PromptNode.d.ts +4 -1
  147. package/dist/types/model/nodes/ToolNode.d.ts +2 -1
  148. package/dist/types/model/nodes/toolCallDelegation.d.ts +10 -3
  149. package/dist/types/plugins/anthropic/anthropic.d.ts +1 -0
  150. package/dist/types/plugins/google/google.d.ts +2 -8
  151. package/dist/types/recording/RecordedEvents.d.ts +6 -0
  152. package/dist/types/utils/emitDetached.d.ts +3 -2
  153. package/dist/types/utils/openai.d.ts +49 -0
  154. package/dist/types/webAppRuntime.d.ts +4 -2
  155. package/package.json +2 -2
@@ -0,0 +1,26 @@
1
+ import type { Outputs } from '../GraphProcessor.js';
2
+ import type { ChatV2CallFinishedEvent } from '../ProcessContext.js';
3
+ import type { LLMAttempt } from './llmProfileFallback.js';
4
+ import type { ChatV2PipelineResult, ChatV2PipelineRoundOptions } from './chatV2Types.js';
5
+ type LLMInvocationDiagnosticProjectionOptions = {
6
+ runOptions: Pick<ChatV2PipelineRoundOptions, 'requestBodies' | 'responseBodies' | 'outputRequestBody' | 'outputResponseBody'>;
7
+ outputLLMAttempts: boolean | undefined;
8
+ llmAttempts: readonly LLMAttempt[];
9
+ profileSummary?: string | undefined;
10
+ };
11
+ /**
12
+ * Projects invocation facts that remain useful even when the node fails.
13
+ * Captured HTTP bodies are emitted only through their opt-in ports, while
14
+ * attempts and profile summaries retain the same public shapes as a success.
15
+ */
16
+ export declare function projectLLMInvocationDiagnostics({ runOptions, outputLLMAttempts, llmAttempts, profileSummary, }: LLMInvocationDiagnosticProjectionOptions): Outputs;
17
+ /** Applies existing public LLM Chat output shapes from invocation facts. */
18
+ export declare function projectLLMInvocationResult(params: {
19
+ result: ChatV2PipelineResult;
20
+ modelCalls: readonly ChatV2CallFinishedEvent[];
21
+ outputUsage: boolean | undefined;
22
+ outputLLMAttempts: boolean | undefined;
23
+ llmAttempts: readonly LLMAttempt[];
24
+ profileSummary?: string | undefined;
25
+ }): Outputs;
26
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { LLMInvocationPlan } from './llmInvocationPlan.js';
2
+ import { applyLLMProfileToNodeData } from './llmProfile.js';
3
+ import type { LLMProfileValue } from './llmProfileTypes.js';
4
+ import { type ChatV2CredentialResult } from './chatV2ProviderProfile.js';
5
+ import type { ChatV2PipelineRoundOptions, RunChatV2PipelineOptions } from './chatV2Types.js';
6
+ import { type ResolvedChatV2ProviderConfig } from './providerOptions.js';
7
+ /** A fully executable model/profile selection plus safe configuration facts. */
8
+ export type ResolvedLLMModelCandidate = {
9
+ effectiveData: ReturnType<typeof applyLLMProfileToNodeData>;
10
+ credential: ChatV2CredentialResult;
11
+ providerConfig: ResolvedChatV2ProviderConfig;
12
+ runOptions: RunChatV2PipelineOptions;
13
+ };
14
+ export declare function resolveLLMModelCandidate(params: {
15
+ plan: LLMInvocationPlan;
16
+ profile?: LLMProfileValue | undefined;
17
+ roundOptions?: ChatV2PipelineRoundOptions | undefined;
18
+ }): Promise<ResolvedLLMModelCandidate>;
@@ -0,0 +1,20 @@
1
+ import type { LLMChatV2ProfileData } from './llmChatV2NodeData.js';
2
+ export type LLMProfileBodyField = Readonly<{
3
+ label: string;
4
+ value: string;
5
+ }>;
6
+ export type LLMProfileBodySnippet = Readonly<{
7
+ label: string;
8
+ text: string;
9
+ }>;
10
+ export type LLMProfileBodySection = Readonly<{
11
+ id: 'model' | 'parameters' | 'provider' | 'advanced';
12
+ fields: readonly LLMProfileBodyField[];
13
+ snippet?: LLMProfileBodySnippet | undefined;
14
+ }>;
15
+ /**
16
+ * Stable canvas presentation data for LLM Profile configuration. It deliberately
17
+ * contains stored configuration only: runtime API-key values are never present
18
+ * in the node data and therefore cannot be rendered here.
19
+ */
20
+ export declare function getLLMProfileBodySections(data: LLMChatV2ProfileData): readonly LLMProfileBodySection[];
@@ -1,11 +1,14 @@
1
- import { type ChatV2Provider, type ChatV2PipelineResult, type RunChatV2PipelineOptions } from './chatV2Types.js';
2
- export type LLMProfileAttempt = {
1
+ import { type ChatV2Provider, type ChatV2PipelineRoundOptions, type ChatV2PipelineResult, type RunChatV2PipelineOptions } from './chatV2Types.js';
2
+ import { type CustomProviderApi } from './customProviderApi.js';
3
+ export type LLMAttempt = {
3
4
  roundIndex: number;
4
- profileIndex: number;
5
+ /** Present when a From profile candidate produced this attempt. */
6
+ profileIndex?: number;
5
7
  provider: ChatV2Provider;
6
8
  model: string;
7
- stage: 'configuration' | 'request';
8
- outcome: 'success' | 'failure';
9
+ customProviderApi?: CustomProviderApi;
10
+ stage: 'configuration' | 'request' | 'response-validation';
11
+ outcome: 'success' | 'failure' | 'aborted';
9
12
  attemptIndex?: number;
10
13
  status?: number;
11
14
  error?: string;
@@ -13,61 +16,25 @@ export type LLMProfileAttempt = {
13
16
  export type LLMProfileFallbackCandidate = {
14
17
  provider: ChatV2Provider;
15
18
  model: string;
16
- credential?: string | undefined;
17
- /** Additional known request secrets, such as profile or global header values. */
18
- redactionValues?: readonly string[] | undefined;
19
+ customProviderApi?: CustomProviderApi;
19
20
  };
20
- /**
21
- * Request-level diagnostics grouped by the configured LLM Profile order.
22
- *
23
- * `LLMProfileAttempt` deliberately retains the full chronology and round
24
- * information. These compact arrays are the shape used by the familiar
25
- * Response Status and Response Error outputs when a profile *array* drives
26
- * LLM Chat: outer index is the input profile index; inner order is the
27
- * physical request order for that profile across the whole invocation.
28
- */
29
- export type LLMProfileRequestDiagnostics = {
30
- statuses: Array<number | number[]>;
31
- errors: LLMProfileRequestErrorDiagnostics;
32
- };
33
- /**
34
- * Compact error diagnostics for an LLM Profile array.
35
- *
36
- * A single request failure is easier to inspect as a string, while retries
37
- * still need an array. When every candidate completed without a request error,
38
- * there is nothing useful to preserve per profile, so the value is simply an
39
- * empty array. The detailed LLM Profile Attempts output remains the canonical
40
- * per-profile/per-attempt record in every case.
41
- */
42
- export type LLMProfileRequestErrorDiagnostics = string | string[] | Array<string | string[]>;
43
21
  export type LLMProfileFallbackRunner = {
44
- run: (roundOptions: RunChatV2PipelineOptions) => Promise<ChatV2PipelineResult>;
45
- attempts: LLMProfileAttempt[];
22
+ run: (roundOptions: ChatV2PipelineRoundOptions) => Promise<ChatV2PipelineResult>;
23
+ attempts: LLMAttempt[];
46
24
  summary: () => string;
47
25
  wasExhausted: () => boolean;
48
26
  };
49
27
  export declare class LLMProfileFallbackExhaustedError extends Error {
50
- readonly attempts: readonly LLMProfileAttempt[];
51
- constructor(attempts: readonly LLMProfileAttempt[]);
28
+ readonly attempts: readonly LLMAttempt[];
29
+ constructor(attempts: readonly LLMAttempt[]);
52
30
  }
31
+ export declare function getLLMAttemptErrorMessage(error: unknown): string;
53
32
  /**
54
33
  * Produces the concise, developer-facing companion to the full attempt trace.
55
34
  * It deliberately includes candidates that were never reached, so a successful
56
35
  * primary profile does not make the configured fallback order invisible.
57
36
  */
58
- export declare function buildLLMProfileFallbackSummary(candidates: readonly LLMProfileFallbackCandidate[], attempts: readonly LLMProfileAttempt[]): string;
59
- export declare function buildLLMProfileRequestDiagnostics(profileCount: number, attempts: readonly LLMProfileAttempt[]): LLMProfileRequestDiagnostics;
60
- /**
61
- * Preserves one profile slot per input profile while making a single physical
62
- * request easy to read. This also repairs cache entries made before the
63
- * scalar-single-status contract was introduced.
64
- */
65
- export declare function compactLLMProfileRequestStatuses(statuses: readonly unknown[]): unknown[];
66
- /**
67
- * Keeps Response Error readable for profile-array fallback chains and repairs
68
- * editor-cache entries written before that compact presentation contract.
69
- */
70
- export declare function compactLLMProfileRequestErrors(errors: readonly unknown[]): unknown;
37
+ export declare function buildLLMProfileFallbackSummary(candidates: readonly LLMProfileFallbackCandidate[], attempts: readonly LLMAttempt[]): string;
71
38
  /**
72
39
  * Creates one forward-only fallback chain for a whole LLM Chat invocation.
73
40
  * A model which succeeds in an earlier tool round stays active for subsequent
@@ -75,5 +42,6 @@ export declare function compactLLMProfileRequestErrors(errors: readonly unknown[
75
42
  */
76
43
  export declare function createLLMProfileFallbackRunner(params: {
77
44
  candidates: readonly LLMProfileFallbackCandidate[];
78
- resolveCandidate: (profileIndex: number, roundOptions: RunChatV2PipelineOptions) => Promise<RunChatV2PipelineOptions>;
45
+ resolveCandidate: (profileIndex: number, roundOptions: ChatV2PipelineRoundOptions) => Promise<RunChatV2PipelineOptions>;
46
+ onAttempt?: ((attempt: LLMAttempt) => void) | undefined;
79
47
  }): LLMProfileFallbackRunner;
@@ -0,0 +1,189 @@
1
+ import type { LLMChatV2NodeData } from './llmChatV2NodeData.js';
2
+ /**
3
+ * Static ownership metadata for fields supplied by an LLM Profile.
4
+ *
5
+ * This deliberately does not attempt to describe editor layout or provider
6
+ * request construction. It provides the one fact those surfaces must share:
7
+ * which persisted LLM Chat fields are profile-owned, and which dynamic input
8
+ * ports a resolved profile consumes before it is passed to LLM Chat.
9
+ */
10
+ export type LLMProfileFieldSpec = {
11
+ key: keyof LLMChatV2NodeData;
12
+ inputId?: string;
13
+ /** Runtime validation for scalar fields; enum and collection fields keep named validators. */
14
+ valueKind?: 'string' | 'boolean' | 'required-number' | 'optional-number';
15
+ /** A resolved profile must never retain an active dynamic-input toggle. */
16
+ resolvedInputToggle?: boolean;
17
+ };
18
+ export declare const llmProfileFieldSpecs: readonly [{
19
+ readonly key: "model";
20
+ readonly inputId: "model";
21
+ readonly valueKind: "string";
22
+ }, {
23
+ readonly key: "useModelInput";
24
+ readonly valueKind: "boolean";
25
+ readonly resolvedInputToggle: true;
26
+ }, {
27
+ readonly key: "temperature";
28
+ readonly inputId: "temperature";
29
+ readonly valueKind: "required-number";
30
+ }, {
31
+ readonly key: "useTemperatureInput";
32
+ readonly valueKind: "boolean";
33
+ readonly resolvedInputToggle: true;
34
+ }, {
35
+ readonly key: "topP";
36
+ readonly inputId: "topP";
37
+ readonly valueKind: "optional-number";
38
+ }, {
39
+ readonly key: "useTopPInput";
40
+ readonly valueKind: "boolean";
41
+ readonly resolvedInputToggle: true;
42
+ }, {
43
+ readonly key: "topK";
44
+ readonly inputId: "topK";
45
+ readonly valueKind: "optional-number";
46
+ }, {
47
+ readonly key: "useTopKInput";
48
+ readonly valueKind: "boolean";
49
+ readonly resolvedInputToggle: true;
50
+ }, {
51
+ readonly key: "presencePenalty";
52
+ readonly inputId: "presencePenalty";
53
+ readonly valueKind: "optional-number";
54
+ }, {
55
+ readonly key: "usePresencePenaltyInput";
56
+ readonly valueKind: "boolean";
57
+ readonly resolvedInputToggle: true;
58
+ }, {
59
+ readonly key: "frequencyPenalty";
60
+ readonly inputId: "frequencyPenalty";
61
+ readonly valueKind: "optional-number";
62
+ }, {
63
+ readonly key: "useFrequencyPenaltyInput";
64
+ readonly valueKind: "boolean";
65
+ readonly resolvedInputToggle: true;
66
+ }, {
67
+ readonly key: "stopSequences";
68
+ readonly inputId: "stopSequences";
69
+ }, {
70
+ readonly key: "useStopSequencesInput";
71
+ readonly valueKind: "boolean";
72
+ readonly resolvedInputToggle: true;
73
+ }, {
74
+ readonly key: "seed";
75
+ readonly inputId: "seed";
76
+ readonly valueKind: "optional-number";
77
+ }, {
78
+ readonly key: "useSeedInput";
79
+ readonly valueKind: "boolean";
80
+ readonly resolvedInputToggle: true;
81
+ }, {
82
+ readonly key: "maxTokens";
83
+ readonly inputId: "maxTokens";
84
+ readonly valueKind: "required-number";
85
+ }, {
86
+ readonly key: "useMaxTokensInput";
87
+ readonly valueKind: "boolean";
88
+ readonly resolvedInputToggle: true;
89
+ }, {
90
+ readonly key: "provider";
91
+ }, {
92
+ readonly key: "apiKeySource";
93
+ readonly inputId: "apiKey";
94
+ }, {
95
+ readonly key: "customProviderApiKeyProgrammaticName";
96
+ readonly valueKind: "string";
97
+ }, {
98
+ readonly key: "customProviderApiKeyEnvVarName";
99
+ readonly valueKind: "string";
100
+ }, {
101
+ readonly key: "customProviderBaseURL";
102
+ readonly inputId: "customProviderBaseURL";
103
+ readonly valueKind: "string";
104
+ }, {
105
+ readonly key: "useCustomProviderBaseURLInput";
106
+ readonly valueKind: "boolean";
107
+ readonly resolvedInputToggle: true;
108
+ }, {
109
+ readonly key: "customProviderApi";
110
+ }, {
111
+ readonly key: "headers";
112
+ readonly inputId: "headers";
113
+ }, {
114
+ readonly key: "useHeadersInput";
115
+ readonly valueKind: "boolean";
116
+ readonly resolvedInputToggle: true;
117
+ }, {
118
+ readonly key: "extraProviderOptions";
119
+ readonly inputId: "extraProviderOptions";
120
+ readonly valueKind: "string";
121
+ }, {
122
+ readonly key: "useExtraProviderOptionsInput";
123
+ readonly valueKind: "boolean";
124
+ readonly resolvedInputToggle: true;
125
+ }, {
126
+ readonly key: "openAIReasoningEffort";
127
+ readonly valueKind: "string";
128
+ }, {
129
+ readonly key: "openAIReasoningSummary";
130
+ readonly valueKind: "string";
131
+ }, {
132
+ readonly key: "openAIPreviousResponseId";
133
+ readonly inputId: "previousResponseId";
134
+ readonly valueKind: "string";
135
+ }, {
136
+ readonly key: "useOpenAIPreviousResponseIdInput";
137
+ readonly valueKind: "boolean";
138
+ readonly resolvedInputToggle: true;
139
+ }, {
140
+ readonly key: "enableOpenAIWebSearch";
141
+ readonly valueKind: "boolean";
142
+ }, {
143
+ readonly key: "openAIWebSearchContextSize";
144
+ }, {
145
+ readonly key: "enableOpenAICodeInterpreter";
146
+ readonly valueKind: "boolean";
147
+ }, {
148
+ readonly key: "anthropicThinkingMode";
149
+ }, {
150
+ readonly key: "anthropicThinkingBudget";
151
+ readonly inputId: "anthropicThinkingBudget";
152
+ readonly valueKind: "optional-number";
153
+ }, {
154
+ readonly key: "useAnthropicThinkingBudgetInput";
155
+ readonly valueKind: "boolean";
156
+ readonly resolvedInputToggle: true;
157
+ }, {
158
+ readonly key: "anthropicEffort";
159
+ }, {
160
+ readonly key: "anthropicCacheControlTtl";
161
+ }, {
162
+ readonly key: "googleThinkingBudget";
163
+ readonly inputId: "googleThinkingBudget";
164
+ readonly valueKind: "optional-number";
165
+ }, {
166
+ readonly key: "useGoogleThinkingBudgetInput";
167
+ readonly valueKind: "boolean";
168
+ readonly resolvedInputToggle: true;
169
+ }, {
170
+ readonly key: "googleThinkingLevel";
171
+ }, {
172
+ readonly key: "googleIncludeThoughts";
173
+ readonly valueKind: "boolean";
174
+ }, {
175
+ readonly key: "enableGoogleSearchGrounding";
176
+ readonly valueKind: "boolean";
177
+ }, {
178
+ readonly key: "enableGoogleUrlContext";
179
+ readonly valueKind: "boolean";
180
+ }];
181
+ export declare const llmProfileDataKeys: ("provider" | "model" | "customProviderApi" | "headers" | "temperature" | "seed" | "maxTokens" | "presencePenalty" | "frequencyPenalty" | "useModelInput" | "useTemperatureInput" | "useTopPInput" | "useMaxTokensInput" | "usePresencePenaltyInput" | "useFrequencyPenaltyInput" | "useHeadersInput" | "useSeedInput" | "topP" | "topK" | "useTopKInput" | "stopSequences" | "useStopSequencesInput" | "anthropicCacheControlTtl" | "apiKeySource" | "customProviderApiKeyProgrammaticName" | "customProviderApiKeyEnvVarName" | "customProviderBaseURL" | "useCustomProviderBaseURLInput" | "extraProviderOptions" | "useExtraProviderOptionsInput" | "openAIReasoningEffort" | "openAIReasoningSummary" | "openAIPreviousResponseId" | "useOpenAIPreviousResponseIdInput" | "enableOpenAIWebSearch" | "openAIWebSearchContextSize" | "enableOpenAICodeInterpreter" | "anthropicThinkingMode" | "anthropicThinkingBudget" | "useAnthropicThinkingBudgetInput" | "anthropicEffort" | "googleThinkingBudget" | "useGoogleThinkingBudgetInput" | "googleThinkingLevel" | "googleIncludeThoughts" | "enableGoogleSearchGrounding" | "enableGoogleUrlContext")[];
182
+ export declare const llmProfileInputIds: ("model" | "headers" | "temperature" | "seed" | "maxTokens" | "presencePenalty" | "frequencyPenalty" | "topP" | "topK" | "stopSequences" | "apiKey" | "customProviderBaseURL" | "extraProviderOptions" | "anthropicThinkingBudget" | "googleThinkingBudget" | "previousResponseId")[];
183
+ /** Runtime validation categories for resolved LLM Profile values. */
184
+ export declare const llmProfileStringDataKeys: ("provider" | "parallelToolCalls" | "customProviderApi" | "headers" | "toolChoice" | "toolChoiceFunction" | "responseFormat" | "responseSchemaName" | "useHeadersInput" | "useResponseSchemaNameInput" | keyof import("./chatV2Shared.js").ChatV2CommonNodeData | "anthropicCacheControlTtl" | "outputRequestBody" | "outputResponseBody" | "retryOnNon200" | "retryOnNon200RepeatTimes" | "retryOnNon200CooldownMs" | "baseURL" | "responseSchemaDescription" | "useResponseSchemaDescriptionInput" | "configurationMode" | "apiKeySource" | "customProviderApiKeyProgrammaticName" | "customProviderApiKeyEnvVarName" | "customProviderBaseURL" | "useCustomProviderBaseURLInput" | "useBaseURLInput" | "extraProviderOptions" | "useExtraProviderOptionsInput" | "openAIReasoningEffort" | "openAIReasoningSummary" | "openAIPreviousResponseId" | "useOpenAIPreviousResponseIdInput" | "enableOpenAIWebSearch" | "openAIWebSearchContextSize" | "enableOpenAICodeInterpreter" | "anthropicThinkingMode" | "anthropicThinkingBudget" | "useAnthropicThinkingBudgetInput" | "anthropicEffort" | "googleThinkingBudget" | "useGoogleThinkingBudgetInput" | "googleThinkingLevel" | "googleIncludeThoughts" | "enableGoogleSearchGrounding" | "enableGoogleUrlContext" | "autoContinueToolCalls" | "maxToolRounds" | "outputLLMAttempts")[];
185
+ export declare const llmProfileBooleanDataKeys: ("provider" | "parallelToolCalls" | "customProviderApi" | "headers" | "toolChoice" | "toolChoiceFunction" | "responseFormat" | "responseSchemaName" | "useHeadersInput" | "useResponseSchemaNameInput" | keyof import("./chatV2Shared.js").ChatV2CommonNodeData | "anthropicCacheControlTtl" | "outputRequestBody" | "outputResponseBody" | "retryOnNon200" | "retryOnNon200RepeatTimes" | "retryOnNon200CooldownMs" | "baseURL" | "responseSchemaDescription" | "useResponseSchemaDescriptionInput" | "configurationMode" | "apiKeySource" | "customProviderApiKeyProgrammaticName" | "customProviderApiKeyEnvVarName" | "customProviderBaseURL" | "useCustomProviderBaseURLInput" | "useBaseURLInput" | "extraProviderOptions" | "useExtraProviderOptionsInput" | "openAIReasoningEffort" | "openAIReasoningSummary" | "openAIPreviousResponseId" | "useOpenAIPreviousResponseIdInput" | "enableOpenAIWebSearch" | "openAIWebSearchContextSize" | "enableOpenAICodeInterpreter" | "anthropicThinkingMode" | "anthropicThinkingBudget" | "useAnthropicThinkingBudgetInput" | "anthropicEffort" | "googleThinkingBudget" | "useGoogleThinkingBudgetInput" | "googleThinkingLevel" | "googleIncludeThoughts" | "enableGoogleSearchGrounding" | "enableGoogleUrlContext" | "autoContinueToolCalls" | "maxToolRounds" | "outputLLMAttempts")[];
186
+ export declare const llmProfileRequiredNumberDataKeys: ("provider" | "parallelToolCalls" | "customProviderApi" | "headers" | "toolChoice" | "toolChoiceFunction" | "responseFormat" | "responseSchemaName" | "useHeadersInput" | "useResponseSchemaNameInput" | keyof import("./chatV2Shared.js").ChatV2CommonNodeData | "anthropicCacheControlTtl" | "outputRequestBody" | "outputResponseBody" | "retryOnNon200" | "retryOnNon200RepeatTimes" | "retryOnNon200CooldownMs" | "baseURL" | "responseSchemaDescription" | "useResponseSchemaDescriptionInput" | "configurationMode" | "apiKeySource" | "customProviderApiKeyProgrammaticName" | "customProviderApiKeyEnvVarName" | "customProviderBaseURL" | "useCustomProviderBaseURLInput" | "useBaseURLInput" | "extraProviderOptions" | "useExtraProviderOptionsInput" | "openAIReasoningEffort" | "openAIReasoningSummary" | "openAIPreviousResponseId" | "useOpenAIPreviousResponseIdInput" | "enableOpenAIWebSearch" | "openAIWebSearchContextSize" | "enableOpenAICodeInterpreter" | "anthropicThinkingMode" | "anthropicThinkingBudget" | "useAnthropicThinkingBudgetInput" | "anthropicEffort" | "googleThinkingBudget" | "useGoogleThinkingBudgetInput" | "googleThinkingLevel" | "googleIncludeThoughts" | "enableGoogleSearchGrounding" | "enableGoogleUrlContext" | "autoContinueToolCalls" | "maxToolRounds" | "outputLLMAttempts")[];
187
+ export declare const llmProfileOptionalNumberDataKeys: ("provider" | "parallelToolCalls" | "customProviderApi" | "headers" | "toolChoice" | "toolChoiceFunction" | "responseFormat" | "responseSchemaName" | "useHeadersInput" | "useResponseSchemaNameInput" | keyof import("./chatV2Shared.js").ChatV2CommonNodeData | "anthropicCacheControlTtl" | "outputRequestBody" | "outputResponseBody" | "retryOnNon200" | "retryOnNon200RepeatTimes" | "retryOnNon200CooldownMs" | "baseURL" | "responseSchemaDescription" | "useResponseSchemaDescriptionInput" | "configurationMode" | "apiKeySource" | "customProviderApiKeyProgrammaticName" | "customProviderApiKeyEnvVarName" | "customProviderBaseURL" | "useCustomProviderBaseURLInput" | "useBaseURLInput" | "extraProviderOptions" | "useExtraProviderOptionsInput" | "openAIReasoningEffort" | "openAIReasoningSummary" | "openAIPreviousResponseId" | "useOpenAIPreviousResponseIdInput" | "enableOpenAIWebSearch" | "openAIWebSearchContextSize" | "enableOpenAICodeInterpreter" | "anthropicThinkingMode" | "anthropicThinkingBudget" | "useAnthropicThinkingBudgetInput" | "anthropicEffort" | "googleThinkingBudget" | "useGoogleThinkingBudgetInput" | "googleThinkingLevel" | "googleIncludeThoughts" | "enableGoogleSearchGrounding" | "enableGoogleUrlContext" | "autoContinueToolCalls" | "maxToolRounds" | "outputLLMAttempts")[];
188
+ /** A serialized profile must be self-contained, not driven by hidden ports. */
189
+ export declare const llmProfileResolvedInputToggleDataKeys: Array<keyof LLMChatV2NodeData>;
@@ -6,7 +6,7 @@ export declare const LLM_PROFILE_VALUE_VERSION: 1;
6
6
  * until their matching provider or input toggle is enabled. This lets editor
7
7
  * operations preserve recoverable connections across configuration changes.
8
8
  */
9
- export declare const llmProfileInputIds: readonly ["model", "apiKey", "customProviderBaseURL", "previousResponseId", "temperature", "maxTokens", "topP", "topK", "presencePenalty", "frequencyPenalty", "stopSequences", "seed", "headers", "extraProviderOptions", "anthropicThinkingBudget", "googleThinkingBudget"];
9
+ export { llmProfileInputIds } from './llmProfileFieldRegistry.js';
10
10
  export type LLMProfileValue = {
11
11
  version: typeof LLM_PROFILE_VALUE_VERSION;
12
12
  configuration: LLMChatV2ProfileData;
@@ -0,0 +1,20 @@
1
+ import type { DataValue } from '../DataValue.js';
2
+ import type { ChatV2ResponseFormatMode } from './chatV2Types.js';
3
+ /**
4
+ * The one place where a provider response becomes Rivet's Response value.
5
+ *
6
+ * Providers may return a structured SDK value, JSON text, or ordinary text.
7
+ * Keeping this decision separate from port projection ensures validation sees
8
+ * exactly the same DataValue that a downstream node receives.
9
+ */
10
+ export type MaterializedLLMResponse = {
11
+ rawText: string;
12
+ value: DataValue;
13
+ source: 'sdk-structured' | 'text-json' | 'plain-text';
14
+ validation: 'not-requested' | 'valid' | 'invalid';
15
+ };
16
+ export declare function materializeLLMResponse(params: {
17
+ rawText: string;
18
+ structuredOutput: unknown | undefined;
19
+ responseFormat: ChatV2ResponseFormatMode | undefined;
20
+ }): MaterializedLLMResponse;
@@ -2,139 +2,19 @@ import type { ChatV2Provider } from './chatV2Types.js';
2
2
  export type ChatV2ModelInfo = {
3
3
  maxTokens: number;
4
4
  displayName: string;
5
- cost: {
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
- readonly openai: {
12
- 'gpt-5': {
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
- readonly google: {
236
- 'gemini-2.5-pro': {
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
- export declare const LLM_CHAT_V2_PARALLEL_TOOL_CALLS_HELPER_MESSAGE = "Supported by OpenAI, Anthropic, and compatible Custom providers. Custom providers receive parallel_tool_calls only when enabled; otherwise their default applies unless Extra provider options supplies the field.";
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,12 +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;
52
55
  transformRequestBody?: ((body: unknown) => unknown) | undefined;
56
+ customProviderApi?: CustomProviderApi | undefined;
57
+ endpointQuery?: ReadonlyArray<readonly [string, string]> | undefined;
53
58
  };
54
59
  export type ResolveChatV2ProviderConfigContext = Pick<InternalProcessContext, 'getPluginConfig' | 'settings'>;
55
60
  export type ResolvedChatV2ProviderConfig = {
56
61
  baseURL?: string | undefined;
57
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]>;
58
68
  };
59
69
  export declare function openAICompatibleEndpointToBaseURL(endpoint: string): string;
60
70
  export declare function resolveChatV2ProviderConfig(provider: ChatV2Provider, _modelId: string, context: ResolveChatV2ProviderConfigContext, options?: CreateChatV2ModelOptions): Promise<ResolvedChatV2ProviderConfig>;