runbios-sdk 0.2.1-dev.108 → 0.2.1-dev.109

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/index.d.ts CHANGED
@@ -35,7 +35,7 @@ import { Loop } from './resources/loop.js';
35
35
  * SDK version. Sent as part of the User-Agent header.
36
36
  * Must match package.json "version" -- enforced by a contract test.
37
37
  */
38
- export declare const VERSION = "0.2.1-dev.108";
38
+ export declare const VERSION = "0.2.1-dev.109";
39
39
  export declare class RunBiOS {
40
40
  /** Search models, fetch configs, check adapter compatibility. */
41
41
  readonly models: Models;
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ import { Loop } from './resources/loop.js';
35
35
  * SDK version. Sent as part of the User-Agent header.
36
36
  * Must match package.json "version" -- enforced by a contract test.
37
37
  */
38
- export const VERSION = '0.2.1-dev.108';
38
+ export const VERSION = '0.2.1-dev.109';
39
39
  export class RunBiOS {
40
40
  /** Search models, fetch configs, check adapter compatibility. */
41
41
  models;
@@ -1,5 +1,5 @@
1
1
  import type { HttpClient } from '../client.js';
2
- import type { LoopTrace, LoopTraceListResponse, LoopTraceListParams, LoopCaptureParams, LoopCaptureResult, LoopSignal, LoopSignalParams, LoopCandidate, LoopCandidateParams, LoopGrader, LoopGraderParams, LoopGradeResult, LoopDataset, LoopDatasetListParams, LoopDatasetItem, LoopDatasetCreateParams, LoopConfig, LoopConfigParams, LoopStats } from '../types.js';
2
+ import type { LoopTrace, LoopTraceListResponse, LoopTraceListParams, LoopCaptureParams, LoopCaptureResult, LoopSignal, LoopSignalParams, LoopCandidate, LoopCandidateParams, LoopGrader, LoopGraderParams, LoopLabel, LoopLabelCount, LoopGradeResult, LoopDataset, LoopDatasetListParams, LoopDatasetItem, LoopDatasetCreateParams, LoopConfig, LoopConfigParams, LoopStats } from '../types.js';
3
3
  /**
4
4
  * The Conscious Loop -- capture what your model was asked and answered, record
5
5
  * whether it was right, and turn those judgements into training data.
@@ -157,6 +157,27 @@ export declare class Loop {
157
157
  addCandidate(traceId: string, params: LoopCandidateParams): Promise<LoopCandidate>;
158
158
  /** Every alternative answer recorded for one prompt, oldest first. */
159
159
  listCandidates(traceId: string): Promise<LoopCandidate[]>;
160
+ /**
161
+ * Label a conversation, so it can be selected later.
162
+ *
163
+ * An average over everything is the least useful thing to train on. A model
164
+ * weak at refunds is fixed with refund examples, and you can only select
165
+ * those if you said so when the conversation arrived.
166
+ *
167
+ * A label may name a `parent`, which is what makes a MASTER GROUP: labelling
168
+ * something `refunds` with parent `billing` makes it selectable as either,
169
+ * and selecting `billing` later gathers every child without you maintaining
170
+ * a list of them.
171
+ *
172
+ * Labels are lowercased and trimmed, so `Refunds` and `refunds` are one label.
173
+ */
174
+ label(traceId: string, labels: string[], parent?: string): Promise<LoopLabel[]>;
175
+ unlabel(traceId: string, label: string): Promise<{
176
+ deleted: boolean;
177
+ label: string;
178
+ }>;
179
+ /** Every label in the workspace, with how many conversations carry it. */
180
+ listLabels(): Promise<LoopLabelCount[]>;
160
181
  /**
161
182
  * Build a training set from the feedback recorded so far.
162
183
  *
@@ -203,6 +203,33 @@ export class Loop {
203
203
  const res = await this._http.fetchGet(`/api/loop/traces/${encodeURIComponent(traceId)}/candidates`);
204
204
  return res.candidates;
205
205
  }
206
+ // ── labels ────────────────────────────────────────────────────────────
207
+ /**
208
+ * Label a conversation, so it can be selected later.
209
+ *
210
+ * An average over everything is the least useful thing to train on. A model
211
+ * weak at refunds is fixed with refund examples, and you can only select
212
+ * those if you said so when the conversation arrived.
213
+ *
214
+ * A label may name a `parent`, which is what makes a MASTER GROUP: labelling
215
+ * something `refunds` with parent `billing` makes it selectable as either,
216
+ * and selecting `billing` later gathers every child without you maintaining
217
+ * a list of them.
218
+ *
219
+ * Labels are lowercased and trimmed, so `Refunds` and `refunds` are one label.
220
+ */
221
+ async label(traceId, labels, parent) {
222
+ const res = await this._http.fetchPost(`/api/loop/traces/${encodeURIComponent(traceId)}/labels`, { labels, parent });
223
+ return res.labels;
224
+ }
225
+ async unlabel(traceId, label) {
226
+ return this._http.fetchDelete(`/api/loop/traces/${encodeURIComponent(traceId)}/labels/${encodeURIComponent(label)}`);
227
+ }
228
+ /** Every label in the workspace, with how many conversations carry it. */
229
+ async listLabels() {
230
+ const res = await this._http.fetchGet('/api/loop/labels');
231
+ return res.labels;
232
+ }
206
233
  // ── training sets ─────────────────────────────────────────────────────
207
234
  /**
208
235
  * Build a training set from the feedback recorded so far.
package/dist/types.d.ts CHANGED
@@ -2085,6 +2085,10 @@ export interface LoopDatasetCreateParams {
2085
2085
  deployment_id?: string;
2086
2086
  from?: string;
2087
2087
  to?: string;
2088
+ /** Narrow to one slice. A label with children selects them too. */
2089
+ label?: string;
2090
+ /** Take this many at random from what the filters matched. */
2091
+ sample?: number;
2088
2092
  /** Holds back your most recent work, not a random slice. 0-50. */
2089
2093
  holdout_percent?: number;
2090
2094
  max_items?: number;
@@ -2237,3 +2241,15 @@ export interface LoopGradeResult {
2237
2241
  signal_id: string | null;
2238
2242
  candidates_graded: number;
2239
2243
  }
2244
+ export interface LoopLabel {
2245
+ label: string;
2246
+ /** The master group this label belongs to, if any. */
2247
+ parent: string | null;
2248
+ created_by: string | null;
2249
+ created_at: string;
2250
+ }
2251
+ export interface LoopLabelCount {
2252
+ label: string;
2253
+ parent: string | null;
2254
+ traces: number;
2255
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runbios-sdk",
3
- "version": "0.2.1-dev.108",
3
+ "version": "0.2.1-dev.109",
4
4
  "description": "Official TypeScript SDK for the Run BiOS training and deployment platform API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",