@isdk/ai-tool 0.0.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/README.cn.md +261 -0
- package/README.md +3 -0
- package/dist/chunk-EZFPVSGF.mjs +22 -0
- package/dist/chunk-PKECBABP.mjs +5085 -0
- package/dist/funcs.d.mts +6 -0
- package/dist/funcs.d.ts +6 -0
- package/dist/funcs.js +5016 -0
- package/dist/funcs.mjs +37 -0
- package/dist/index-D4KjfAKl.d.mts +606 -0
- package/dist/index-D4KjfAKl.d.ts +606 -0
- package/dist/index.d.mts +1097 -0
- package/dist/index.d.ts +1097 -0
- package/dist/index.js +5239 -0
- package/dist/index.mjs +399 -0
- package/dist/test/util.d.mts +7 -0
- package/dist/test/util.d.ts +7 -0
- package/dist/test/util.js +98 -0
- package/dist/test/util.mjs +61 -0
- package/docs/.nojekyll +1 -0
- package/docs/README.md +5 -0
- package/docs/classes/AbortError.md +359 -0
- package/docs/classes/AlreadyExistsError.md +339 -0
- package/docs/classes/BaseError.md +346 -0
- package/docs/classes/ClientTools.md +2705 -0
- package/docs/classes/CommonError.md +368 -0
- package/docs/classes/ConfigFile.md +346 -0
- package/docs/classes/EventClient.md +3183 -0
- package/docs/classes/EventServer.md +3138 -0
- package/docs/classes/EventToolFunc.md +2498 -0
- package/docs/classes/FStringPromptTemplate.md +1236 -0
- package/docs/classes/FewShotPromptTemplate.md +1286 -0
- package/docs/classes/GolangPromptTemplate.md +1236 -0
- package/docs/classes/HFEnvironment.md +212 -0
- package/docs/classes/HFInterpreter.md +386 -0
- package/docs/classes/HFTemplate.md +79 -0
- package/docs/classes/HfPromptTemplate.md +1236 -0
- package/docs/classes/NotFoundError.md +339 -0
- package/docs/classes/NotImplementationError.md +339 -0
- package/docs/classes/PromptExampleSelector.md +207 -0
- package/docs/classes/PromptTemplate.md +1163 -0
- package/docs/classes/ReadableStreamError.md +359 -0
- package/docs/classes/ResClientTools.md +2859 -0
- package/docs/classes/ResServerTools.md +2783 -0
- package/docs/classes/SSEChannel.md +289 -0
- package/docs/classes/ServerTools.md +2633 -0
- package/docs/classes/ToolFunc.md +2124 -0
- package/docs/enums/ErrorCode.md +217 -0
- package/docs/enums/XXHashAlgorithm.md +30 -0
- package/docs/interfaces/AIChatAssistantMessageParam.md +84 -0
- package/docs/interfaces/AIChatContentPartImage.md +36 -0
- package/docs/interfaces/AIChatContentPartText.md +30 -0
- package/docs/interfaces/AIChatMessageParamBase.md +35 -0
- package/docs/interfaces/AIChatMessageToolCall.md +48 -0
- package/docs/interfaces/AIChatSystemMessageParam.md +51 -0
- package/docs/interfaces/AIChatToolMessageParam.md +62 -0
- package/docs/interfaces/AIChatUserMessageParam.md +95 -0
- package/docs/interfaces/AIResult.md +65 -0
- package/docs/interfaces/AIStreamCallbacksAndOptions.md +158 -0
- package/docs/interfaces/AIStreamParser.md +33 -0
- package/docs/interfaces/AIStreamParserOptions.md +23 -0
- package/docs/interfaces/BaseFunc.md +145 -0
- package/docs/interfaces/BaseFuncItem.md +99 -0
- package/docs/interfaces/ClientFuncItem.md +181 -0
- package/docs/interfaces/DotenvExpandOptions.md +51 -0
- package/docs/interfaces/DotenvExpandOutput.md +30 -0
- package/docs/interfaces/DotenvParseInput.md +7 -0
- package/docs/interfaces/DotenvParseOutput.md +7 -0
- package/docs/interfaces/DotenvPopulateInput.md +7 -0
- package/docs/interfaces/EventClientFuncParams.md +66 -0
- package/docs/interfaces/EventServerFuncParams.md +79 -0
- package/docs/interfaces/FewShotPromptTemplateOptions.md +179 -0
- package/docs/interfaces/FuncItem.md +130 -0
- package/docs/interfaces/FuncParam.md +67 -0
- package/docs/interfaces/FuncParams.md +7 -0
- package/docs/interfaces/Funcs.md +7 -0
- package/docs/interfaces/IOptions.md +30 -0
- package/docs/interfaces/JsonFilter.md +7 -0
- package/docs/interfaces/PromptExampleSelectorOptions.md +39 -0
- package/docs/interfaces/PromptTemplateOptions.md +84 -0
- package/docs/interfaces/RemoteFuncItem.md +167 -0
- package/docs/interfaces/ResClientFuncParams.md +34 -0
- package/docs/interfaces/ResServerFuncParams.md +79 -0
- package/docs/interfaces/SanitizeFilenameOptions.md +30 -0
- package/docs/interfaces/ServerFuncItem.md +192 -0
- package/docs/interfaces/ServerFuncParams.md +44 -0
- package/docs/modules.md +2707 -0
- package/package.json +112 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[@isdk/ai-tool](../README.md) / [Exports](../modules.md) / DotenvExpandOptions
|
|
2
|
+
|
|
3
|
+
# Interface: DotenvExpandOptions
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [error](DotenvExpandOptions.md#error)
|
|
10
|
+
- [parsed](DotenvExpandOptions.md#parsed)
|
|
11
|
+
- [processEnv](DotenvExpandOptions.md#processenv)
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### error
|
|
16
|
+
|
|
17
|
+
• `Optional` **error**: `Error`
|
|
18
|
+
|
|
19
|
+
#### Defined in
|
|
20
|
+
|
|
21
|
+
[packages/ai-tool/src/utils/prompt/template/env.ts:188](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/env.ts#L188)
|
|
22
|
+
|
|
23
|
+
___
|
|
24
|
+
|
|
25
|
+
### parsed
|
|
26
|
+
|
|
27
|
+
• `Optional` **parsed**: [`DotenvParseInput`](DotenvParseInput.md)
|
|
28
|
+
|
|
29
|
+
Default: `object`
|
|
30
|
+
|
|
31
|
+
Object coming from dotenv's parsed result.
|
|
32
|
+
|
|
33
|
+
#### Defined in
|
|
34
|
+
|
|
35
|
+
[packages/ai-tool/src/utils/prompt/template/env.ts:204](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/env.ts#L204)
|
|
36
|
+
|
|
37
|
+
___
|
|
38
|
+
|
|
39
|
+
### processEnv
|
|
40
|
+
|
|
41
|
+
• `Optional` **processEnv**: [`DotenvPopulateInput`](DotenvPopulateInput.md)
|
|
42
|
+
|
|
43
|
+
Default: `process.env`
|
|
44
|
+
|
|
45
|
+
Specify an object to write your secrets to. Defaults to process.env environment variables.
|
|
46
|
+
|
|
47
|
+
example: `const processEnv = {}; require('dotenv').config({ processEnv: processEnv })`
|
|
48
|
+
|
|
49
|
+
#### Defined in
|
|
50
|
+
|
|
51
|
+
[packages/ai-tool/src/utils/prompt/template/env.ts:197](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/env.ts#L197)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[@isdk/ai-tool](../README.md) / [Exports](../modules.md) / DotenvExpandOutput
|
|
2
|
+
|
|
3
|
+
# Interface: DotenvExpandOutput
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [error](DotenvExpandOutput.md#error)
|
|
10
|
+
- [parsed](DotenvExpandOutput.md#parsed)
|
|
11
|
+
|
|
12
|
+
## Properties
|
|
13
|
+
|
|
14
|
+
### error
|
|
15
|
+
|
|
16
|
+
• `Optional` **error**: `Error`
|
|
17
|
+
|
|
18
|
+
#### Defined in
|
|
19
|
+
|
|
20
|
+
[packages/ai-tool/src/utils/prompt/template/env.ts:208](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/env.ts#L208)
|
|
21
|
+
|
|
22
|
+
___
|
|
23
|
+
|
|
24
|
+
### parsed
|
|
25
|
+
|
|
26
|
+
• `Optional` **parsed**: [`DotenvParseOutput`](DotenvParseOutput.md)
|
|
27
|
+
|
|
28
|
+
#### Defined in
|
|
29
|
+
|
|
30
|
+
[packages/ai-tool/src/utils/prompt/template/env.ts:209](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/env.ts#L209)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
[@isdk/ai-tool](../README.md) / [Exports](../modules.md) / EventClientFuncParams
|
|
2
|
+
|
|
3
|
+
# Interface: EventClientFuncParams
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [act](EventClientFuncParams.md#act)
|
|
10
|
+
- [data](EventClientFuncParams.md#data)
|
|
11
|
+
- [event](EventClientFuncParams.md#event)
|
|
12
|
+
- [listener](EventClientFuncParams.md#listener)
|
|
13
|
+
|
|
14
|
+
## Properties
|
|
15
|
+
|
|
16
|
+
### act
|
|
17
|
+
|
|
18
|
+
• `Optional` **act**: ``"sub"`` \| ``"pub"`` \| ``"unsub"`` \| ``"init"``
|
|
19
|
+
|
|
20
|
+
#### Defined in
|
|
21
|
+
|
|
22
|
+
[packages/ai-tool/src/funcs/event-client.ts:8](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/funcs/event-client.ts#L8)
|
|
23
|
+
|
|
24
|
+
___
|
|
25
|
+
|
|
26
|
+
### data
|
|
27
|
+
|
|
28
|
+
• `Optional` **data**: `any`
|
|
29
|
+
|
|
30
|
+
#### Defined in
|
|
31
|
+
|
|
32
|
+
[packages/ai-tool/src/funcs/event-client.ts:7](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/funcs/event-client.ts#L7)
|
|
33
|
+
|
|
34
|
+
___
|
|
35
|
+
|
|
36
|
+
### event
|
|
37
|
+
|
|
38
|
+
• `Optional` **event**: `string` \| `string`[]
|
|
39
|
+
|
|
40
|
+
#### Defined in
|
|
41
|
+
|
|
42
|
+
[packages/ai-tool/src/funcs/event-client.ts:6](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/funcs/event-client.ts#L6)
|
|
43
|
+
|
|
44
|
+
___
|
|
45
|
+
|
|
46
|
+
### listener
|
|
47
|
+
|
|
48
|
+
• `Optional` **listener**: (...`args`: `any`[]) => `void`
|
|
49
|
+
|
|
50
|
+
#### Type declaration
|
|
51
|
+
|
|
52
|
+
▸ (`...args`): `void`
|
|
53
|
+
|
|
54
|
+
##### Parameters
|
|
55
|
+
|
|
56
|
+
| Name | Type |
|
|
57
|
+
| :------ | :------ |
|
|
58
|
+
| `...args` | `any`[] |
|
|
59
|
+
|
|
60
|
+
##### Returns
|
|
61
|
+
|
|
62
|
+
`void`
|
|
63
|
+
|
|
64
|
+
#### Defined in
|
|
65
|
+
|
|
66
|
+
[packages/ai-tool/src/funcs/event-client.ts:9](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/funcs/event-client.ts#L9)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
[@isdk/ai-tool](../README.md) / [Exports](../modules.md) / EventServerFuncParams
|
|
2
|
+
|
|
3
|
+
# Interface: EventServerFuncParams
|
|
4
|
+
|
|
5
|
+
Convention: Always pass _req, _res
|
|
6
|
+
|
|
7
|
+
## Hierarchy
|
|
8
|
+
|
|
9
|
+
- [`ServerFuncParams`](ServerFuncParams.md)
|
|
10
|
+
|
|
11
|
+
↳ **`EventServerFuncParams`**
|
|
12
|
+
|
|
13
|
+
## Table of contents
|
|
14
|
+
|
|
15
|
+
### Properties
|
|
16
|
+
|
|
17
|
+
- [\_req](EventServerFuncParams.md#_req)
|
|
18
|
+
- [\_res](EventServerFuncParams.md#_res)
|
|
19
|
+
- [act](EventServerFuncParams.md#act)
|
|
20
|
+
- [data](EventServerFuncParams.md#data)
|
|
21
|
+
- [event](EventServerFuncParams.md#event)
|
|
22
|
+
|
|
23
|
+
## Properties
|
|
24
|
+
|
|
25
|
+
### \_req
|
|
26
|
+
|
|
27
|
+
• `Optional` **\_req**: `IncomingMessage`
|
|
28
|
+
|
|
29
|
+
#### Inherited from
|
|
30
|
+
|
|
31
|
+
[ServerFuncParams](ServerFuncParams.md).[_req](ServerFuncParams.md#_req)
|
|
32
|
+
|
|
33
|
+
#### Defined in
|
|
34
|
+
|
|
35
|
+
[packages/ai-tool/src/server-tools.ts:9](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/server-tools.ts#L9)
|
|
36
|
+
|
|
37
|
+
___
|
|
38
|
+
|
|
39
|
+
### \_res
|
|
40
|
+
|
|
41
|
+
• `Optional` **\_res**: `ServerResponse`\<`IncomingMessage`\>
|
|
42
|
+
|
|
43
|
+
#### Inherited from
|
|
44
|
+
|
|
45
|
+
[ServerFuncParams](ServerFuncParams.md).[_res](ServerFuncParams.md#_res)
|
|
46
|
+
|
|
47
|
+
#### Defined in
|
|
48
|
+
|
|
49
|
+
[packages/ai-tool/src/server-tools.ts:10](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/server-tools.ts#L10)
|
|
50
|
+
|
|
51
|
+
___
|
|
52
|
+
|
|
53
|
+
### act
|
|
54
|
+
|
|
55
|
+
• `Optional` **act**: ``"sub"`` \| ``"pub"`` \| ``"unsub"``
|
|
56
|
+
|
|
57
|
+
#### Defined in
|
|
58
|
+
|
|
59
|
+
[packages/ai-tool/src/funcs/event-server.ts:15](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/funcs/event-server.ts#L15)
|
|
60
|
+
|
|
61
|
+
___
|
|
62
|
+
|
|
63
|
+
### data
|
|
64
|
+
|
|
65
|
+
• `Optional` **data**: `any`
|
|
66
|
+
|
|
67
|
+
#### Defined in
|
|
68
|
+
|
|
69
|
+
[packages/ai-tool/src/funcs/event-server.ts:14](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/funcs/event-server.ts#L14)
|
|
70
|
+
|
|
71
|
+
___
|
|
72
|
+
|
|
73
|
+
### event
|
|
74
|
+
|
|
75
|
+
• `Optional` **event**: `string` \| `string`[]
|
|
76
|
+
|
|
77
|
+
#### Defined in
|
|
78
|
+
|
|
79
|
+
[packages/ai-tool/src/funcs/event-server.ts:13](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/funcs/event-server.ts#L13)
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
[@isdk/ai-tool](../README.md) / [Exports](../modules.md) / FewShotPromptTemplateOptions
|
|
2
|
+
|
|
3
|
+
# Interface: FewShotPromptTemplateOptions\<T\>
|
|
4
|
+
|
|
5
|
+
## Type parameters
|
|
6
|
+
|
|
7
|
+
| Name | Type |
|
|
8
|
+
| :------ | :------ |
|
|
9
|
+
| `T` | `any` |
|
|
10
|
+
|
|
11
|
+
## Hierarchy
|
|
12
|
+
|
|
13
|
+
- [`PromptTemplateOptions`](PromptTemplateOptions.md)
|
|
14
|
+
|
|
15
|
+
↳ **`FewShotPromptTemplateOptions`**
|
|
16
|
+
|
|
17
|
+
## Table of contents
|
|
18
|
+
|
|
19
|
+
### Properties
|
|
20
|
+
|
|
21
|
+
- [compiledTemplate](FewShotPromptTemplateOptions.md#compiledtemplate)
|
|
22
|
+
- [data](FewShotPromptTemplateOptions.md#data)
|
|
23
|
+
- [examplePrompt](FewShotPromptTemplateOptions.md#exampleprompt)
|
|
24
|
+
- [exampleSeparator](FewShotPromptTemplateOptions.md#exampleseparator)
|
|
25
|
+
- [examples](FewShotPromptTemplateOptions.md#examples)
|
|
26
|
+
- [ignoreInitialize](FewShotPromptTemplateOptions.md#ignoreinitialize)
|
|
27
|
+
- [inputVariables](FewShotPromptTemplateOptions.md#inputvariables)
|
|
28
|
+
- [prefix](FewShotPromptTemplateOptions.md#prefix)
|
|
29
|
+
- [suffix](FewShotPromptTemplateOptions.md#suffix)
|
|
30
|
+
- [template](FewShotPromptTemplateOptions.md#template)
|
|
31
|
+
- [templateFormat](FewShotPromptTemplateOptions.md#templateformat)
|
|
32
|
+
|
|
33
|
+
## Properties
|
|
34
|
+
|
|
35
|
+
### compiledTemplate
|
|
36
|
+
|
|
37
|
+
• `Optional` **compiledTemplate**: `any`
|
|
38
|
+
|
|
39
|
+
#### Inherited from
|
|
40
|
+
|
|
41
|
+
[PromptTemplateOptions](PromptTemplateOptions.md).[compiledTemplate](PromptTemplateOptions.md#compiledtemplate)
|
|
42
|
+
|
|
43
|
+
#### Defined in
|
|
44
|
+
|
|
45
|
+
[packages/ai-tool/src/utils/prompt/prompt-template.ts:15](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/prompt-template.ts#L15)
|
|
46
|
+
|
|
47
|
+
___
|
|
48
|
+
|
|
49
|
+
### data
|
|
50
|
+
|
|
51
|
+
• `Optional` **data**: `Record`\<`string`, `any`\>
|
|
52
|
+
|
|
53
|
+
#### Inherited from
|
|
54
|
+
|
|
55
|
+
[PromptTemplateOptions](PromptTemplateOptions.md).[data](PromptTemplateOptions.md#data)
|
|
56
|
+
|
|
57
|
+
#### Defined in
|
|
58
|
+
|
|
59
|
+
[packages/ai-tool/src/utils/prompt/prompt-template.ts:12](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/prompt-template.ts#L12)
|
|
60
|
+
|
|
61
|
+
___
|
|
62
|
+
|
|
63
|
+
### examplePrompt
|
|
64
|
+
|
|
65
|
+
• **examplePrompt**: [`PromptTemplateOptions`](PromptTemplateOptions.md) \| [`PromptTemplate`](../classes/PromptTemplate.md)
|
|
66
|
+
|
|
67
|
+
An [PromptTemplate](../classes/PromptTemplate.md) used to format a single example.
|
|
68
|
+
|
|
69
|
+
#### Defined in
|
|
70
|
+
|
|
71
|
+
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:19](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/few-shot-prompt-template.ts#L19)
|
|
72
|
+
|
|
73
|
+
___
|
|
74
|
+
|
|
75
|
+
### exampleSeparator
|
|
76
|
+
|
|
77
|
+
• `Optional` **exampleSeparator**: `string`
|
|
78
|
+
|
|
79
|
+
String separator used to join the prefix, the examples, and suffix.
|
|
80
|
+
|
|
81
|
+
#### Defined in
|
|
82
|
+
|
|
83
|
+
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:24](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/few-shot-prompt-template.ts#L24)
|
|
84
|
+
|
|
85
|
+
___
|
|
86
|
+
|
|
87
|
+
### examples
|
|
88
|
+
|
|
89
|
+
• **examples**: [`PromptExamples`](../modules.md#promptexamples)\<`T`\>
|
|
90
|
+
|
|
91
|
+
The few shot examples to use in the prompt.
|
|
92
|
+
|
|
93
|
+
#### Defined in
|
|
94
|
+
|
|
95
|
+
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:14](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/few-shot-prompt-template.ts#L14)
|
|
96
|
+
|
|
97
|
+
___
|
|
98
|
+
|
|
99
|
+
### ignoreInitialize
|
|
100
|
+
|
|
101
|
+
• `Optional` **ignoreInitialize**: `boolean`
|
|
102
|
+
|
|
103
|
+
#### Inherited from
|
|
104
|
+
|
|
105
|
+
[PromptTemplateOptions](PromptTemplateOptions.md).[ignoreInitialize](PromptTemplateOptions.md#ignoreinitialize)
|
|
106
|
+
|
|
107
|
+
#### Defined in
|
|
108
|
+
|
|
109
|
+
[packages/ai-tool/src/utils/prompt/prompt-template.ts:16](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/prompt-template.ts#L16)
|
|
110
|
+
|
|
111
|
+
___
|
|
112
|
+
|
|
113
|
+
### inputVariables
|
|
114
|
+
|
|
115
|
+
• `Optional` **inputVariables**: `string`[]
|
|
116
|
+
|
|
117
|
+
#### Inherited from
|
|
118
|
+
|
|
119
|
+
[PromptTemplateOptions](PromptTemplateOptions.md).[inputVariables](PromptTemplateOptions.md#inputvariables)
|
|
120
|
+
|
|
121
|
+
#### Defined in
|
|
122
|
+
|
|
123
|
+
[packages/ai-tool/src/utils/prompt/prompt-template.ts:14](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/prompt-template.ts#L14)
|
|
124
|
+
|
|
125
|
+
___
|
|
126
|
+
|
|
127
|
+
### prefix
|
|
128
|
+
|
|
129
|
+
• `Optional` **prefix**: `string`
|
|
130
|
+
|
|
131
|
+
A prompt template string to put before the examples.
|
|
132
|
+
|
|
133
|
+
**`Default Value`**
|
|
134
|
+
|
|
135
|
+
`""`
|
|
136
|
+
|
|
137
|
+
#### Defined in
|
|
138
|
+
|
|
139
|
+
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:31](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/few-shot-prompt-template.ts#L31)
|
|
140
|
+
|
|
141
|
+
___
|
|
142
|
+
|
|
143
|
+
### suffix
|
|
144
|
+
|
|
145
|
+
• `Optional` **suffix**: `string`
|
|
146
|
+
|
|
147
|
+
A prompt template string to put after the examples.
|
|
148
|
+
|
|
149
|
+
#### Defined in
|
|
150
|
+
|
|
151
|
+
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:36](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/few-shot-prompt-template.ts#L36)
|
|
152
|
+
|
|
153
|
+
___
|
|
154
|
+
|
|
155
|
+
### template
|
|
156
|
+
|
|
157
|
+
• `Optional` **template**: `string`
|
|
158
|
+
|
|
159
|
+
#### Inherited from
|
|
160
|
+
|
|
161
|
+
[PromptTemplateOptions](PromptTemplateOptions.md).[template](PromptTemplateOptions.md#template)
|
|
162
|
+
|
|
163
|
+
#### Defined in
|
|
164
|
+
|
|
165
|
+
[packages/ai-tool/src/utils/prompt/prompt-template.ts:11](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/prompt-template.ts#L11)
|
|
166
|
+
|
|
167
|
+
___
|
|
168
|
+
|
|
169
|
+
### templateFormat
|
|
170
|
+
|
|
171
|
+
• `Optional` **templateFormat**: `string`
|
|
172
|
+
|
|
173
|
+
#### Inherited from
|
|
174
|
+
|
|
175
|
+
[PromptTemplateOptions](PromptTemplateOptions.md).[templateFormat](PromptTemplateOptions.md#templateformat)
|
|
176
|
+
|
|
177
|
+
#### Defined in
|
|
178
|
+
|
|
179
|
+
[packages/ai-tool/src/utils/prompt/prompt-template.ts:13](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/prompt-template.ts#L13)
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
[@isdk/ai-tool](../README.md) / [Exports](../modules.md) / FuncItem
|
|
2
|
+
|
|
3
|
+
# Interface: FuncItem
|
|
4
|
+
|
|
5
|
+
## Hierarchy
|
|
6
|
+
|
|
7
|
+
- [`BaseFuncItem`](BaseFuncItem.md)
|
|
8
|
+
|
|
9
|
+
↳ **`FuncItem`**
|
|
10
|
+
|
|
11
|
+
## Table of contents
|
|
12
|
+
|
|
13
|
+
### Properties
|
|
14
|
+
|
|
15
|
+
- [func](FuncItem.md#func)
|
|
16
|
+
- [name](FuncItem.md#name)
|
|
17
|
+
- [params](FuncItem.md#params)
|
|
18
|
+
- [result](FuncItem.md#result)
|
|
19
|
+
- [scope](FuncItem.md#scope)
|
|
20
|
+
- [setup](FuncItem.md#setup)
|
|
21
|
+
- [tags](FuncItem.md#tags)
|
|
22
|
+
|
|
23
|
+
## Properties
|
|
24
|
+
|
|
25
|
+
### func
|
|
26
|
+
|
|
27
|
+
• `Optional` **func**: [`TFunc`](../modules.md#tfunc)
|
|
28
|
+
|
|
29
|
+
#### Defined in
|
|
30
|
+
|
|
31
|
+
[packages/ai-tool/src/tool-func.ts:30](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/tool-func.ts#L30)
|
|
32
|
+
|
|
33
|
+
___
|
|
34
|
+
|
|
35
|
+
### name
|
|
36
|
+
|
|
37
|
+
• `Optional` **name**: `string`
|
|
38
|
+
|
|
39
|
+
#### Inherited from
|
|
40
|
+
|
|
41
|
+
[BaseFuncItem](BaseFuncItem.md).[name](BaseFuncItem.md#name)
|
|
42
|
+
|
|
43
|
+
#### Defined in
|
|
44
|
+
|
|
45
|
+
[packages/ai-tool/src/tool-func.ts:21](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/tool-func.ts#L21)
|
|
46
|
+
|
|
47
|
+
___
|
|
48
|
+
|
|
49
|
+
### params
|
|
50
|
+
|
|
51
|
+
• `Optional` **params**: [`FuncParams`](FuncParams.md) \| [`FuncParam`](FuncParam.md)[]
|
|
52
|
+
|
|
53
|
+
#### Inherited from
|
|
54
|
+
|
|
55
|
+
[BaseFuncItem](BaseFuncItem.md).[params](BaseFuncItem.md#params)
|
|
56
|
+
|
|
57
|
+
#### Defined in
|
|
58
|
+
|
|
59
|
+
[packages/ai-tool/src/tool-func.ts:22](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/tool-func.ts#L22)
|
|
60
|
+
|
|
61
|
+
___
|
|
62
|
+
|
|
63
|
+
### result
|
|
64
|
+
|
|
65
|
+
• `Optional` **result**: `string`
|
|
66
|
+
|
|
67
|
+
#### Inherited from
|
|
68
|
+
|
|
69
|
+
[BaseFuncItem](BaseFuncItem.md).[result](BaseFuncItem.md#result)
|
|
70
|
+
|
|
71
|
+
#### Defined in
|
|
72
|
+
|
|
73
|
+
[packages/ai-tool/src/tool-func.ts:23](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/tool-func.ts#L23)
|
|
74
|
+
|
|
75
|
+
___
|
|
76
|
+
|
|
77
|
+
### scope
|
|
78
|
+
|
|
79
|
+
• `Optional` **scope**: `any`
|
|
80
|
+
|
|
81
|
+
#### Inherited from
|
|
82
|
+
|
|
83
|
+
[BaseFuncItem](BaseFuncItem.md).[scope](BaseFuncItem.md#scope)
|
|
84
|
+
|
|
85
|
+
#### Defined in
|
|
86
|
+
|
|
87
|
+
[packages/ai-tool/src/tool-func.ts:24](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/tool-func.ts#L24)
|
|
88
|
+
|
|
89
|
+
___
|
|
90
|
+
|
|
91
|
+
### setup
|
|
92
|
+
|
|
93
|
+
• `Optional` **setup**: (`this`: [`ToolFunc`](../classes/ToolFunc.md), `options?`: [`FuncItem`](FuncItem.md)) => `void`
|
|
94
|
+
|
|
95
|
+
#### Type declaration
|
|
96
|
+
|
|
97
|
+
▸ (`this`, `options?`): `void`
|
|
98
|
+
|
|
99
|
+
##### Parameters
|
|
100
|
+
|
|
101
|
+
| Name | Type |
|
|
102
|
+
| :------ | :------ |
|
|
103
|
+
| `this` | [`ToolFunc`](../classes/ToolFunc.md) |
|
|
104
|
+
| `options?` | [`FuncItem`](FuncItem.md) |
|
|
105
|
+
|
|
106
|
+
##### Returns
|
|
107
|
+
|
|
108
|
+
`void`
|
|
109
|
+
|
|
110
|
+
#### Inherited from
|
|
111
|
+
|
|
112
|
+
[BaseFuncItem](BaseFuncItem.md).[setup](BaseFuncItem.md#setup)
|
|
113
|
+
|
|
114
|
+
#### Defined in
|
|
115
|
+
|
|
116
|
+
[packages/ai-tool/src/tool-func.ts:26](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/tool-func.ts#L26)
|
|
117
|
+
|
|
118
|
+
___
|
|
119
|
+
|
|
120
|
+
### tags
|
|
121
|
+
|
|
122
|
+
• `Optional` **tags**: `string` \| `string`[]
|
|
123
|
+
|
|
124
|
+
#### Inherited from
|
|
125
|
+
|
|
126
|
+
[BaseFuncItem](BaseFuncItem.md).[tags](BaseFuncItem.md#tags)
|
|
127
|
+
|
|
128
|
+
#### Defined in
|
|
129
|
+
|
|
130
|
+
[packages/ai-tool/src/tool-func.ts:25](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/tool-func.ts#L25)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[@isdk/ai-tool](../README.md) / [Exports](../modules.md) / FuncParam
|
|
2
|
+
|
|
3
|
+
# Interface: FuncParam
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [depends](FuncParam.md#depends)
|
|
10
|
+
- [description](FuncParam.md#description)
|
|
11
|
+
- [name](FuncParam.md#name)
|
|
12
|
+
- [required](FuncParam.md#required)
|
|
13
|
+
- [type](FuncParam.md#type)
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### depends
|
|
18
|
+
|
|
19
|
+
• `Optional` **depends**: `Object`
|
|
20
|
+
|
|
21
|
+
#### Index signature
|
|
22
|
+
|
|
23
|
+
▪ [name: `string`]: [`ToolFunc`](../classes/ToolFunc.md)
|
|
24
|
+
|
|
25
|
+
#### Defined in
|
|
26
|
+
|
|
27
|
+
[packages/ai-tool/src/tool-func.ts:11](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/tool-func.ts#L11)
|
|
28
|
+
|
|
29
|
+
___
|
|
30
|
+
|
|
31
|
+
### description
|
|
32
|
+
|
|
33
|
+
• `Optional` **description**: `string`
|
|
34
|
+
|
|
35
|
+
#### Defined in
|
|
36
|
+
|
|
37
|
+
[packages/ai-tool/src/tool-func.ts:10](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/tool-func.ts#L10)
|
|
38
|
+
|
|
39
|
+
___
|
|
40
|
+
|
|
41
|
+
### name
|
|
42
|
+
|
|
43
|
+
• `Optional` **name**: `string`
|
|
44
|
+
|
|
45
|
+
#### Defined in
|
|
46
|
+
|
|
47
|
+
[packages/ai-tool/src/tool-func.ts:7](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/tool-func.ts#L7)
|
|
48
|
+
|
|
49
|
+
___
|
|
50
|
+
|
|
51
|
+
### required
|
|
52
|
+
|
|
53
|
+
• `Optional` **required**: `boolean`
|
|
54
|
+
|
|
55
|
+
#### Defined in
|
|
56
|
+
|
|
57
|
+
[packages/ai-tool/src/tool-func.ts:9](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/tool-func.ts#L9)
|
|
58
|
+
|
|
59
|
+
___
|
|
60
|
+
|
|
61
|
+
### type
|
|
62
|
+
|
|
63
|
+
• `Optional` **type**: `string`
|
|
64
|
+
|
|
65
|
+
#### Defined in
|
|
66
|
+
|
|
67
|
+
[packages/ai-tool/src/tool-func.ts:8](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/tool-func.ts#L8)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[@isdk/ai-tool](../README.md) / [Exports](../modules.md) / IOptions
|
|
2
|
+
|
|
3
|
+
# Interface: IOptions
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [exclude](IOptions.md#exclude)
|
|
10
|
+
- [include](IOptions.md#include)
|
|
11
|
+
|
|
12
|
+
## Properties
|
|
13
|
+
|
|
14
|
+
### exclude
|
|
15
|
+
|
|
16
|
+
• `Optional` **exclude**: `string` \| `string`[]
|
|
17
|
+
|
|
18
|
+
#### Defined in
|
|
19
|
+
|
|
20
|
+
node_modules/.pnpm/json-canonicalize@1.0.6/node_modules/json-canonicalize/types/canonicalize-ex.d.ts:2
|
|
21
|
+
|
|
22
|
+
___
|
|
23
|
+
|
|
24
|
+
### include
|
|
25
|
+
|
|
26
|
+
• `Optional` **include**: `string`[]
|
|
27
|
+
|
|
28
|
+
#### Defined in
|
|
29
|
+
|
|
30
|
+
node_modules/.pnpm/json-canonicalize@1.0.6/node_modules/json-canonicalize/types/canonicalize-ex.d.ts:3
|