@valerypopoff/rivet2-core 2.24.0 → 2.26.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/dist/cjs/bundle.cjs +710 -197
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/cjs/interpolationRuntime.cjs +23 -0
- package/dist/cjs/interpolationRuntime.cjs.map +3 -3
- package/dist/cjs/serialization.cjs +1 -0
- package/dist/cjs/serialization.cjs.map +2 -2
- package/dist/esm/exports.js +4 -0
- package/dist/esm/model/DatasetOwnership.js +9 -0
- package/dist/esm/model/GraphExecutionState.js +3 -0
- package/dist/esm/model/GraphProcessor.js +86 -4
- package/dist/esm/model/LatestDebuggerProtocol.js +156 -0
- package/dist/esm/model/Nodes.js +3 -0
- package/dist/esm/model/RunCostLedger.js +89 -0
- package/dist/esm/model/chat-v2/chatV2CallObserver.js +2 -2
- package/dist/esm/model/chat-v2/chatV2Outputs.js +1 -1
- package/dist/esm/model/chat-v2/chatV2Pipeline.js +5 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +3 -0
- package/dist/esm/model/chat-v2/llmModelCandidate.js +3 -0
- package/dist/esm/model/chat-v2/llmProfile.js +2 -0
- package/dist/esm/model/chat-v2/llmProfileFieldRegistry.js +1 -0
- package/dist/esm/model/chat-v2/llmProfileNodeRuntime.js +2 -1
- package/dist/esm/model/chat-v2/modelRegistry.js +12 -3
- package/dist/esm/model/classifier/profile.js +11 -3
- package/dist/esm/model/classifier/profileExecution.js +2 -1
- package/dist/esm/model/classifier/providers.js +25 -14
- package/dist/esm/model/nodes/AICostNode.js +56 -0
- package/dist/esm/model/nodes/ClassifierEvaluateNode.js +16 -5
- package/dist/esm/model/nodes/ClassifierProfileNode.js +2 -0
- package/dist/esm/model/tokenPricing.js +52 -0
- package/dist/esm/model/tokenPricingEditor.js +9 -0
- package/dist/types/exports.d.ts +4 -0
- package/dist/types/model/DatasetOwnership.d.ts +5 -0
- package/dist/types/model/GraphExecutionState.d.ts +3 -0
- package/dist/types/model/GraphProcessor.d.ts +3 -0
- package/dist/types/model/LatestDebuggerProtocol.d.ts +113 -0
- package/dist/types/model/Nodes.d.ts +3 -2
- package/dist/types/model/ProcessContext.d.ts +3 -0
- package/dist/types/model/RunCostLedger.d.ts +29 -0
- package/dist/types/model/chat-v2/chatV2Outputs.d.ts +1 -1
- package/dist/types/model/chat-v2/chatV2Types.d.ts +2 -0
- package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +3 -1
- package/dist/types/model/chat-v2/llmProfileFieldRegistry.d.ts +7 -5
- package/dist/types/model/chat-v2/modelRegistry.d.ts +7 -1
- package/dist/types/model/classifier/profile.d.ts +3 -1
- package/dist/types/model/classifier/profileExecution.d.ts +1 -0
- package/dist/types/model/classifier/providers.d.ts +4 -1
- package/dist/types/model/nodes/AICostNode.d.ts +15 -0
- package/dist/types/model/tokenPricing.d.ts +18 -0
- package/dist/types/model/tokenPricingEditor.d.ts +4 -0
- package/package.json +1 -1
|
@@ -76,6 +76,7 @@ var DEFAULT_LLM_CHAT_V2_RETRY_ON_NON_200_COOLDOWN_MS = 0;
|
|
|
76
76
|
|
|
77
77
|
// src/model/chat-v2/llmProfileFieldRegistry.ts
|
|
78
78
|
var llmProfileFieldSpecs = [
|
|
79
|
+
{ key: "tokenPricing" },
|
|
79
80
|
{ key: "model", inputId: "model", valueKind: "string" },
|
|
80
81
|
{ key: "useModelInput", valueKind: "boolean", resolvedInputToggle: true },
|
|
81
82
|
{ key: "temperature", inputId: "temperature", valueKind: "optional-number" },
|
|
@@ -796,6 +797,27 @@ function normalizeTemperature(value, label = "Temperature") {
|
|
|
796
797
|
return value;
|
|
797
798
|
}
|
|
798
799
|
|
|
800
|
+
// src/model/tokenPricing.ts
|
|
801
|
+
function validateTokenPricing(value) {
|
|
802
|
+
if (value === void 0) return void 0;
|
|
803
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
804
|
+
throw new Error("Token pricing override must be an object.");
|
|
805
|
+
const result = {};
|
|
806
|
+
for (const key of [
|
|
807
|
+
"inputPerMillionTokens",
|
|
808
|
+
"outputPerMillionTokens",
|
|
809
|
+
"cacheReadPerMillionTokens",
|
|
810
|
+
"cacheWritePerMillionTokens"
|
|
811
|
+
]) {
|
|
812
|
+
const rate = value[key];
|
|
813
|
+
if (rate === void 0 && key.startsWith("cache")) continue;
|
|
814
|
+
if (typeof rate !== "number" || !Number.isFinite(rate) || rate < 0)
|
|
815
|
+
throw new Error(`Token pricing ${key} must be a finite, non-negative USD rate.`);
|
|
816
|
+
result[key] = rate;
|
|
817
|
+
}
|
|
818
|
+
return result;
|
|
819
|
+
}
|
|
820
|
+
|
|
799
821
|
// src/model/chat-v2/llmProfile.ts
|
|
800
822
|
var credentialSources = /* @__PURE__ */ new Set([
|
|
801
823
|
"input",
|
|
@@ -848,6 +870,7 @@ function normalizeLLMProfileValue(value) {
|
|
|
848
870
|
}
|
|
849
871
|
function normalizeConfiguration(data) {
|
|
850
872
|
var _a, _b;
|
|
873
|
+
data = { ...data, tokenPricing: validateTokenPricing(data.tokenPricing) };
|
|
851
874
|
for (const field of llmProfileStringDataKeys) {
|
|
852
875
|
if (typeof data[field] !== "string") {
|
|
853
876
|
throw new Error(`LLM Profile ${field} must be a string.`);
|