@answerlayer/cli 0.1.16 → 0.1.18
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/README.md +1 -1
- package/package.json +1 -1
- package/src/cli.js +13 -1
- package/src/local.js +1 -0
package/README.md
CHANGED
|
@@ -270,7 +270,7 @@ answerlayer inquiry models
|
|
|
270
270
|
answerlayer inquiry ask --connection <connection-id> --model claude-opus-4-6 "Investigate unusual revenue changes"
|
|
271
271
|
|
|
272
272
|
answerlayer evals suites create --name "Revenue checks" --connection <connection-id>
|
|
273
|
-
answerlayer evals cases create <suite-id> --title "Monthly revenue" --question "What was revenue last month?" --category Revenue --expected-sql "select sum(amount) from orders where ..."
|
|
273
|
+
answerlayer evals cases create <suite-id> --title "Monthly revenue" --question "What was revenue last month?" --category Revenue --expected-sql "select sum(amount) from orders where ..." --oracle-sources '[{"kind":"external","title":"Revenue policy","url":"https://example.com/revenue-policy"}]'
|
|
274
274
|
answerlayer evals runs create <suite-id> --label "Before prompt change"
|
|
275
275
|
answerlayer evals runs create <suite-id> --case <case-id> --case <case-id> --label "Focused smoke run"
|
|
276
276
|
answerlayer evals runs create <suite-id> --category Revenue --category Finance --case <case-id> --label "Focused category run"
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -1168,6 +1168,7 @@ function evalCasePayload(flags) {
|
|
|
1168
1168
|
expected_answer: firstValue(flags.expectedAnswer),
|
|
1169
1169
|
expected_sql: firstValue(flags.expectedSql) || firstValue(flags.sql),
|
|
1170
1170
|
expected_values: parseJsonFlag(firstValue(flags.expectedValues), "expected-values"),
|
|
1171
|
+
oracle_sources: parseJsonArrayFlag(firstValue(flags.oracleSources), "oracle-sources"),
|
|
1171
1172
|
required_tools: optionalCsvOrRepeated(flags.requiredTool),
|
|
1172
1173
|
forbidden_tools: optionalCsvOrRepeated(flags.forbiddenTool),
|
|
1173
1174
|
tags: optionalCsvOrRepeated(flags.tag),
|
|
@@ -1458,6 +1459,7 @@ function normalizeFlagName(rawName) {
|
|
|
1458
1459
|
"--expected-answer": "expectedAnswer",
|
|
1459
1460
|
"--expected-sql": "expectedSql",
|
|
1460
1461
|
"--expected-values": "expectedValues",
|
|
1462
|
+
"--oracle-sources": "oracleSources",
|
|
1461
1463
|
"--required-tool": "requiredTool",
|
|
1462
1464
|
"--forbidden-tool": "forbiddenTool",
|
|
1463
1465
|
"--tag": "tag",
|
|
@@ -1498,6 +1500,15 @@ function parseJsonFlag(value, name) {
|
|
|
1498
1500
|
}
|
|
1499
1501
|
}
|
|
1500
1502
|
|
|
1503
|
+
function parseJsonArrayFlag(value, name) {
|
|
1504
|
+
const parsed = parseJsonFlag(value, name);
|
|
1505
|
+
if (parsed === undefined) return undefined;
|
|
1506
|
+
if (!Array.isArray(parsed)) {
|
|
1507
|
+
throw usage(`Expected --${name} to be a JSON array`);
|
|
1508
|
+
}
|
|
1509
|
+
return parsed;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1501
1512
|
function parseInteger(value, fallback) {
|
|
1502
1513
|
if (value === undefined || value === null || value === "") return fallback;
|
|
1503
1514
|
const parsed = Number.parseInt(value, 10);
|
|
@@ -1646,7 +1657,8 @@ Data products:
|
|
|
1646
1657
|
answerlayer evals suites list|create|get|update|delete
|
|
1647
1658
|
answerlayer evals cases create|update|delete
|
|
1648
1659
|
answerlayer evals runs list|create|create-batch|get|update|cancel|compare|analyze
|
|
1649
|
-
case create/update accept --category <name>
|
|
1660
|
+
case create/update accept --category <name> and
|
|
1661
|
+
--oracle-sources '<JSON array>'
|
|
1650
1662
|
run create accepts --case <case-id> (repeat or comma-separate) and
|
|
1651
1663
|
--category <name> (repeat; category and case selectors are unioned),
|
|
1652
1664
|
--concurrency <1-8> (default 3; 1 is serial), and
|
package/src/local.js
CHANGED
|
@@ -218,6 +218,7 @@ async function localProviderSet(parsed, io, provider, action) {
|
|
|
218
218
|
writeEnvironmentValue(runtime.envPath, provider.environmentName, secret);
|
|
219
219
|
try {
|
|
220
220
|
restartProviderRuntime(runtime, run);
|
|
221
|
+
await waitUntilReady(`http://127.0.0.1:${runtime.state.port}`, io);
|
|
221
222
|
} catch {
|
|
222
223
|
rollbackProviderCredential(runtime, run, provider, existingSecret, "updating");
|
|
223
224
|
throw new Error(`Could not restart AnswerLayer with the new ${provider.label} credential. The previous configuration was restored.`);
|