@isdk/ai-tool 0.2.0 → 0.2.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.
Files changed (248) hide show
  1. package/dist/chunk-PY6NRGZE.mjs +1 -0
  2. package/dist/funcs.d.mts +1 -1
  3. package/dist/funcs.d.ts +1 -1
  4. package/dist/funcs.js +1 -1
  5. package/dist/funcs.mjs +1 -1
  6. package/dist/{index-nP9lSU6E.d.mts → index-DUEs7T8M.d.mts} +2 -2
  7. package/dist/{index-nP9lSU6E.d.ts → index-DUEs7T8M.d.ts} +2 -2
  8. package/dist/index.d.mts +5 -4
  9. package/dist/index.d.ts +5 -4
  10. package/dist/index.js +1 -1
  11. package/dist/index.mjs +1 -1
  12. package/docs/README.md +5 -3
  13. package/docs/_media/CONTRIBUTING.md +18 -0
  14. package/docs/_media/LICENSE-MIT +22 -0
  15. package/docs/classes/AbortError.md +108 -129
  16. package/docs/classes/AlreadyExistsError.md +105 -126
  17. package/docs/classes/BaseError.md +112 -125
  18. package/docs/classes/CancelableAbility.md +136 -188
  19. package/docs/classes/ClientTools.md +1005 -1107
  20. package/docs/classes/CommonError.md +115 -136
  21. package/docs/classes/ConfigFile.md +150 -163
  22. package/docs/classes/EventClient.md +1128 -1282
  23. package/docs/classes/EventServer.md +1165 -1303
  24. package/docs/classes/EventToolFunc.md +958 -1028
  25. package/docs/classes/FStringPromptTemplate.md +352 -438
  26. package/docs/classes/FewShotPromptTemplate.md +364 -464
  27. package/docs/classes/GolangPromptTemplate.md +352 -438
  28. package/docs/classes/HFEnvironment.md +53 -79
  29. package/docs/classes/HFInterpreter.md +20 -377
  30. package/docs/classes/HFTemplate.md +21 -33
  31. package/docs/classes/HfPromptTemplate.md +352 -438
  32. package/docs/classes/IntSet.md +67 -100
  33. package/docs/classes/NotFoundError.md +105 -126
  34. package/docs/classes/NotImplementationError.md +105 -126
  35. package/docs/classes/PromptExampleSelector.md +58 -70
  36. package/docs/classes/PromptTemplate.md +338 -422
  37. package/docs/classes/ReadableStreamError.md +108 -129
  38. package/docs/classes/ResClientTools.md +916 -1026
  39. package/docs/classes/ResServerTools.md +919 -1026
  40. package/docs/classes/SSEChannel.md +93 -112
  41. package/docs/classes/Semaphore.md +44 -140
  42. package/docs/classes/ServerTools.md +981 -1072
  43. package/docs/classes/TaskAbortController.md +46 -66
  44. package/docs/classes/ToolFunc.md +840 -910
  45. package/docs/enumerations/AsyncFeatureBits.md +37 -0
  46. package/docs/enumerations/AsyncFeatures.md +37 -0
  47. package/docs/enumerations/ErrorCode.md +217 -0
  48. package/docs/enumerations/XXHashAlgorithm.md +27 -0
  49. package/docs/functions/AIArgProcessor.md +27 -0
  50. package/docs/functions/AIStream.md +50 -0
  51. package/docs/functions/ChoiceArgProcessor.md +27 -0
  52. package/docs/functions/RateLimit.md +33 -0
  53. package/docs/functions/TemplateArgProcessor.md +27 -0
  54. package/docs/functions/backendEventable.md +23 -0
  55. package/docs/functions/canonicalize.md +21 -0
  56. package/docs/functions/countRegexMatches.md +33 -0
  57. package/docs/functions/createAbilityInjector.md +87 -0
  58. package/docs/functions/createCallbacksTransformer.md +49 -0
  59. package/docs/functions/createEmptyReadableStream.md +23 -0
  60. package/docs/functions/createEndWithRepetitionDetector.md +29 -0
  61. package/docs/functions/createError.md +35 -0
  62. package/docs/functions/createEventStreamTransformer.md +33 -0
  63. package/docs/functions/createHfValueFunc.md +29 -0
  64. package/docs/functions/createLRUCache.md +23 -0
  65. package/docs/functions/dateToText.md +23 -0
  66. package/docs/functions/expandEnv.md +40 -0
  67. package/docs/functions/expandObjEnv.md +54 -0
  68. package/docs/functions/extNameLevel.md +43 -0
  69. package/docs/functions/fileIsExists.md +34 -0
  70. package/docs/functions/filenameReservedRegex.md +22 -0
  71. package/docs/functions/filterValidFnScope.md +21 -0
  72. package/docs/functions/findPort.md +23 -0
  73. package/docs/functions/formatISO.md +71 -0
  74. package/docs/functions/getAllEnumKeys.md +31 -0
  75. package/docs/functions/getConfigFileNames.md +23 -0
  76. package/docs/functions/getConfigs.md +23 -0
  77. package/docs/functions/getKeysPath.md +38 -0
  78. package/docs/functions/getMultiLevelExtname.md +31 -0
  79. package/docs/functions/getPackageDir.md +39 -0
  80. package/docs/functions/getRealFilepath.md +34 -0
  81. package/docs/functions/getResponseErrorReadableStream.md +21 -0
  82. package/docs/functions/hfParse.md +24 -0
  83. package/docs/functions/hfTokenize.md +25 -0
  84. package/docs/functions/interpolateEnv.md +25 -0
  85. package/docs/functions/interpolateFString.md +27 -0
  86. package/docs/functions/interpolateGolangTemplate.md +31 -0
  87. package/docs/functions/isModelNameMatched.md +45 -0
  88. package/docs/functions/isValidFilename.md +38 -0
  89. package/docs/functions/isValidFilepath.md +27 -0
  90. package/docs/functions/isWebStream.md +21 -0
  91. package/docs/functions/jsonFilterToWhere.md +45 -0
  92. package/docs/functions/jsonToMarkdownStr.md +31 -0
  93. package/docs/functions/loadFileFromPaths.md +54 -0
  94. package/docs/functions/loadTextFromPaths.md +29 -0
  95. package/docs/functions/lrucache.md +29 -0
  96. package/docs/functions/makeToolFuncCancelable.md +23 -0
  97. package/docs/functions/matchUrlProtocol.md +48 -0
  98. package/docs/functions/memoize.md +27 -0
  99. package/docs/functions/messagesToText.md +21 -0
  100. package/docs/functions/paramsSizeToScaleStr.md +32 -0
  101. package/docs/functions/parseCommand.md +33 -0
  102. package/docs/functions/parseDateFormat.md +360 -0
  103. package/docs/functions/parseFString.md +26 -0
  104. package/docs/functions/parseISO.md +72 -0
  105. package/docs/functions/parseJsJson.md +38 -0
  106. package/docs/functions/parseObjectArgInfo.md +27 -0
  107. package/docs/functions/parseObjectArgumentInfos.md +25 -0
  108. package/docs/functions/parseObjectArguments.md +68 -0
  109. package/docs/functions/parseObjectArgumentsAsArgInfos.md +42 -0
  110. package/docs/functions/parseYaml.md +21 -0
  111. package/docs/functions/quoteStr.md +21 -0
  112. package/docs/functions/reControlCharsRegex.md +21 -0
  113. package/docs/functions/readFilenamesRecursiveSync.md +47 -0
  114. package/docs/functions/readableFromAsyncIterable.md +28 -0
  115. package/docs/functions/registerCoreTools.md +17 -0
  116. package/docs/functions/registerYamlTag.md +21 -0
  117. package/docs/functions/sanitizeFilename.md +37 -0
  118. package/docs/functions/sanitizeFilepath.md +31 -0
  119. package/docs/functions/saveConfigFile.md +25 -0
  120. package/docs/functions/scaleStrToParamsSize.md +27 -0
  121. package/docs/functions/simplifyObjectArguments.md +21 -0
  122. package/docs/functions/sortedValues.md +25 -0
  123. package/docs/functions/splitSentence.md +37 -0
  124. package/docs/functions/stringifyYaml.md +49 -0
  125. package/docs/functions/textToDate.md +23 -0
  126. package/docs/functions/throwError.md +37 -0
  127. package/docs/functions/toDate.md +76 -0
  128. package/docs/functions/toDateTime.md +21 -0
  129. package/docs/functions/trimStartOfStreamHelper.md +41 -0
  130. package/docs/functions/truncTo.md +47 -0
  131. package/docs/functions/uuid.md +23 -0
  132. package/docs/functions/uuidParse.md +21 -0
  133. package/docs/functions/uuidStringify.md +23 -0
  134. package/docs/functions/uuidValidate.md +21 -0
  135. package/docs/functions/uuidVersion.md +21 -0
  136. package/docs/functions/uuidv1.md +47 -0
  137. package/docs/functions/uuidv4.md +47 -0
  138. package/docs/functions/uuidv5.md +51 -0
  139. package/docs/functions/wait.md +21 -0
  140. package/docs/functions/xxhash.md +25 -0
  141. package/docs/functions/xxhash32.md +23 -0
  142. package/docs/functions/xxhash64.md +23 -0
  143. package/docs/functions/xxhashAsStr.md +25 -0
  144. package/docs/globals.md +236 -0
  145. package/docs/interfaces/AIChatAssistantMessageParam.md +29 -38
  146. package/docs/interfaces/AIChatContentPartImage.md +11 -16
  147. package/docs/interfaces/AIChatContentPartText.md +9 -12
  148. package/docs/interfaces/AIChatMessageParamBase.md +12 -19
  149. package/docs/interfaces/AIChatMessageToolCall.md +18 -21
  150. package/docs/interfaces/AIChatSystemMessageParam.md +16 -22
  151. package/docs/interfaces/AIChatToolMessageParam.md +19 -26
  152. package/docs/interfaces/AIChatUserMessageParam.md +32 -42
  153. package/docs/interfaces/AIChoiceConfig.md +31 -39
  154. package/docs/interfaces/AIResult.md +29 -32
  155. package/docs/interfaces/AIStreamParser.md +24 -18
  156. package/docs/interfaces/AIStreamParserOptions.md +8 -10
  157. package/docs/interfaces/BaseFunc.md +55 -75
  158. package/docs/interfaces/BaseFuncItem.md +43 -61
  159. package/docs/interfaces/CancelableAbilityOptions.md +43 -54
  160. package/docs/interfaces/ClientFuncItem.md +66 -83
  161. package/docs/interfaces/DotenvExpandOptions.md +15 -19
  162. package/docs/interfaces/DotenvExpandOutput.md +11 -14
  163. package/docs/interfaces/DotenvParseInput.md +6 -2
  164. package/docs/interfaces/DotenvParseOutput.md +6 -2
  165. package/docs/interfaces/DotenvPopulateInput.md +6 -2
  166. package/docs/interfaces/EventClientFuncParams.md +22 -33
  167. package/docs/interfaces/EventServerFuncParams.md +27 -35
  168. package/docs/interfaces/FewShotPromptTemplateOptions.md +58 -74
  169. package/docs/interfaces/FuncItem.md +53 -70
  170. package/docs/interfaces/FuncParam.md +29 -36
  171. package/docs/interfaces/FuncParams.md +6 -2
  172. package/docs/interfaces/Funcs.md +6 -2
  173. package/docs/interfaces/JsonFilter.md +6 -2
  174. package/docs/interfaces/ParseObjectArgumentOptions.md +23 -29
  175. package/docs/interfaces/PromptExampleSelectorOptions.md +13 -16
  176. package/docs/interfaces/PromptTemplateOptions.md +31 -40
  177. package/docs/interfaces/RemoteFuncItem.md +64 -82
  178. package/docs/interfaces/ResClientFuncParams.md +14 -19
  179. package/docs/interfaces/ResServerFuncParams.md +28 -36
  180. package/docs/interfaces/SanitizeFilenameOptions.md +11 -14
  181. package/docs/interfaces/ServerFuncItem.md +70 -88
  182. package/docs/interfaces/ServerFuncParams.md +15 -20
  183. package/docs/interfaces/StreamCallbacksAndOptions.md +36 -65
  184. package/docs/interfaces/TaskAbortControllers.md +6 -2
  185. package/docs/interfaces/TaskPromise.md +48 -61
  186. package/docs/interfaces/ToolFuncPackage.md +18 -32
  187. package/docs/type-aliases/AIChatContentPart.md +13 -0
  188. package/docs/type-aliases/AIChatMessageParam.md +13 -0
  189. package/docs/type-aliases/AIChatRole.md +13 -0
  190. package/docs/type-aliases/AIMessageType.md +13 -0
  191. package/docs/type-aliases/AIModelNameRule.md +13 -0
  192. package/docs/type-aliases/AIModelNameRuleFn.md +21 -0
  193. package/docs/type-aliases/AIModelNameRules.md +13 -0
  194. package/docs/type-aliases/AITextGenerationFinishReason.md +13 -0
  195. package/docs/type-aliases/ActionName.md +13 -0
  196. package/docs/type-aliases/AsyncTaskId.md +13 -0
  197. package/docs/type-aliases/EventErrorListenerFn.md +27 -0
  198. package/docs/type-aliases/EventListenerFn.md +25 -0
  199. package/docs/type-aliases/FStringPromptTemplateNode.md +16 -0
  200. package/docs/type-aliases/FuncParamType.md +13 -0
  201. package/docs/type-aliases/PromptExamples.md +17 -0
  202. package/docs/type-aliases/PromptTemplateType.md +13 -0
  203. package/docs/type-aliases/PromptType.md +13 -0
  204. package/docs/type-aliases/TFunc.md +23 -0
  205. package/docs/variables/AIChatRoles.md +13 -0
  206. package/docs/variables/AIMessageTypes.md +13 -0
  207. package/docs/variables/AITextGenerationFinishReasons.md +13 -0
  208. package/docs/variables/AbortErrorCode.md +13 -0
  209. package/docs/variables/ActionNames.md +13 -0
  210. package/docs/variables/AlreadyExistsErrorCode.md +13 -0
  211. package/docs/variables/ClientToolFuncSchema.md +87 -0
  212. package/docs/variables/DefaultAsyncSemaphoreCapacity.md +13 -0
  213. package/docs/variables/EventBusName.md +13 -0
  214. package/docs/variables/EventName.md +13 -0
  215. package/docs/variables/FilenameReservedRegex.md +16 -0
  216. package/docs/variables/HFBuiltins.md +92 -0
  217. package/docs/variables/InternalErrorCode.md +13 -0
  218. package/docs/variables/NotFoundErrorCode.md +13 -0
  219. package/docs/variables/NotImplementedErrorCode.md +13 -0
  220. package/docs/variables/PASSING_SCORE.md +13 -0
  221. package/docs/variables/PromptTemplateTypes.md +13 -0
  222. package/docs/variables/PromptTypes.md +16 -0
  223. package/docs/variables/RStreamErrCode.md +13 -0
  224. package/docs/variables/RemoteToolFuncSchema.md +87 -0
  225. package/docs/variables/ResponseRStreamErrCode.md +13 -0
  226. package/docs/variables/SSEChannelAlreadyClosedErrCode.md +13 -0
  227. package/docs/variables/ServerToolFuncSchema.md +87 -0
  228. package/docs/variables/ToolAsyncCancelableBit.md +13 -0
  229. package/docs/variables/ToolAsyncMultiTaskBit.md +13 -0
  230. package/docs/variables/ToolAsyncPriorityBit.md +13 -0
  231. package/docs/variables/ToolFuncSchema.md +125 -0
  232. package/docs/variables/WindowsReservedNameRegex.md +15 -0
  233. package/docs/variables/base32768.md +13 -0
  234. package/docs/variables/defaultTemplateFormat.md +13 -0
  235. package/docs/variables/event.md +13 -0
  236. package/docs/variables/eventClient.md +13 -0
  237. package/docs/variables/eventServer.md +13 -0
  238. package/docs/variables/lrucache.md +13 -0
  239. package/docs/variables/mimeType.md +13 -0
  240. package/docs/variables/uuidNIL.md +13 -0
  241. package/package.json +26 -27
  242. package/dist/chunk-W2LO3HZT.mjs +0 -1
  243. package/docs/.nojekyll +0 -1
  244. package/docs/enums/AsyncFeatureBits.md +0 -41
  245. package/docs/enums/AsyncFeatures.md +0 -41
  246. package/docs/enums/ErrorCode.md +0 -239
  247. package/docs/enums/XXHashAlgorithm.md +0 -30
  248. package/docs/modules.md +0 -4062
@@ -1,75 +1,60 @@
1
- [@isdk/ai-tool](../README.md) / [Exports](../modules.md) / TaskPromise
1
+ [**@isdk/ai-tool**](../README.md) **Docs**
2
2
 
3
- # Interface: TaskPromise\<T\>
3
+ ***
4
4
 
5
- ## Type parameters
5
+ [@isdk/ai-tool](../globals.md) / TaskPromise
6
6
 
7
- | Name | Type |
8
- | :------ | :------ |
9
- | `T` | `any` |
7
+ # Interface: TaskPromise\<T\>
10
8
 
11
- ## Hierarchy
9
+ ## Extends
12
10
 
13
11
  - `Promise`\<`T`\>
14
12
 
15
- **`TaskPromise`**
16
-
17
- ## Table of contents
18
-
19
- ### Properties
20
-
21
- - [[toStringTag]](TaskPromise.md#[tostringtag])
22
- - [task](TaskPromise.md#task)
23
-
24
- ### Methods
13
+ ## Type Parameters
25
14
 
26
- - [catch](TaskPromise.md#catch)
27
- - [finally](TaskPromise.md#finally)
28
- - [then](TaskPromise.md#then)
15
+ **T** = `any`
29
16
 
30
17
  ## Properties
31
18
 
32
- ### [toStringTag]
19
+ ### \[toStringTag\]
33
20
 
34
- `Readonly` **[toStringTag]**: `string`
21
+ > `readonly` **\[toStringTag\]**: `string`
35
22
 
36
23
  #### Inherited from
37
24
 
38
- Promise.[toStringTag]
25
+ `Promise.[toStringTag]`
39
26
 
40
27
  #### Defined in
41
28
 
42
- node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:176
29
+ node\_modules/.pnpm/typescript@5.6.2/node\_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:176
43
30
 
44
- ___
31
+ ***
45
32
 
46
- ### task
33
+ ### task?
47
34
 
48
- `Optional` **task**: [`TaskAbortController`](../classes/TaskAbortController.md)
35
+ > `optional` **task**: [`TaskAbortController`](../classes/TaskAbortController.md)
49
36
 
50
37
  #### Defined in
51
38
 
52
- [packages/ai-tool/src/utils/cancelable-ability.ts:51](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/cancelable-ability.ts#L51)
39
+ [packages/ai-tool/src/utils/cancelable-ability.ts:51](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/cancelable-ability.ts#L51)
53
40
 
54
41
  ## Methods
55
42
 
56
- ### catch
43
+ ### catch()
57
44
 
58
- **catch**\<`TResult`\>(`onrejected?`): `Promise`\<`T` \| `TResult`\>
45
+ > **catch**\<`TResult`\>(`onrejected`?): `Promise`\<`T` \| `TResult`\>
59
46
 
60
47
  Attaches a callback for only the rejection of the Promise.
61
48
 
62
- #### Type parameters
49
+ #### Type Parameters
63
50
 
64
- | Name | Type |
65
- | :------ | :------ |
66
- | `TResult` | `never` |
51
+ **TResult** = `never`
67
52
 
68
53
  #### Parameters
69
54
 
70
- | Name | Type | Description |
71
- | :------ | :------ | :------ |
72
- | `onrejected?` | ``null`` \| (`reason`: `any`) => `TResult` \| `PromiseLike`\<`TResult`\> | The callback to execute when the Promise is rejected. |
55
+ **onrejected?**: `null` \| (`reason`) => `TResult` \| `PromiseLike`\<`TResult`\>
56
+
57
+ The callback to execute when the Promise is rejected.
73
58
 
74
59
  #### Returns
75
60
 
@@ -79,26 +64,26 @@ A Promise for the completion of the callback.
79
64
 
80
65
  #### Inherited from
81
66
 
82
- Promise.catch
67
+ `Promise.catch`
83
68
 
84
69
  #### Defined in
85
70
 
86
- node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es5.d.ts:1557
71
+ node\_modules/.pnpm/typescript@5.6.2/node\_modules/typescript/lib/lib.es5.d.ts:1557
87
72
 
88
- ___
73
+ ***
89
74
 
90
- ### finally
75
+ ### finally()
91
76
 
92
- **finally**(`onfinally?`): `Promise`\<`T`\>
77
+ > **finally**(`onfinally`?): `Promise`\<`T`\>
93
78
 
94
79
  Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
95
80
  resolved value cannot be modified from the callback.
96
81
 
97
82
  #### Parameters
98
83
 
99
- | Name | Type | Description |
100
- | :------ | :------ | :------ |
101
- | `onfinally?` | ``null`` \| () => `void` | The callback to execute when the Promise is settled (fulfilled or rejected). |
84
+ **onfinally?**: `null` \| () => `void`
85
+
86
+ The callback to execute when the Promise is settled (fulfilled or rejected).
102
87
 
103
88
  #### Returns
104
89
 
@@ -108,33 +93,35 @@ A Promise for the completion of the callback.
108
93
 
109
94
  #### Inherited from
110
95
 
111
- Promise.finally
96
+ `Promise.finally`
112
97
 
113
98
  #### Defined in
114
99
 
115
- node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es2018.promise.d.ts:29
100
+ node\_modules/.pnpm/typescript@5.6.2/node\_modules/typescript/lib/lib.es2018.promise.d.ts:29
116
101
 
117
- ___
102
+ ***
118
103
 
119
- ### then
104
+ ### then()
120
105
 
121
- **then**\<`TResult1`, `TResult2`\>(`onfulfilled?`, `onrejected?`): `Promise`\<`TResult1` \| `TResult2`\>
106
+ > **then**\<`TResult1`, `TResult2`\>(`onfulfilled`?, `onrejected`?): `Promise`\<`TResult1` \| `TResult2`\>
122
107
 
123
108
  Attaches callbacks for the resolution and/or rejection of the Promise.
124
109
 
125
- #### Type parameters
110
+ #### Type Parameters
111
+
112
+ • **TResult1** = `T`
126
113
 
127
- | Name | Type |
128
- | :------ | :------ |
129
- | `TResult1` | `T` |
130
- | `TResult2` | `never` |
114
+ **TResult2** = `never`
131
115
 
132
116
  #### Parameters
133
117
 
134
- | Name | Type | Description |
135
- | :------ | :------ | :------ |
136
- | `onfulfilled?` | ``null`` \| (`value`: `T`) => `TResult1` \| `PromiseLike`\<`TResult1`\> | The callback to execute when the Promise is resolved. |
137
- | `onrejected?` | ``null`` \| (`reason`: `any`) => `TResult2` \| `PromiseLike`\<`TResult2`\> | The callback to execute when the Promise is rejected. |
118
+ **onfulfilled?**: `null` \| (`value`) => `TResult1` \| `PromiseLike`\<`TResult1`\>
119
+
120
+ The callback to execute when the Promise is resolved.
121
+
122
+ • **onrejected?**: `null` \| (`reason`) => `TResult2` \| `PromiseLike`\<`TResult2`\>
123
+
124
+ The callback to execute when the Promise is rejected.
138
125
 
139
126
  #### Returns
140
127
 
@@ -144,8 +131,8 @@ A Promise for the completion of which ever callback is executed.
144
131
 
145
132
  #### Inherited from
146
133
 
147
- Promise.then
134
+ `Promise.then`
148
135
 
149
136
  #### Defined in
150
137
 
151
- node_modules/.pnpm/typescript@5.4.5/node_modules/typescript/lib/lib.es5.d.ts:1550
138
+ node\_modules/.pnpm/typescript@5.6.2/node\_modules/typescript/lib/lib.es5.d.ts:1550
@@ -1,63 +1,49 @@
1
- [@isdk/ai-tool](../README.md) / [Exports](../modules.md) / ToolFuncPackage
1
+ [**@isdk/ai-tool**](../README.md) **Docs**
2
2
 
3
- # Interface: ToolFuncPackage
4
-
5
- ## Table of contents
3
+ ***
6
4
 
7
- ### Properties
5
+ [@isdk/ai-tool](../globals.md) / ToolFuncPackage
8
6
 
9
- - [name](ToolFuncPackage.md#name)
10
- - [register](ToolFuncPackage.md#register)
11
- - [unregister](ToolFuncPackage.md#unregister)
7
+ # Interface: ToolFuncPackage
12
8
 
13
9
  ## Properties
14
10
 
15
11
  ### name
16
12
 
17
- **name**: `string`
13
+ > **name**: `string`
18
14
 
19
15
  #### Defined in
20
16
 
21
- [packages/ai-tool/src/tool-func.ts:64](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/tool-func.ts#L64)
22
-
23
- ___
17
+ [packages/ai-tool/src/tool-func.ts:64](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/tool-func.ts#L64)
24
18
 
25
- ### register
19
+ ***
26
20
 
27
- **register**: (`data?`: `any`) => `void`
21
+ ### register()
28
22
 
29
- #### Type declaration
23
+ > **register**: (`data`?) => `void`
30
24
 
31
- (`data?`): `void`
25
+ #### Parameters
32
26
 
33
- ##### Parameters
27
+ **data?**: `any`
34
28
 
35
- | Name | Type |
36
- | :------ | :------ |
37
- | `data?` | `any` |
38
-
39
- ##### Returns
29
+ #### Returns
40
30
 
41
31
  `void`
42
32
 
43
33
  #### Defined in
44
34
 
45
- [packages/ai-tool/src/tool-func.ts:65](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/tool-func.ts#L65)
46
-
47
- ___
48
-
49
- ### unregister
35
+ [packages/ai-tool/src/tool-func.ts:65](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/tool-func.ts#L65)
50
36
 
51
- • `Optional` **unregister**: () => `void`
37
+ ***
52
38
 
53
- #### Type declaration
39
+ ### unregister()?
54
40
 
55
- (): `void`
41
+ > `optional` **unregister**: () => `void`
56
42
 
57
- ##### Returns
43
+ #### Returns
58
44
 
59
45
  `void`
60
46
 
61
47
  #### Defined in
62
48
 
63
- [packages/ai-tool/src/tool-func.ts:66](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/tool-func.ts#L66)
49
+ [packages/ai-tool/src/tool-func.ts:66](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/tool-func.ts#L66)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AIChatContentPart
6
+
7
+ # Type Alias: AIChatContentPart
8
+
9
+ > **AIChatContentPart**: [`AIChatContentPartText`](../interfaces/AIChatContentPartText.md) \| [`AIChatContentPartImage`](../interfaces/AIChatContentPartImage.md)
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/chat.ts:76](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/chat.ts#L76)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AIChatMessageParam
6
+
7
+ # Type Alias: AIChatMessageParam
8
+
9
+ > **AIChatMessageParam**: [`AIChatSystemMessageParam`](../interfaces/AIChatSystemMessageParam.md) \| [`AIChatUserMessageParam`](../interfaces/AIChatUserMessageParam.md) \| [`AIChatAssistantMessageParam`](../interfaces/AIChatAssistantMessageParam.md) \| [`AIChatToolMessageParam`](../interfaces/AIChatToolMessageParam.md)
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/chat.ts:46](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/chat.ts#L46)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AIChatRole
6
+
7
+ # Type Alias: AIChatRole
8
+
9
+ > **AIChatRole**: *typeof* [`AIChatRoles`](../variables/AIChatRoles.md)\[`number`\] & `string`
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/chat.ts:44](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/chat.ts#L44)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AIMessageType
6
+
7
+ # Type Alias: AIMessageType
8
+
9
+ > **AIMessageType**: *typeof* [`AIMessageTypes`](../variables/AIMessageTypes.md)\[`number`\]
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/chat.ts:38](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/chat.ts#L38)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AIModelNameRule
6
+
7
+ # Type Alias: AIModelNameRule
8
+
9
+ > **AIModelNameRule**: `string` \| `RegExp` \| [`AIModelNameRuleFn`](AIModelNameRuleFn.md)
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/consts.ts#L10)
@@ -0,0 +1,21 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AIModelNameRuleFn
6
+
7
+ # Type Alias: AIModelNameRuleFn()
8
+
9
+ > **AIModelNameRuleFn**: (`name`) => `string` \| `RegExpExecArray` \| `undefined`
10
+
11
+ ## Parameters
12
+
13
+ • **name**: `string`
14
+
15
+ ## Returns
16
+
17
+ `string` \| `RegExpExecArray` \| `undefined`
18
+
19
+ ## Defined in
20
+
21
+ [packages/ai-tool/src/utils/consts.ts:8](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/consts.ts#L8)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AIModelNameRules
6
+
7
+ # Type Alias: AIModelNameRules
8
+
9
+ > **AIModelNameRules**: [`AIModelNameRule`](AIModelNameRule.md) \| [`AIModelNameRule`](AIModelNameRule.md)[]
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/consts.ts:11](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/consts.ts#L11)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AITextGenerationFinishReason
6
+
7
+ # Type Alias: AITextGenerationFinishReason
8
+
9
+ > **AITextGenerationFinishReason**: *typeof* [`AITextGenerationFinishReasons`](../variables/AITextGenerationFinishReasons.md)\[`number`\]
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/chat.ts:14](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/chat.ts#L14)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / ActionName
6
+
7
+ # Type Alias: ActionName
8
+
9
+ > **ActionName**: *typeof* [`ActionNames`](../variables/ActionNames.md)\[`number`\]
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/consts.ts:6](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/consts.ts#L6)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AsyncTaskId
6
+
7
+ # Type Alias: AsyncTaskId
8
+
9
+ > **AsyncTaskId**: `string` \| `number`
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/cancelable-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/cancelable-ability.ts#L8)
@@ -0,0 +1,27 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / EventErrorListenerFn
6
+
7
+ # Type Alias: EventErrorListenerFn()
8
+
9
+ > **EventErrorListenerFn**: (`this`, `err`, `name`, ...`args`) => `any`
10
+
11
+ ## Parameters
12
+
13
+ • **this**: `Event`
14
+
15
+ • **err**: `Error`
16
+
17
+ • **name**: `string`
18
+
19
+ • ...**args**: `any`
20
+
21
+ ## Returns
22
+
23
+ `any`
24
+
25
+ ## Defined in
26
+
27
+ [packages/ai-tool/src/utils/event/event-ability.ts:9](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/event/event-ability.ts#L9)
@@ -0,0 +1,25 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / EventListenerFn
6
+
7
+ # Type Alias: EventListenerFn()
8
+
9
+ > **EventListenerFn**: (`this`, `name`, ...`args`) => `any`
10
+
11
+ ## Parameters
12
+
13
+ • **this**: `Event`
14
+
15
+ • **name**: `string`
16
+
17
+ • ...**args**: `any`
18
+
19
+ ## Returns
20
+
21
+ `any`
22
+
23
+ ## Defined in
24
+
25
+ [packages/ai-tool/src/utils/event/event-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/event/event-ability.ts#L8)
@@ -0,0 +1,16 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / FStringPromptTemplateNode
6
+
7
+ # Type Alias: FStringPromptTemplateNode
8
+
9
+ > **FStringPromptTemplateNode**: `object` \| `object`
10
+
11
+ Type that represents a node in a parsed format string. It can be either
12
+ a literal text or a variable name.
13
+
14
+ ## Defined in
15
+
16
+ [packages/ai-tool/src/utils/prompt/template/python.ts:6](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/prompt/template/python.ts#L6)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / FuncParamType
6
+
7
+ # Type Alias: FuncParamType
8
+
9
+ > **FuncParamType**: `string`
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/tool-func.ts:24](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/tool-func.ts#L24)
@@ -0,0 +1,17 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / PromptExamples
6
+
7
+ # Type Alias: PromptExamples\<T\>
8
+
9
+ > **PromptExamples**\<`T`\>: `Iterable`\<`PromiseLike`\<`T`\> \| `T`\> \| `AsyncIterable`\<`T`\>
10
+
11
+ ## Type Parameters
12
+
13
+ • **T** = `any`
14
+
15
+ ## Defined in
16
+
17
+ [packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:3](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/prompt/prompt-example-selector.ts#L3)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / PromptTemplateType
6
+
7
+ # Type Alias: PromptTemplateType
8
+
9
+ > **PromptTemplateType**: *typeof* [`PromptTemplateTypes`](../variables/PromptTemplateTypes.md)\[`number`\]
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/prompt/consts.ts:17](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/prompt/consts.ts#L17)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / PromptType
6
+
7
+ # Type Alias: PromptType
8
+
9
+ > **PromptType**: *typeof* [`PromptTypes`](../variables/PromptTypes.md)\[`number`\]
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/prompt/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/prompt/consts.ts#L10)
@@ -0,0 +1,23 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / TFunc
6
+
7
+ # Type Alias: TFunc()
8
+
9
+ > **TFunc**: (`this`, ...`params`) => `any`
10
+
11
+ ## Parameters
12
+
13
+ • **this**: [`ToolFunc`](../classes/ToolFunc.md)
14
+
15
+ • ...**params**: `any`[]
16
+
17
+ ## Returns
18
+
19
+ `any`
20
+
21
+ ## Defined in
22
+
23
+ [packages/ai-tool/src/tool-func.ts:38](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/tool-func.ts#L38)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AIChatRoles
6
+
7
+ # Variable: AIChatRoles
8
+
9
+ > `const` **AIChatRoles**: readonly [`"user"`, `"assistant"`, `"system"`, `"tool"`, `"tool_calls"`]
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/chat.ts:43](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/chat.ts#L43)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AIMessageTypes
6
+
7
+ # Variable: AIMessageTypes
8
+
9
+ > `const` **AIMessageTypes**: readonly [`"human"`, `"ai"`, `"generic"`, `"system"`, `"tool"`]
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/chat.ts:37](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/chat.ts#L37)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AITextGenerationFinishReasons
6
+
7
+ # Variable: AITextGenerationFinishReasons
8
+
9
+ > `const` **AITextGenerationFinishReasons**: readonly [`"stop"`, `"length"`, `"content_filter"`, `"tool_calls"`, `"function_call"`, `"abort"`, `"error"`, `"other"`, `null`]
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/chat.ts:4](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/chat.ts#L4)
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / AbortErrorCode
6
+
7
+ # Variable: AbortErrorCode
8
+
9
+ > `const` **AbortErrorCode**: [`Aborted`](../enumerations/ErrorCode.md#aborted) = `ErrorCode.Aborted`
10
+
11
+ ## Defined in
12
+
13
+ node\_modules/.pnpm/@isdk+common-error@0.1.1/node\_modules/@isdk/common-error/dist/index.d.ts:31
@@ -0,0 +1,13 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / ActionNames
6
+
7
+ # Variable: ActionNames
8
+
9
+ > `const` **ActionNames**: readonly [`"get"`, `"post"`, `"put"`, `"delete"`, `"patch"`, `"list"`, `"res"`]
10
+
11
+ ## Defined in
12
+
13
+ [packages/ai-tool/src/utils/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/consts.ts#L5)