@tryvira/sdk 0.1.30 → 0.1.32
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 +3 -10
- package/dist/index.js +10 -3
- package/dist/js-client.d.ts +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ approved behavior, and resolve it at runtime.
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install @tryvira/sdk@0.1.
|
|
10
|
+
npm install @tryvira/sdk@0.1.31
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Configure the organization, project, and environment for every request. Keep the API
|
|
@@ -112,17 +112,10 @@ const imported = await vira.importPack({
|
|
|
112
112
|
const packId = String(imported.body.pack.id);
|
|
113
113
|
await vira.installPack(packId, { variables: {} });
|
|
114
114
|
const evaluation = await vira.evaluatePack(packId, {
|
|
115
|
-
|
|
116
|
-
rubric: {
|
|
117
|
-
taskCorrectness: 1,
|
|
118
|
-
behaviorCompliance: 1,
|
|
119
|
-
groundedness: 1,
|
|
120
|
-
safetyAuthority: 1,
|
|
121
|
-
usefulSpecificity: 1,
|
|
122
|
-
},
|
|
115
|
+
evaluationId: "evaluation-from-vira-provider",
|
|
123
116
|
idempotencyKey: "pack:evaluate:support.billing:1.0.0",
|
|
124
117
|
});
|
|
125
|
-
if (evaluation.body.
|
|
118
|
+
if (evaluation.body.pack?.status !== "EVALUATED") throw new Error("Pack evaluation was not accepted");
|
|
126
119
|
await vira.approvePack(packId);
|
|
127
120
|
await vira.releasePack(packId);
|
|
128
121
|
```
|
package/dist/index.js
CHANGED
|
@@ -197,6 +197,11 @@ var ViraClient = class {
|
|
|
197
197
|
trace(event, options = {}) {
|
|
198
198
|
return this.observe({ ...event, eventType: "model.response" }, options);
|
|
199
199
|
}
|
|
200
|
+
searchRuntimeTraces(query = {}) {
|
|
201
|
+
const params = new URLSearchParams();
|
|
202
|
+
for (const [key, value] of Object.entries(query)) if (value !== void 0) params.set(key, String(value));
|
|
203
|
+
return this.request({ method: "GET", path: `/v1/runtime/traces/search${params.size ? `?${params.toString()}` : ""}` });
|
|
204
|
+
}
|
|
200
205
|
outcome(event, options = {}) {
|
|
201
206
|
return this.observe({ ...event, eventType: "business.outcome" }, options);
|
|
202
207
|
}
|
|
@@ -716,10 +721,12 @@ var ViraClient = class {
|
|
|
716
721
|
{ idempotencyKey: options.idempotencyKey }
|
|
717
722
|
);
|
|
718
723
|
}
|
|
719
|
-
/**
|
|
724
|
+
/** Request a server-executed OFF/current-ON/candidate-ON comparison.
|
|
725
|
+
* The server owns arm execution and receipts; callers cannot submit outputs.
|
|
726
|
+
*/
|
|
720
727
|
startComparativeEvaluation(input, options = {}) {
|
|
721
|
-
if (!
|
|
722
|
-
throw new Error("
|
|
728
|
+
if (!input.comparisonPlan || typeof input.comparisonPlan !== "object")
|
|
729
|
+
throw new Error("SDK_COMPARISON_PLAN_REQUIRED");
|
|
723
730
|
return this.startEvaluation(input, options);
|
|
724
731
|
}
|
|
725
732
|
evaluateQuality(input, options = {}) {
|
package/dist/js-client.d.ts
CHANGED
|
@@ -176,6 +176,12 @@ export declare class ViraClient {
|
|
|
176
176
|
}, options?: {
|
|
177
177
|
idempotencyKey?: string;
|
|
178
178
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
179
|
+
searchRuntimeTraces(query?: {
|
|
180
|
+
limit?: number;
|
|
181
|
+
cursor?: string;
|
|
182
|
+
query?: string;
|
|
183
|
+
event?: string;
|
|
184
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
179
185
|
outcome(event: {
|
|
180
186
|
eventId: string;
|
|
181
187
|
aiSystemId: string;
|
|
@@ -417,9 +423,11 @@ export declare class ViraClient {
|
|
|
417
423
|
startEvaluation(input: ClientBody, options?: {
|
|
418
424
|
idempotencyKey?: string;
|
|
419
425
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
420
|
-
/**
|
|
426
|
+
/** Request a server-executed OFF/current-ON/candidate-ON comparison.
|
|
427
|
+
* The server owns arm execution and receipts; callers cannot submit outputs.
|
|
428
|
+
*/
|
|
421
429
|
startComparativeEvaluation(input: ClientBody & {
|
|
422
|
-
|
|
430
|
+
comparisonPlan: ClientBody;
|
|
423
431
|
}, options?: {
|
|
424
432
|
idempotencyKey?: string;
|
|
425
433
|
}): Promise<ViraResponse<ClientBody> | null>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryvira/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.32",
|
|
4
4
|
"description": "Typed Vira SDK for connect-once, observation and governed runtime execution.",
|
|
5
5
|
"keywords": ["vira", "ai-governance", "ai-runtime", "semantic-routing"],
|
|
6
6
|
"engines": {"node": ">=20"},
|