runbios-sdk 0.2.1-dev.115 → 0.2.1-dev.116

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
@@ -36,7 +36,7 @@ import { Loop } from './resources/loop.js';
36
36
  * SDK version. Sent as part of the User-Agent header.
37
37
  * Must match package.json "version" -- enforced by a contract test.
38
38
  */
39
- export declare const VERSION = "0.2.1-dev.115";
39
+ export declare const VERSION = "0.2.1-dev.116";
40
40
  export declare class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  readonly models: Models;
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import { Loop } from './resources/loop.js';
36
36
  * SDK version. Sent as part of the User-Agent header.
37
37
  * Must match package.json "version" -- enforced by a contract test.
38
38
  */
39
- export const VERSION = '0.2.1-dev.115';
39
+ export const VERSION = '0.2.1-dev.116';
40
40
  export class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  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, LoopLabel, LoopLabelCount, LoopGradeResult, LoopDataset, LoopDatasetListParams, LoopDatasetItem, LoopDatasetCreateParams, LoopConfig, LoopConfigParams, LoopStats, LoopJudge, LoopJudgeParams, LoopJudgeRun, LoopJudgeWork, LoopJudgeVerdict, LoopJudgeVerdictResult } from '../types.js';
2
+ import type { LoopTrace, LoopTraceListResponse, LoopTraceListParams, LoopCaptureParams, LoopCaptureResult, LoopImportParams, LoopImportResult, LoopSignal, LoopSignalParams, LoopCandidate, LoopCandidateParams, LoopGrader, LoopGraderParams, LoopLabel, LoopLabelCount, LoopGradeResult, LoopDataset, LoopDatasetListParams, LoopDatasetItem, LoopDatasetCreateParams, LoopConfig, LoopConfigParams, LoopStats, LoopJudge, LoopJudgeParams, LoopJudgeRun, LoopJudgeWork, LoopJudgeVerdict, LoopJudgeVerdictResult } 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.
@@ -59,6 +59,33 @@ export declare class Loop {
59
59
  * your application.
60
60
  */
61
61
  capture(params: LoopCaptureParams): Promise<LoopCaptureResult>;
62
+ /**
63
+ * Bring data you already have into the loop.
64
+ *
65
+ * This does NOT create a training set. It creates conversations, in the same
66
+ * place captured ones live and subject to the same review, rules, judges and
67
+ * labels. A row becomes trainable when something says it is good, never
68
+ * because it arrived in a file -- which is the one guarantee that separates
69
+ * a corpus from a pile.
70
+ *
71
+ * Each row is read for what it actually is. A `prompt`/`chosen`/`rejected`
72
+ * triple becomes a preference pair; an answer plus a yes-or-no becomes a
73
+ * thumbs verdict; a question and an answer waits for review; a question with
74
+ * no answer waits for an answer; a paragraph of prose is refused, because it
75
+ * is not a conversation.
76
+ *
77
+ * A verdict that arrives *with* the file is kept -- discarding somebody's
78
+ * judgement would be worse -- but it is recorded as having come from your
79
+ * earlier process rather than from a reviewer here, and the conversation
80
+ * records that it was imported. Neither fact can be reconstructed later, so
81
+ * both are written at the door.
82
+ *
83
+ * `source` is required and becomes the id every imported conversation is
84
+ * filed under: "everything in one bucket called import" is a corpus nobody
85
+ * can slice afterwards. At most 5000 rows per call, because the call is
86
+ * synchronous and somebody is waiting on it.
87
+ */
88
+ importRows(params: LoopImportParams): Promise<LoopImportResult>;
62
89
  /** List captured conversations, newest first. */
63
90
  listTraces(params?: LoopTraceListParams): Promise<LoopTraceListResponse>;
64
91
  /** Read one conversation, with every verdict recorded on it. */
@@ -62,6 +62,35 @@ export class Loop {
62
62
  async capture(params) {
63
63
  return this._http.fetchPost('/api/loop/traces', params);
64
64
  }
65
+ /**
66
+ * Bring data you already have into the loop.
67
+ *
68
+ * This does NOT create a training set. It creates conversations, in the same
69
+ * place captured ones live and subject to the same review, rules, judges and
70
+ * labels. A row becomes trainable when something says it is good, never
71
+ * because it arrived in a file -- which is the one guarantee that separates
72
+ * a corpus from a pile.
73
+ *
74
+ * Each row is read for what it actually is. A `prompt`/`chosen`/`rejected`
75
+ * triple becomes a preference pair; an answer plus a yes-or-no becomes a
76
+ * thumbs verdict; a question and an answer waits for review; a question with
77
+ * no answer waits for an answer; a paragraph of prose is refused, because it
78
+ * is not a conversation.
79
+ *
80
+ * A verdict that arrives *with* the file is kept -- discarding somebody's
81
+ * judgement would be worse -- but it is recorded as having come from your
82
+ * earlier process rather than from a reviewer here, and the conversation
83
+ * records that it was imported. Neither fact can be reconstructed later, so
84
+ * both are written at the door.
85
+ *
86
+ * `source` is required and becomes the id every imported conversation is
87
+ * filed under: "everything in one bucket called import" is a corpus nobody
88
+ * can slice afterwards. At most 5000 rows per call, because the call is
89
+ * synchronous and somebody is waiting on it.
90
+ */
91
+ async importRows(params) {
92
+ return this._http.fetchPost('/api/loop/import', params);
93
+ }
65
94
  // ── traces ────────────────────────────────────────────────────────────
66
95
  /** List captured conversations, newest first. */
67
96
  async listTraces(params = {}) {
package/dist/types.d.ts CHANGED
@@ -2046,6 +2046,35 @@ export interface LoopCaptureResult {
2046
2046
  /** Why nothing was stored, e.g. `capture_disabled`, `not_sampled`. */
2047
2047
  reason?: string;
2048
2048
  }
2049
+ export interface LoopImportParams {
2050
+ /**
2051
+ * Where this came from. Required, and becomes the id every imported
2052
+ * conversation is filed under, so the import stays sliceable later.
2053
+ */
2054
+ source: string;
2055
+ /** The file, already parsed. At most 5000 rows per call. */
2056
+ rows: Record<string, unknown>[];
2057
+ /** Which model produced these, when the rows do not say per-row. */
2058
+ model?: string;
2059
+ /** Applied to every row: importing a dump is when somebody knows what it is. */
2060
+ labels?: string[];
2061
+ attributes?: Record<string, string>;
2062
+ }
2063
+ export interface LoopImportResult {
2064
+ imported: number;
2065
+ /**
2066
+ * How many arrived carrying a verdict. Reported apart from `imported`
2067
+ * because it is the difference between data you can train on and data
2068
+ * somebody still has to look at.
2069
+ */
2070
+ reviewed: number;
2071
+ needs_review: number;
2072
+ refused: number;
2073
+ /** How many rows of each recognised shape, so a mis-shaped file is visible. */
2074
+ by_shape: Record<string, number>;
2075
+ refused_why: Record<string, number>;
2076
+ notes: string[];
2077
+ }
2049
2078
  export interface LoopSignal {
2050
2079
  id: string;
2051
2080
  trace_id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runbios-sdk",
3
- "version": "0.2.1-dev.115",
3
+ "version": "0.2.1-dev.116",
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",
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "scripts": {
22
22
  "build": "tsc",
23
- "test": "npm run build && node --test test/contracts.test.mjs test/capacity-contract.test.mjs test/contract-drift.test.mjs test/inference-param-naming.test.mjs test/coming-soon.test.mjs",
23
+ "test": "npm run build && node --test \"test/*.test.mjs\"",
24
24
  "clean": "rm -rf dist",
25
25
  "prepack": "npm run clean && npm run build"
26
26
  },