@xsai/stream-object 0.0.29 → 0.0.31
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 -6
- package/package.json +10 -11
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { toJSONSchema } from '@typeschema/main';
|
|
2
|
-
import { clean } from '@xsai/shared';
|
|
3
2
|
import { streamText } from '@xsai/stream-text';
|
|
4
3
|
|
|
5
4
|
var parse = {};
|
|
@@ -234,16 +233,13 @@ function requireParse () {
|
|
|
234
233
|
|
|
235
234
|
var parseExports = requireParse();
|
|
236
235
|
|
|
237
|
-
const streamObject = async (options) =>
|
|
236
|
+
const streamObject = async (options) => streamText({
|
|
238
237
|
...options,
|
|
239
238
|
response_format: {
|
|
240
239
|
json_schema: {
|
|
241
240
|
description: options.schemaDescription,
|
|
242
241
|
name: options.schemaName ?? "json_schema",
|
|
243
|
-
schema: await toJSONSchema(options.schema)
|
|
244
|
-
...json,
|
|
245
|
-
$schema: undefined
|
|
246
|
-
})),
|
|
242
|
+
schema: await toJSONSchema(options.schema),
|
|
247
243
|
strict: true
|
|
248
244
|
},
|
|
249
245
|
type: "json_schema"
|
package/package.json
CHANGED
|
@@ -1,44 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsai/stream-object",
|
|
3
|
-
"version": "0.0.29",
|
|
4
3
|
"type": "module",
|
|
4
|
+
"version": "0.0.31",
|
|
5
|
+
"description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.",
|
|
5
6
|
"author": "Moeru AI",
|
|
6
7
|
"license": "MIT",
|
|
7
8
|
"homepage": "https://xsai.js.org",
|
|
8
|
-
"description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.",
|
|
9
|
-
"keywords": [
|
|
10
|
-
"xsai",
|
|
11
|
-
"openai",
|
|
12
|
-
"ai"
|
|
13
|
-
],
|
|
14
9
|
"repository": {
|
|
15
10
|
"type": "git",
|
|
16
11
|
"url": "git+https://github.com/moeru-ai/xsai.git",
|
|
17
12
|
"directory": "packages/stream-object"
|
|
18
13
|
},
|
|
19
14
|
"bugs": "https://github.com/moeru-ai/xsai/issues",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"xsai",
|
|
17
|
+
"openai",
|
|
18
|
+
"ai"
|
|
19
|
+
],
|
|
20
20
|
"sideEffects": false,
|
|
21
|
-
"main": "./dist/index.js",
|
|
22
|
-
"types": "./dist/index.d.ts",
|
|
23
21
|
"exports": {
|
|
24
22
|
".": {
|
|
25
23
|
"types": "./dist/index.d.ts",
|
|
26
24
|
"default": "./dist/index.js"
|
|
27
25
|
}
|
|
28
26
|
},
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
29
|
"files": [
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@typeschema/main": "^0.14.1",
|
|
34
|
-
"@xsai/shared": "",
|
|
35
34
|
"@xsai/stream-text": ""
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
37
|
"@gcornut/valibot-json-schema": "^0.42.0",
|
|
39
38
|
"@xsai/providers": "",
|
|
40
39
|
"best-effort-json-parser": "^1.1.2",
|
|
41
|
-
"type-fest": "^4.
|
|
40
|
+
"type-fest": "^4.33.0",
|
|
42
41
|
"valibot": "^0.42.1"
|
|
43
42
|
},
|
|
44
43
|
"scripts": {
|