Comparing version 0.0.30 to 0.0.31
@@ -70,3 +70,3 @@ "use strict"; | ||
this.FXNC_CACHE_ROOT = `${this.FXNC_DATA_ROOT}/cache`; | ||
this.FXNC_VERSION = "0.0.15"; | ||
this.FXNC_VERSION = "0.0.18"; | ||
this.FXNC_LIB_URL_BASE = `https://cdn.fxn.ai/edgefxn/${this.FXNC_VERSION}`; | ||
@@ -465,3 +465,3 @@ this.client = client; | ||
for (const [key, value] of Object.entries(inputs)) { | ||
const pValue = this.plainToEdgeValue(value); | ||
const pValue = this.toEdgeValue(value); | ||
const pKey = fxnc._malloc(key.length + 1); | ||
@@ -474,3 +474,3 @@ fxnc.stringToUTF8(key, pKey, key.length + 1); | ||
// Make prediction | ||
status = fxnc._FXNPredictorPredict(predictor, pInputs, ppPrediction); | ||
status = fxnc._FXNPredictorCreatePrediction(predictor, pInputs, ppPrediction); | ||
cassert(status, `Failed to create ${tag} prediction with status: ${status}`); | ||
@@ -545,3 +545,3 @@ pPrediction = fxnc.getValue(ppPrediction, "*"); | ||
} | ||
plainToEdgeValue(value) { | ||
toEdgeValue(value) { | ||
const fxnc = this.fxnc; | ||
@@ -581,3 +581,3 @@ const ppValue = fxnc._malloc(4); | ||
const elements = value.byteLength / byteSize; | ||
return this.plainToEdgeValue({ data: value, shape: [elements] }); | ||
return this.toEdgeValue({ data: value, shape: [elements] }); | ||
} | ||
@@ -608,3 +608,3 @@ // Binary | ||
const data = Number.isInteger(value) ? new Int32Array([value]) : new Float32Array([value]); | ||
return this.plainToEdgeValue({ data, shape: [] }); | ||
return this.toEdgeValue({ data, shape: [] }); | ||
} | ||
@@ -614,7 +614,7 @@ // Bigint | ||
const data = new BigInt64Array([value]); | ||
return this.plainToEdgeValue({ data, shape: [] }); | ||
return this.toEdgeValue({ data, shape: [] }); | ||
} | ||
// Boolean | ||
if (typeof (value) === "boolean") | ||
return this.plainToEdgeValue({ data: new BoolArray([+value]), shape: [] }); | ||
return this.toEdgeValue({ data: new BoolArray([+value]), shape: [] }); | ||
// Image | ||
@@ -621,0 +621,0 @@ if ((0, value_1.isImage)(value)) { |
@@ -107,3 +107,3 @@ import { GraphClient } from "../graph"; | ||
private predict; | ||
private plainToEdgeValue; | ||
private toEdgeValue; | ||
private edgeToPlainValue; | ||
@@ -110,0 +110,0 @@ private getPredictUrl; |
{ | ||
"name": "fxnjs", | ||
"version": "0.0.30", | ||
"version": "0.0.31", | ||
"description": "Run AI prediction functions in your JavaScript and Node.js apps.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
691153