@xsai/stream-object 0.1.2 → 0.2.0-beta.1
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.js +2 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -250,7 +250,7 @@ var require_parse = __commonJS({
|
|
|
250
250
|
// src/index.ts
|
|
251
251
|
var import_best_effort_json_parser = __toESM(require_parse(), 1);
|
|
252
252
|
import { streamText } from "@xsai/stream-text";
|
|
253
|
-
import {
|
|
253
|
+
import { toJsonSchema } from "xsschema";
|
|
254
254
|
var wrap = (schema) => {
|
|
255
255
|
return {
|
|
256
256
|
properties: {
|
|
@@ -265,7 +265,7 @@ var wrap = (schema) => {
|
|
|
265
265
|
};
|
|
266
266
|
async function streamObject(options) {
|
|
267
267
|
const { schema: schemaValidator } = options;
|
|
268
|
-
let schema = await
|
|
268
|
+
let schema = await toJsonSchema(schemaValidator);
|
|
269
269
|
if (options.output === "array")
|
|
270
270
|
schema = wrap(schema);
|
|
271
271
|
return streamText({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsai/stream-object",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.2.0-beta.1",
|
|
5
5
|
"description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.",
|
|
6
6
|
"author": "Moeru AI",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"xsschema": ""
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@valibot/to-json-schema": "^1.0.0
|
|
36
|
+
"@valibot/to-json-schema": "^1.0.0",
|
|
37
37
|
"best-effort-json-parser": "^1.1.3",
|
|
38
38
|
"type-fest": "^4.35.0",
|
|
39
|
-
"valibot": "^1.0.0
|
|
39
|
+
"valibot": "^1.0.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "tsup",
|