@onyx.dev/onyx-database 2.1.1 → 2.3.0

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.
@@ -1520,6 +1520,27 @@ var OnyxDatabaseImpl = class {
1520
1520
  const { http } = await this.ensureAiClient();
1521
1521
  return http.request("POST", "/api/script-approvals", input);
1522
1522
  }
1523
+ async predict(publishedModelId, inputs) {
1524
+ const { http, databaseId } = await this.ensureClient();
1525
+ const path = `/data/${encodeURIComponent(
1526
+ databaseId
1527
+ )}/model-builder/published-model/${encodeURIComponent(publishedModelId)}/predict`;
1528
+ return http.request(
1529
+ "POST",
1530
+ path,
1531
+ serializeDates({ inputs })
1532
+ );
1533
+ }
1534
+ async predictFromScript(publishedModelId, scriptId, scriptParameters = {}) {
1535
+ const { http, databaseId } = await this.ensureClient();
1536
+ const path = `/data/${encodeURIComponent(
1537
+ databaseId
1538
+ )}/model-builder/published-model/${encodeURIComponent(publishedModelId)}/predict/script`;
1539
+ return http.request("POST", path, {
1540
+ scriptId,
1541
+ scriptParameters
1542
+ });
1543
+ }
1523
1544
  from(table) {
1524
1545
  return new QueryBuilderImpl(this, String(table), this.defaultPartition);
1525
1546
  }