@xsai/tool 0.3.0-beta.7 → 0.3.0-beta.8

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 +3 -9
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,14 +1,11 @@
1
- import { toJsonSchema } from 'xsschema';
1
+ import { strictJsonSchema, toJsonSchema } from 'xsschema';
2
2
 
3
3
  const rawTool = ({ description, execute, name, parameters }) => ({
4
4
  execute,
5
5
  function: {
6
6
  description,
7
7
  name,
8
- parameters: {
9
- ...parameters,
10
- additionalProperties: false
11
- },
8
+ parameters: strictJsonSchema(parameters),
12
9
  strict: true
13
10
  },
14
11
  type: "function"
@@ -21,10 +18,7 @@ const tool = async ({ description, execute, name, parameters }) => {
21
18
  function: {
22
19
  description,
23
20
  name,
24
- parameters: {
25
- ...schema,
26
- additionalProperties: false
27
- },
21
+ parameters: strictJsonSchema(schema),
28
22
  strict: true
29
23
  },
30
24
  type: "function"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xsai/tool",
3
3
  "type": "module",
4
- "version": "0.3.0-beta.7",
4
+ "version": "0.3.0-beta.8",
5
5
  "description": "extra-small AI SDK.",
6
6
  "author": "Moeru AI",
7
7
  "license": "MIT",
@@ -29,9 +29,9 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@xsai/shared": "~0.3.0-beta.7",
33
- "xsschema": "~0.3.0-beta.7",
34
- "@xsai/shared-chat": "~0.3.0-beta.7"
32
+ "@xsai/shared": "~0.3.0-beta.8",
33
+ "@xsai/shared-chat": "~0.3.0-beta.8",
34
+ "xsschema": "~0.3.0-beta.8"
35
35
  },
36
36
  "devDependencies": {
37
37
  "valibot": "^1.0.0"