@xsai/tool 0.0.31 → 0.1.0-beta.2
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/generate-text.d.ts +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +2 -2
- package/package.json +6 -6
package/dist/generate-text.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Schema, InferIn } from '
|
|
1
|
+
import { Schema, InferIn } from 'xsschema';
|
|
2
2
|
|
|
3
|
-
interface ToolOptions<T extends Schema> {
|
|
3
|
+
interface ToolOptions<T extends Schema = Schema> {
|
|
4
4
|
description?: string;
|
|
5
5
|
execute: (input: InferIn<T>) => Promise<string> | string;
|
|
6
6
|
name: string;
|
|
7
7
|
parameters: T;
|
|
8
8
|
strict?: boolean;
|
|
9
9
|
}
|
|
10
|
-
interface ToolResult
|
|
11
|
-
execute: (input:
|
|
10
|
+
interface ToolResult {
|
|
11
|
+
execute: (input: unknown) => Promise<string> | string;
|
|
12
12
|
function: {
|
|
13
13
|
description?: string;
|
|
14
14
|
name: string;
|
|
@@ -17,6 +17,6 @@ interface ToolResult<T extends Schema> {
|
|
|
17
17
|
};
|
|
18
18
|
type: 'function';
|
|
19
19
|
}
|
|
20
|
-
declare const tool: <T extends Schema>(options: ToolOptions<T>) => Promise<ToolResult
|
|
20
|
+
declare const tool: <T extends Schema>(options: ToolOptions<T>) => Promise<ToolResult>;
|
|
21
21
|
|
|
22
|
-
export { type ToolOptions, type ToolResult, tool
|
|
22
|
+
export { type ToolOptions, type ToolResult, tool };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toJSONSchema } from '@typeschema/main';
|
|
2
1
|
import { clean } from '@xsai/shared';
|
|
2
|
+
import { toJSONSchema } from 'xsschema';
|
|
3
3
|
|
|
4
4
|
const tool = async (options) => ({
|
|
5
5
|
execute: options.execute,
|
|
@@ -15,4 +15,4 @@ const tool = async (options) => ({
|
|
|
15
15
|
type: "function"
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
export { tool
|
|
18
|
+
export { tool };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsai/tool",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.1.0-beta.2",
|
|
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,7 +33,7 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@xsai/generate-text": "0.0.
|
|
36
|
+
"@xsai/generate-text": "0.1.0-beta.2"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"@xsai/generate-text": {
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"
|
|
44
|
+
"@xsai/shared": "",
|
|
45
|
+
"xsschema": ""
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@
|
|
48
|
+
"@valibot/to-json-schema": "^1.0.0-beta.5",
|
|
49
49
|
"@xsai/generate-text": "",
|
|
50
50
|
"@xsai/providers": "",
|
|
51
|
-
"valibot": "^0.
|
|
51
|
+
"valibot": "^1.0.0-beta.14"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "pkgroll",
|