axiom 0.28.0 → 0.29.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/bin.cjs +29 -18
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +21 -292
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-CSMSR3XW.js → chunk-FGCJRUMS.js} +474 -202
- package/dist/chunk-FGCJRUMS.js.map +1 -0
- package/dist/{chunk-WMSQHW3M.js → chunk-OUXR3N2M.js} +182 -175
- package/dist/chunk-OUXR3N2M.js.map +1 -0
- package/dist/evals.cjs +210 -112
- package/dist/evals.cjs.map +1 -1
- package/dist/evals.d.cts +1 -0
- package/dist/evals.d.ts +1 -0
- package/dist/evals.js +106 -46
- package/dist/evals.js.map +1 -1
- package/dist/index.cjs +181 -174
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CSMSR3XW.js.map +0 -1
- package/dist/chunk-WMSQHW3M.js.map +0 -1
package/dist/bin.cjs
CHANGED
|
@@ -260,7 +260,7 @@ var import_api4 = require("@opentelemetry/api");
|
|
|
260
260
|
// package.json
|
|
261
261
|
var package_default = {
|
|
262
262
|
name: "axiom",
|
|
263
|
-
version: "0.
|
|
263
|
+
version: "0.29.1",
|
|
264
264
|
type: "module",
|
|
265
265
|
author: "Axiom, Inc.",
|
|
266
266
|
contributors: [
|
|
@@ -880,7 +880,8 @@ function calculateFlagDiff(suite) {
|
|
|
880
880
|
function printFinalReport({
|
|
881
881
|
suiteData,
|
|
882
882
|
config,
|
|
883
|
-
registrationStatus
|
|
883
|
+
registrationStatus,
|
|
884
|
+
isDebug
|
|
884
885
|
}) {
|
|
885
886
|
console.log("");
|
|
886
887
|
console.log(u.bgBlue(u.white(" FINAL EVALUATION REPORT ")));
|
|
@@ -898,6 +899,8 @@ function printFinalReport({
|
|
|
898
899
|
if (anyRegistered && orgId && config?.consoleEndpointUrl) {
|
|
899
900
|
console.log("View full report:");
|
|
900
901
|
console.log(`${config.consoleEndpointUrl}/${orgId}/ai-engineering/evaluations?runId=${runId}`);
|
|
902
|
+
} else if (isDebug) {
|
|
903
|
+
console.log(u.dim("Results not uploaded to Axiom (debug mode)"));
|
|
901
904
|
} else {
|
|
902
905
|
console.log("Results not available in Axiom UI (registration failed)");
|
|
903
906
|
}
|
|
@@ -920,11 +923,8 @@ var buildConsoleUrl = (urlString) => {
|
|
|
920
923
|
const url = new URL(urlString);
|
|
921
924
|
return `${url.protocol}//app.${url.host.split("api.").at(-1)}`;
|
|
922
925
|
};
|
|
923
|
-
function resolveAxiomConnection(config) {
|
|
924
|
-
|
|
925
|
-
if ("__overrideEndpointUrl" in config.eval) {
|
|
926
|
-
consoleEndpointUrl = config.eval.__overrideEndpointUrl;
|
|
927
|
-
}
|
|
926
|
+
function resolveAxiomConnection(config, consoleUrlOverride) {
|
|
927
|
+
const consoleEndpointUrl = consoleUrlOverride ?? buildConsoleUrl(config.eval.url);
|
|
928
928
|
return {
|
|
929
929
|
url: config.eval.url,
|
|
930
930
|
consoleEndpointUrl,
|
|
@@ -949,7 +949,7 @@ var AxiomReporter = class {
|
|
|
949
949
|
this.startTime = (/* @__PURE__ */ new Date()).getTime();
|
|
950
950
|
const config = getAxiomConfig();
|
|
951
951
|
if (config) {
|
|
952
|
-
this._config = resolveAxiomConnection(config);
|
|
952
|
+
this._config = resolveAxiomConnection(config, getConsoleUrl());
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
955
|
async onTestSuiteReady(_testSuite) {
|
|
@@ -978,6 +978,9 @@ var AxiomReporter = class {
|
|
|
978
978
|
if (testSuite.state() === "skipped" || !meta?.evaluation) {
|
|
979
979
|
return;
|
|
980
980
|
}
|
|
981
|
+
if (meta.evaluation.configEnd && !this._endOfRunConfigEnd) {
|
|
982
|
+
this._endOfRunConfigEnd = meta.evaluation.configEnd;
|
|
983
|
+
}
|
|
981
984
|
const durationSeconds = Number((performance.now() - this.start) / 1e3).toFixed(2);
|
|
982
985
|
const cases = [];
|
|
983
986
|
for (const test of testSuite.children) {
|
|
@@ -1027,12 +1030,13 @@ var AxiomReporter = class {
|
|
|
1027
1030
|
registered: suite.registrationStatus?.status === "success",
|
|
1028
1031
|
error: suite.registrationStatus?.status === "failed" ? suite.registrationStatus.error : void 0
|
|
1029
1032
|
}));
|
|
1033
|
+
const DEBUG = process.env.AXIOM_DEBUG === "true";
|
|
1030
1034
|
printFinalReport({
|
|
1031
1035
|
suiteData: this._suiteData,
|
|
1032
1036
|
config: this._config,
|
|
1033
|
-
registrationStatus
|
|
1037
|
+
registrationStatus,
|
|
1038
|
+
isDebug: DEBUG
|
|
1034
1039
|
});
|
|
1035
|
-
const DEBUG = process.env.AXIOM_DEBUG === "true";
|
|
1036
1040
|
if (DEBUG && this._endOfRunConfigEnd) {
|
|
1037
1041
|
this.printConfigEnd(this._endOfRunConfigEnd);
|
|
1038
1042
|
}
|
|
@@ -1545,11 +1549,11 @@ function setupEvalProvider(connection) {
|
|
|
1545
1549
|
axiomProvider = new import_sdk_trace_node.NodeTracerProvider({
|
|
1546
1550
|
resource: (0, import_resources.resourceFromAttributes)({
|
|
1547
1551
|
["service.name"]: "axiom",
|
|
1548
|
-
["service.version"]: "0.
|
|
1552
|
+
["service.version"]: "0.29.1"
|
|
1549
1553
|
}),
|
|
1550
1554
|
spanProcessors: [processor]
|
|
1551
1555
|
});
|
|
1552
|
-
axiomTracer = axiomProvider.getTracer("axiom", "0.
|
|
1556
|
+
axiomTracer = axiomProvider.getTracer("axiom", "0.29.1");
|
|
1553
1557
|
}
|
|
1554
1558
|
async function initInstrumentation(config) {
|
|
1555
1559
|
if (initialized) {
|
|
@@ -1561,7 +1565,7 @@ async function initInstrumentation(config) {
|
|
|
1561
1565
|
}
|
|
1562
1566
|
initializationPromise = (async () => {
|
|
1563
1567
|
if (!config.enabled) {
|
|
1564
|
-
axiomTracer = import_api10.trace.getTracer("axiom", "0.
|
|
1568
|
+
axiomTracer = import_api10.trace.getTracer("axiom", "0.29.1");
|
|
1565
1569
|
initialized = true;
|
|
1566
1570
|
return;
|
|
1567
1571
|
}
|
|
@@ -1703,7 +1707,8 @@ var runVitest = async (dir, opts) => {
|
|
|
1703
1707
|
list: opts.list,
|
|
1704
1708
|
overrides: opts.overrides,
|
|
1705
1709
|
axiomConfig: providedConfig,
|
|
1706
|
-
runId: opts.runId
|
|
1710
|
+
runId: opts.runId,
|
|
1711
|
+
consoleUrl: opts.consoleUrl
|
|
1707
1712
|
}
|
|
1708
1713
|
});
|
|
1709
1714
|
if (opts.list) {
|
|
@@ -1775,6 +1780,10 @@ function isGlob(str) {
|
|
|
1775
1780
|
|
|
1776
1781
|
// src/cli/commands/eval.command.ts
|
|
1777
1782
|
var createRunId = (0, import_nanoid.customAlphabet)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 10);
|
|
1783
|
+
var consoleUrl;
|
|
1784
|
+
function getConsoleUrl() {
|
|
1785
|
+
return consoleUrl;
|
|
1786
|
+
}
|
|
1778
1787
|
function getDefaultToken(value) {
|
|
1779
1788
|
if (typeof value === "string") {
|
|
1780
1789
|
return value;
|
|
@@ -1803,7 +1812,7 @@ var loadEvalCommand = (program2, flagOverrides = {}) => {
|
|
|
1803
1812
|
".",
|
|
1804
1813
|
"any *.eval.ts file in current directory"
|
|
1805
1814
|
)
|
|
1806
|
-
).option("-w, --watch true", "keep server running and watch for changes", false).option("-t, --token <TOKEN>", "axiom token", getDefaultToken).option("-d, --dataset <DATASET>", "axiom dataset name", process.env.AXIOM_DATASET).option("-u, --url <AXIOM URL>", "axiom url", getDefaultUrl).option("-o, --org-id <ORG ID>", "axiom organization id", getDefaultOrgId).option("-b, --baseline <BASELINE ID>", "id of baseline evaluation to compare against").option("--debug", "run locally without sending to Axiom or loading baselines", false).option("--list", "list evaluations and test cases without running them", false).action(async (target, options) => {
|
|
1815
|
+
).option("-w, --watch true", "keep server running and watch for changes", false).option("-t, --token <TOKEN>", "axiom token", getDefaultToken).option("-d, --dataset <DATASET>", "axiom dataset name", process.env.AXIOM_DATASET).option("-u, --url <AXIOM URL>", "axiom url", getDefaultUrl).option("-o, --org-id <ORG ID>", "axiom organization id", getDefaultOrgId).option("-b, --baseline <BASELINE ID>", "id of baseline evaluation to compare against").option("--debug", "run locally without sending to Axiom or loading baselines", false).option("--list", "list evaluations and test cases without running them", false).addOption(new import_commander.Option("-c, --console-url <URL>", "console url override").hideHelp()).action(async (target, options) => {
|
|
1807
1816
|
try {
|
|
1808
1817
|
if (options.debug) {
|
|
1809
1818
|
process.env.AXIOM_DEBUG = "true";
|
|
@@ -1848,6 +1857,7 @@ var loadEvalCommand = (program2, flagOverrides = {}) => {
|
|
|
1848
1857
|
console.log("");
|
|
1849
1858
|
}
|
|
1850
1859
|
const runId = createRunId();
|
|
1860
|
+
consoleUrl = options.consoleUrl;
|
|
1851
1861
|
await runEvalWithContext(flagOverrides, async () => {
|
|
1852
1862
|
return runVitest(".", {
|
|
1853
1863
|
watch: options.watch,
|
|
@@ -1859,7 +1869,8 @@ var loadEvalCommand = (program2, flagOverrides = {}) => {
|
|
|
1859
1869
|
list: options.list,
|
|
1860
1870
|
overrides: flagOverrides,
|
|
1861
1871
|
config,
|
|
1862
|
-
runId
|
|
1872
|
+
runId,
|
|
1873
|
+
consoleUrl: options.consoleUrl
|
|
1863
1874
|
});
|
|
1864
1875
|
});
|
|
1865
1876
|
} catch (error) {
|
|
@@ -2333,7 +2344,7 @@ var import_commander2 = require("commander");
|
|
|
2333
2344
|
var loadVersionCommand = (program2) => {
|
|
2334
2345
|
return program2.addCommand(
|
|
2335
2346
|
new import_commander2.Command("version").description("cli version").action(() => {
|
|
2336
|
-
console.log("0.
|
|
2347
|
+
console.log("0.29.1");
|
|
2337
2348
|
})
|
|
2338
2349
|
);
|
|
2339
2350
|
};
|
|
@@ -2343,7 +2354,7 @@ var { loadEnvConfig } = import_env.default;
|
|
|
2343
2354
|
loadEnvConfig(process.cwd());
|
|
2344
2355
|
var { cleanedArgv, overrides } = extractOverrides(process.argv.slice(2));
|
|
2345
2356
|
var program = new import_commander3.Command();
|
|
2346
|
-
program.name("axiom").description("Axiom's CLI to manage your objects and run evals").version("0.
|
|
2357
|
+
program.name("axiom").description("Axiom's CLI to manage your objects and run evals").version("0.29.1");
|
|
2347
2358
|
program.hook("preAction", async (_, actionCommand) => {
|
|
2348
2359
|
const commandName = actionCommand.name();
|
|
2349
2360
|
const parentCommand = actionCommand.parent;
|