@xsai/generate-object 0.5.0-beta.2 → 0.5.0-beta.4

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -1
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -20,6 +20,8 @@ async function generateObject(options) {
20
20
  schema = wrap(schema);
21
21
  return generateText({
22
22
  ...options,
23
+ output: void 0,
24
+ // Remove output from options
23
25
  response_format: {
24
26
  json_schema: {
25
27
  description: options.schemaDescription,
@@ -37,7 +39,7 @@ async function generateObject(options) {
37
39
  // Remove schemaName from options
38
40
  strict: void 0
39
41
  // Remove strict from options
40
- }).then(async ({ finishReason, messages, steps, text, toolCalls, toolResults, usage }) => {
42
+ }).then(async ({ finishReason, messages, steps, text, toolCalls, toolResults, totalUsage, usage }) => {
41
43
  const json = JSON.parse(text);
42
44
  if (options.output === "array") {
43
45
  return {
@@ -48,6 +50,7 @@ async function generateObject(options) {
48
50
  text,
49
51
  toolCalls,
50
52
  toolResults,
53
+ totalUsage,
51
54
  usage
52
55
  };
53
56
  } else {
@@ -59,6 +62,7 @@ async function generateObject(options) {
59
62
  text,
60
63
  toolCalls,
61
64
  toolResults,
65
+ totalUsage,
62
66
  usage
63
67
  };
64
68
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xsai/generate-object",
3
3
  "type": "module",
4
- "version": "0.5.0-beta.2",
4
+ "version": "0.5.0-beta.4",
5
5
  "description": "extra-small AI SDK.",
6
6
  "author": "Moeru AI",
7
7
  "license": "MIT",
@@ -29,8 +29,8 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@xsai/generate-text": "~0.5.0-beta.2",
33
- "xsschema": "~0.5.0-beta.2"
32
+ "@xsai/generate-text": "0.5.0-beta.4",
33
+ "xsschema": "0.5.0-beta.4"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@valibot/to-json-schema": "^1.0.0",