Socket
Socket
Sign inDemoInstall

@axflow/models

Package Overview
Dependencies
0
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1-alpha.8 to 0.0.1-alpha.9

5

dist/utils/index.d.ts

@@ -18,3 +18,3 @@ declare class HttpError extends Error {

type: 'chunk' | 'data';
value: Record<string, JSONValueType>;
value: JSONValueType;
};

@@ -25,3 +25,4 @@ declare class NdJsonStream {

}>;
static encode<T extends Record<string, JSONValueType>>(stream: ReadableStream<T>, options?: {
static encode<T = any>(stream: ReadableStream<T>, options?: {
map?: (value: T) => JSONValueType;
data?: Record<string, JSONValueType>[];

@@ -28,0 +29,0 @@ }): ReadableStream<Uint8Array>;

@@ -78,2 +78,5 @@ "use strict";

}
function identity(value) {
return value;
}
var NdJsonStream = class {

@@ -117,2 +120,3 @@ static headers = Object.freeze({ "content-type": "application/x-ndjson; charset=utf-8" });

* @param options
* @param options.map A function to map stream chunks to desired, json-serializable outputs
* @param options.data Additional data to prepend to the output stream

@@ -122,2 +126,5 @@ * @returns A readable stream of newline-delimited JSON

static encode(stream, options) {
options = options || {};
const map = options.map || identity;
const data = options.data || [];
const encoder = new TextEncoder();

@@ -131,3 +138,2 @@ function serialize(obj) {

start(controller) {
const data = options?.data || [];
for (const value of data) {

@@ -138,3 +144,3 @@ controller.enqueue(serialize({ type: "data", value }));

transform(value, controller) {
controller.enqueue(serialize({ type: "chunk", value }));
controller.enqueue(serialize({ type: "chunk", value: map(value) }));
}

@@ -141,0 +147,0 @@ });

4

package.json
{
"name": "@axflow/models",
"version": "0.0.1-alpha.8",
"version": "0.0.1-alpha.9",
"description": "Zero-dependency module to run, stream, and render results across the most popular LLMs and embedding models",

@@ -123,3 +123,3 @@ "author": "Axilla (https://axilla.io)",

},
"gitHead": "7f0fb32893d6e83b5aca05f7daf5e0b4e4d0fec5"
"gitHead": "cb659f43473fce49cd3283e3a95d3b947dd683a4"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc