@contractspec/lib.metering 3.0.0 → 3.1.1
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/browser/events.js +42 -1
- package/dist/browser/index.js +42 -1
- package/dist/events.d.ts +87 -0
- package/dist/events.js +42 -1
- package/dist/index.js +42 -1
- package/dist/node/events.js +42 -1
- package/dist/node/index.js +42 -1
- package/package.json +6 -6
package/dist/browser/events.js
CHANGED
|
@@ -205,6 +205,45 @@ var ThresholdApproachingEvent = defineEvent({
|
|
|
205
205
|
},
|
|
206
206
|
payload: ThresholdApproachingPayload
|
|
207
207
|
});
|
|
208
|
+
var ModelSelectionPayload = defineSchemaModel({
|
|
209
|
+
name: "ModelSelectionEventPayload",
|
|
210
|
+
description: "Payload when an AI model is selected via ranking",
|
|
211
|
+
fields: {
|
|
212
|
+
modelId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
213
|
+
providerKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
214
|
+
dimension: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
215
|
+
score: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
216
|
+
reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
217
|
+
alternativesCount: {
|
|
218
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
219
|
+
isOptional: false
|
|
220
|
+
},
|
|
221
|
+
costEstimateInput: {
|
|
222
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
223
|
+
isOptional: true
|
|
224
|
+
},
|
|
225
|
+
costEstimateOutput: {
|
|
226
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
227
|
+
isOptional: true
|
|
228
|
+
},
|
|
229
|
+
selectionDurationMs: {
|
|
230
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
231
|
+
isOptional: true
|
|
232
|
+
},
|
|
233
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
var ModelSelectionEvent = defineEvent({
|
|
237
|
+
meta: {
|
|
238
|
+
key: "model.selected",
|
|
239
|
+
version: "1.0.0",
|
|
240
|
+
description: "An AI model has been selected via ranking-driven selection.",
|
|
241
|
+
stability: "experimental",
|
|
242
|
+
owners: ["@platform.metering"],
|
|
243
|
+
tags: ["metering", "ai", "model-selection"]
|
|
244
|
+
},
|
|
245
|
+
payload: ModelSelectionPayload
|
|
246
|
+
});
|
|
208
247
|
var MeteringEvents = {
|
|
209
248
|
MetricDefinedEvent,
|
|
210
249
|
MetricUpdatedEvent,
|
|
@@ -213,7 +252,8 @@ var MeteringEvents = {
|
|
|
213
252
|
UsageAggregatedEvent,
|
|
214
253
|
ThresholdCreatedEvent,
|
|
215
254
|
ThresholdExceededEvent,
|
|
216
|
-
ThresholdApproachingEvent
|
|
255
|
+
ThresholdApproachingEvent,
|
|
256
|
+
ModelSelectionEvent
|
|
217
257
|
};
|
|
218
258
|
export {
|
|
219
259
|
UsageRecordedEvent,
|
|
@@ -222,6 +262,7 @@ export {
|
|
|
222
262
|
ThresholdExceededEvent,
|
|
223
263
|
ThresholdCreatedEvent,
|
|
224
264
|
ThresholdApproachingEvent,
|
|
265
|
+
ModelSelectionEvent,
|
|
225
266
|
MetricUpdatedEvent,
|
|
226
267
|
MetricDefinedEvent,
|
|
227
268
|
MeteringEvents
|
package/dist/browser/index.js
CHANGED
|
@@ -1770,6 +1770,45 @@ var ThresholdApproachingEvent = defineEvent({
|
|
|
1770
1770
|
},
|
|
1771
1771
|
payload: ThresholdApproachingPayload
|
|
1772
1772
|
});
|
|
1773
|
+
var ModelSelectionPayload = defineSchemaModel2({
|
|
1774
|
+
name: "ModelSelectionEventPayload",
|
|
1775
|
+
description: "Payload when an AI model is selected via ranking",
|
|
1776
|
+
fields: {
|
|
1777
|
+
modelId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1778
|
+
providerKey: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1779
|
+
dimension: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
1780
|
+
score: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
1781
|
+
reason: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1782
|
+
alternativesCount: {
|
|
1783
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
1784
|
+
isOptional: false
|
|
1785
|
+
},
|
|
1786
|
+
costEstimateInput: {
|
|
1787
|
+
type: ScalarTypeEnum2.Float_unsecure(),
|
|
1788
|
+
isOptional: true
|
|
1789
|
+
},
|
|
1790
|
+
costEstimateOutput: {
|
|
1791
|
+
type: ScalarTypeEnum2.Float_unsecure(),
|
|
1792
|
+
isOptional: true
|
|
1793
|
+
},
|
|
1794
|
+
selectionDurationMs: {
|
|
1795
|
+
type: ScalarTypeEnum2.Float_unsecure(),
|
|
1796
|
+
isOptional: true
|
|
1797
|
+
},
|
|
1798
|
+
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
1799
|
+
}
|
|
1800
|
+
});
|
|
1801
|
+
var ModelSelectionEvent = defineEvent({
|
|
1802
|
+
meta: {
|
|
1803
|
+
key: "model.selected",
|
|
1804
|
+
version: "1.0.0",
|
|
1805
|
+
description: "An AI model has been selected via ranking-driven selection.",
|
|
1806
|
+
stability: "experimental",
|
|
1807
|
+
owners: ["@platform.metering"],
|
|
1808
|
+
tags: ["metering", "ai", "model-selection"]
|
|
1809
|
+
},
|
|
1810
|
+
payload: ModelSelectionPayload
|
|
1811
|
+
});
|
|
1773
1812
|
var MeteringEvents = {
|
|
1774
1813
|
MetricDefinedEvent,
|
|
1775
1814
|
MetricUpdatedEvent,
|
|
@@ -1778,7 +1817,8 @@ var MeteringEvents = {
|
|
|
1778
1817
|
UsageAggregatedEvent,
|
|
1779
1818
|
ThresholdCreatedEvent,
|
|
1780
1819
|
ThresholdExceededEvent,
|
|
1781
|
-
ThresholdApproachingEvent
|
|
1820
|
+
ThresholdApproachingEvent,
|
|
1821
|
+
ModelSelectionEvent
|
|
1782
1822
|
};
|
|
1783
1823
|
|
|
1784
1824
|
// src/metering.feature.ts
|
|
@@ -1859,6 +1899,7 @@ export {
|
|
|
1859
1899
|
PosthogMeteringReporter,
|
|
1860
1900
|
PosthogMeteringReader,
|
|
1861
1901
|
PeriodTypeEnum,
|
|
1902
|
+
ModelSelectionEvent,
|
|
1862
1903
|
MetricUpdatedEvent,
|
|
1863
1904
|
MetricDefinitionModel,
|
|
1864
1905
|
MetricDefinitionEntity,
|
package/dist/events.d.ts
CHANGED
|
@@ -274,6 +274,51 @@ export declare const ThresholdApproachingEvent: import("@contractspec/lib.contra
|
|
|
274
274
|
isOptional: false;
|
|
275
275
|
};
|
|
276
276
|
}>>;
|
|
277
|
+
/**
|
|
278
|
+
* Emitted when a model is selected via ranking-driven selection.
|
|
279
|
+
*/
|
|
280
|
+
export declare const ModelSelectionEvent: import("@contractspec/lib.contracts-spec").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
281
|
+
modelId: {
|
|
282
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
283
|
+
isOptional: false;
|
|
284
|
+
};
|
|
285
|
+
providerKey: {
|
|
286
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
287
|
+
isOptional: false;
|
|
288
|
+
};
|
|
289
|
+
dimension: {
|
|
290
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
291
|
+
isOptional: true;
|
|
292
|
+
};
|
|
293
|
+
score: {
|
|
294
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
295
|
+
isOptional: false;
|
|
296
|
+
};
|
|
297
|
+
reason: {
|
|
298
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
299
|
+
isOptional: false;
|
|
300
|
+
};
|
|
301
|
+
alternativesCount: {
|
|
302
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
303
|
+
isOptional: false;
|
|
304
|
+
};
|
|
305
|
+
costEstimateInput: {
|
|
306
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
307
|
+
isOptional: true;
|
|
308
|
+
};
|
|
309
|
+
costEstimateOutput: {
|
|
310
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
311
|
+
isOptional: true;
|
|
312
|
+
};
|
|
313
|
+
selectionDurationMs: {
|
|
314
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
315
|
+
isOptional: true;
|
|
316
|
+
};
|
|
317
|
+
timestamp: {
|
|
318
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
319
|
+
isOptional: false;
|
|
320
|
+
};
|
|
321
|
+
}>>;
|
|
277
322
|
/**
|
|
278
323
|
* All metering events.
|
|
279
324
|
*/
|
|
@@ -530,4 +575,46 @@ export declare const MeteringEvents: {
|
|
|
530
575
|
isOptional: false;
|
|
531
576
|
};
|
|
532
577
|
}>>;
|
|
578
|
+
ModelSelectionEvent: import("@contractspec/lib.contracts-spec").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
579
|
+
modelId: {
|
|
580
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
581
|
+
isOptional: false;
|
|
582
|
+
};
|
|
583
|
+
providerKey: {
|
|
584
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
585
|
+
isOptional: false;
|
|
586
|
+
};
|
|
587
|
+
dimension: {
|
|
588
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
589
|
+
isOptional: true;
|
|
590
|
+
};
|
|
591
|
+
score: {
|
|
592
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
593
|
+
isOptional: false;
|
|
594
|
+
};
|
|
595
|
+
reason: {
|
|
596
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
597
|
+
isOptional: false;
|
|
598
|
+
};
|
|
599
|
+
alternativesCount: {
|
|
600
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
601
|
+
isOptional: false;
|
|
602
|
+
};
|
|
603
|
+
costEstimateInput: {
|
|
604
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
605
|
+
isOptional: true;
|
|
606
|
+
};
|
|
607
|
+
costEstimateOutput: {
|
|
608
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
609
|
+
isOptional: true;
|
|
610
|
+
};
|
|
611
|
+
selectionDurationMs: {
|
|
612
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
613
|
+
isOptional: true;
|
|
614
|
+
};
|
|
615
|
+
timestamp: {
|
|
616
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
617
|
+
isOptional: false;
|
|
618
|
+
};
|
|
619
|
+
}>>;
|
|
533
620
|
};
|
package/dist/events.js
CHANGED
|
@@ -206,6 +206,45 @@ var ThresholdApproachingEvent = defineEvent({
|
|
|
206
206
|
},
|
|
207
207
|
payload: ThresholdApproachingPayload
|
|
208
208
|
});
|
|
209
|
+
var ModelSelectionPayload = defineSchemaModel({
|
|
210
|
+
name: "ModelSelectionEventPayload",
|
|
211
|
+
description: "Payload when an AI model is selected via ranking",
|
|
212
|
+
fields: {
|
|
213
|
+
modelId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
214
|
+
providerKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
215
|
+
dimension: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
216
|
+
score: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
217
|
+
reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
218
|
+
alternativesCount: {
|
|
219
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
220
|
+
isOptional: false
|
|
221
|
+
},
|
|
222
|
+
costEstimateInput: {
|
|
223
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
224
|
+
isOptional: true
|
|
225
|
+
},
|
|
226
|
+
costEstimateOutput: {
|
|
227
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
228
|
+
isOptional: true
|
|
229
|
+
},
|
|
230
|
+
selectionDurationMs: {
|
|
231
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
232
|
+
isOptional: true
|
|
233
|
+
},
|
|
234
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
var ModelSelectionEvent = defineEvent({
|
|
238
|
+
meta: {
|
|
239
|
+
key: "model.selected",
|
|
240
|
+
version: "1.0.0",
|
|
241
|
+
description: "An AI model has been selected via ranking-driven selection.",
|
|
242
|
+
stability: "experimental",
|
|
243
|
+
owners: ["@platform.metering"],
|
|
244
|
+
tags: ["metering", "ai", "model-selection"]
|
|
245
|
+
},
|
|
246
|
+
payload: ModelSelectionPayload
|
|
247
|
+
});
|
|
209
248
|
var MeteringEvents = {
|
|
210
249
|
MetricDefinedEvent,
|
|
211
250
|
MetricUpdatedEvent,
|
|
@@ -214,7 +253,8 @@ var MeteringEvents = {
|
|
|
214
253
|
UsageAggregatedEvent,
|
|
215
254
|
ThresholdCreatedEvent,
|
|
216
255
|
ThresholdExceededEvent,
|
|
217
|
-
ThresholdApproachingEvent
|
|
256
|
+
ThresholdApproachingEvent,
|
|
257
|
+
ModelSelectionEvent
|
|
218
258
|
};
|
|
219
259
|
export {
|
|
220
260
|
UsageRecordedEvent,
|
|
@@ -223,6 +263,7 @@ export {
|
|
|
223
263
|
ThresholdExceededEvent,
|
|
224
264
|
ThresholdCreatedEvent,
|
|
225
265
|
ThresholdApproachingEvent,
|
|
266
|
+
ModelSelectionEvent,
|
|
226
267
|
MetricUpdatedEvent,
|
|
227
268
|
MetricDefinedEvent,
|
|
228
269
|
MeteringEvents
|
package/dist/index.js
CHANGED
|
@@ -1771,6 +1771,45 @@ var ThresholdApproachingEvent = defineEvent({
|
|
|
1771
1771
|
},
|
|
1772
1772
|
payload: ThresholdApproachingPayload
|
|
1773
1773
|
});
|
|
1774
|
+
var ModelSelectionPayload = defineSchemaModel2({
|
|
1775
|
+
name: "ModelSelectionEventPayload",
|
|
1776
|
+
description: "Payload when an AI model is selected via ranking",
|
|
1777
|
+
fields: {
|
|
1778
|
+
modelId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1779
|
+
providerKey: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1780
|
+
dimension: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
1781
|
+
score: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
1782
|
+
reason: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1783
|
+
alternativesCount: {
|
|
1784
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
1785
|
+
isOptional: false
|
|
1786
|
+
},
|
|
1787
|
+
costEstimateInput: {
|
|
1788
|
+
type: ScalarTypeEnum2.Float_unsecure(),
|
|
1789
|
+
isOptional: true
|
|
1790
|
+
},
|
|
1791
|
+
costEstimateOutput: {
|
|
1792
|
+
type: ScalarTypeEnum2.Float_unsecure(),
|
|
1793
|
+
isOptional: true
|
|
1794
|
+
},
|
|
1795
|
+
selectionDurationMs: {
|
|
1796
|
+
type: ScalarTypeEnum2.Float_unsecure(),
|
|
1797
|
+
isOptional: true
|
|
1798
|
+
},
|
|
1799
|
+
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
1800
|
+
}
|
|
1801
|
+
});
|
|
1802
|
+
var ModelSelectionEvent = defineEvent({
|
|
1803
|
+
meta: {
|
|
1804
|
+
key: "model.selected",
|
|
1805
|
+
version: "1.0.0",
|
|
1806
|
+
description: "An AI model has been selected via ranking-driven selection.",
|
|
1807
|
+
stability: "experimental",
|
|
1808
|
+
owners: ["@platform.metering"],
|
|
1809
|
+
tags: ["metering", "ai", "model-selection"]
|
|
1810
|
+
},
|
|
1811
|
+
payload: ModelSelectionPayload
|
|
1812
|
+
});
|
|
1774
1813
|
var MeteringEvents = {
|
|
1775
1814
|
MetricDefinedEvent,
|
|
1776
1815
|
MetricUpdatedEvent,
|
|
@@ -1779,7 +1818,8 @@ var MeteringEvents = {
|
|
|
1779
1818
|
UsageAggregatedEvent,
|
|
1780
1819
|
ThresholdCreatedEvent,
|
|
1781
1820
|
ThresholdExceededEvent,
|
|
1782
|
-
ThresholdApproachingEvent
|
|
1821
|
+
ThresholdApproachingEvent,
|
|
1822
|
+
ModelSelectionEvent
|
|
1783
1823
|
};
|
|
1784
1824
|
|
|
1785
1825
|
// src/metering.feature.ts
|
|
@@ -1860,6 +1900,7 @@ export {
|
|
|
1860
1900
|
PosthogMeteringReporter,
|
|
1861
1901
|
PosthogMeteringReader,
|
|
1862
1902
|
PeriodTypeEnum,
|
|
1903
|
+
ModelSelectionEvent,
|
|
1863
1904
|
MetricUpdatedEvent,
|
|
1864
1905
|
MetricDefinitionModel,
|
|
1865
1906
|
MetricDefinitionEntity,
|
package/dist/node/events.js
CHANGED
|
@@ -205,6 +205,45 @@ var ThresholdApproachingEvent = defineEvent({
|
|
|
205
205
|
},
|
|
206
206
|
payload: ThresholdApproachingPayload
|
|
207
207
|
});
|
|
208
|
+
var ModelSelectionPayload = defineSchemaModel({
|
|
209
|
+
name: "ModelSelectionEventPayload",
|
|
210
|
+
description: "Payload when an AI model is selected via ranking",
|
|
211
|
+
fields: {
|
|
212
|
+
modelId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
213
|
+
providerKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
214
|
+
dimension: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
215
|
+
score: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
216
|
+
reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
217
|
+
alternativesCount: {
|
|
218
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
219
|
+
isOptional: false
|
|
220
|
+
},
|
|
221
|
+
costEstimateInput: {
|
|
222
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
223
|
+
isOptional: true
|
|
224
|
+
},
|
|
225
|
+
costEstimateOutput: {
|
|
226
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
227
|
+
isOptional: true
|
|
228
|
+
},
|
|
229
|
+
selectionDurationMs: {
|
|
230
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
231
|
+
isOptional: true
|
|
232
|
+
},
|
|
233
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
var ModelSelectionEvent = defineEvent({
|
|
237
|
+
meta: {
|
|
238
|
+
key: "model.selected",
|
|
239
|
+
version: "1.0.0",
|
|
240
|
+
description: "An AI model has been selected via ranking-driven selection.",
|
|
241
|
+
stability: "experimental",
|
|
242
|
+
owners: ["@platform.metering"],
|
|
243
|
+
tags: ["metering", "ai", "model-selection"]
|
|
244
|
+
},
|
|
245
|
+
payload: ModelSelectionPayload
|
|
246
|
+
});
|
|
208
247
|
var MeteringEvents = {
|
|
209
248
|
MetricDefinedEvent,
|
|
210
249
|
MetricUpdatedEvent,
|
|
@@ -213,7 +252,8 @@ var MeteringEvents = {
|
|
|
213
252
|
UsageAggregatedEvent,
|
|
214
253
|
ThresholdCreatedEvent,
|
|
215
254
|
ThresholdExceededEvent,
|
|
216
|
-
ThresholdApproachingEvent
|
|
255
|
+
ThresholdApproachingEvent,
|
|
256
|
+
ModelSelectionEvent
|
|
217
257
|
};
|
|
218
258
|
export {
|
|
219
259
|
UsageRecordedEvent,
|
|
@@ -222,6 +262,7 @@ export {
|
|
|
222
262
|
ThresholdExceededEvent,
|
|
223
263
|
ThresholdCreatedEvent,
|
|
224
264
|
ThresholdApproachingEvent,
|
|
265
|
+
ModelSelectionEvent,
|
|
225
266
|
MetricUpdatedEvent,
|
|
226
267
|
MetricDefinedEvent,
|
|
227
268
|
MeteringEvents
|
package/dist/node/index.js
CHANGED
|
@@ -1770,6 +1770,45 @@ var ThresholdApproachingEvent = defineEvent({
|
|
|
1770
1770
|
},
|
|
1771
1771
|
payload: ThresholdApproachingPayload
|
|
1772
1772
|
});
|
|
1773
|
+
var ModelSelectionPayload = defineSchemaModel2({
|
|
1774
|
+
name: "ModelSelectionEventPayload",
|
|
1775
|
+
description: "Payload when an AI model is selected via ranking",
|
|
1776
|
+
fields: {
|
|
1777
|
+
modelId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1778
|
+
providerKey: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1779
|
+
dimension: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
1780
|
+
score: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
1781
|
+
reason: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
1782
|
+
alternativesCount: {
|
|
1783
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
1784
|
+
isOptional: false
|
|
1785
|
+
},
|
|
1786
|
+
costEstimateInput: {
|
|
1787
|
+
type: ScalarTypeEnum2.Float_unsecure(),
|
|
1788
|
+
isOptional: true
|
|
1789
|
+
},
|
|
1790
|
+
costEstimateOutput: {
|
|
1791
|
+
type: ScalarTypeEnum2.Float_unsecure(),
|
|
1792
|
+
isOptional: true
|
|
1793
|
+
},
|
|
1794
|
+
selectionDurationMs: {
|
|
1795
|
+
type: ScalarTypeEnum2.Float_unsecure(),
|
|
1796
|
+
isOptional: true
|
|
1797
|
+
},
|
|
1798
|
+
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
1799
|
+
}
|
|
1800
|
+
});
|
|
1801
|
+
var ModelSelectionEvent = defineEvent({
|
|
1802
|
+
meta: {
|
|
1803
|
+
key: "model.selected",
|
|
1804
|
+
version: "1.0.0",
|
|
1805
|
+
description: "An AI model has been selected via ranking-driven selection.",
|
|
1806
|
+
stability: "experimental",
|
|
1807
|
+
owners: ["@platform.metering"],
|
|
1808
|
+
tags: ["metering", "ai", "model-selection"]
|
|
1809
|
+
},
|
|
1810
|
+
payload: ModelSelectionPayload
|
|
1811
|
+
});
|
|
1773
1812
|
var MeteringEvents = {
|
|
1774
1813
|
MetricDefinedEvent,
|
|
1775
1814
|
MetricUpdatedEvent,
|
|
@@ -1778,7 +1817,8 @@ var MeteringEvents = {
|
|
|
1778
1817
|
UsageAggregatedEvent,
|
|
1779
1818
|
ThresholdCreatedEvent,
|
|
1780
1819
|
ThresholdExceededEvent,
|
|
1781
|
-
ThresholdApproachingEvent
|
|
1820
|
+
ThresholdApproachingEvent,
|
|
1821
|
+
ModelSelectionEvent
|
|
1782
1822
|
};
|
|
1783
1823
|
|
|
1784
1824
|
// src/metering.feature.ts
|
|
@@ -1859,6 +1899,7 @@ export {
|
|
|
1859
1899
|
PosthogMeteringReporter,
|
|
1860
1900
|
PosthogMeteringReader,
|
|
1861
1901
|
PeriodTypeEnum,
|
|
1902
|
+
ModelSelectionEvent,
|
|
1862
1903
|
MetricUpdatedEvent,
|
|
1863
1904
|
MetricDefinitionModel,
|
|
1864
1905
|
MetricDefinitionEntity,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/lib.metering",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Usage metering and billing core module for ContractSpec applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"typecheck": "tsc --noEmit"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@contractspec/lib.schema": "3.
|
|
31
|
-
"@contractspec/lib.contracts-spec": "3.
|
|
32
|
-
"@contractspec/lib.contracts-integrations": "3.
|
|
30
|
+
"@contractspec/lib.schema": "3.1.0",
|
|
31
|
+
"@contractspec/lib.contracts-spec": "3.1.1",
|
|
32
|
+
"@contractspec/lib.contracts-integrations": "3.1.1",
|
|
33
33
|
"zod": "^4.3.5"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@contractspec/tool.typescript": "3.
|
|
36
|
+
"@contractspec/tool.typescript": "3.1.0",
|
|
37
37
|
"typescript": "^5.9.3",
|
|
38
|
-
"@contractspec/tool.bun": "3.
|
|
38
|
+
"@contractspec/tool.bun": "3.1.0"
|
|
39
39
|
},
|
|
40
40
|
"exports": {
|
|
41
41
|
".": {
|