@isdk/ai-tool 0.0.7 → 0.0.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.
- package/dist/chunk-B7IE5ATQ.mjs +1 -0
- package/dist/funcs.d.mts +1 -1
- package/dist/funcs.d.ts +1 -1
- package/dist/funcs.js +1 -1
- package/dist/funcs.mjs +1 -1
- package/dist/{index-japi6bEq.d.mts → index-Dgo3ZXPQ.d.mts} +28 -2
- package/dist/{index-japi6bEq.d.ts → index-Dgo3ZXPQ.d.ts} +28 -2
- package/dist/index.d.mts +361 -52
- package/dist/index.d.ts +361 -52
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/classes/AbortError.md +8 -8
- package/docs/classes/AlreadyExistsError.md +8 -8
- package/docs/classes/BaseError.md +8 -8
- package/docs/classes/CancelableAbility.md +431 -0
- package/docs/classes/ClientTools.md +101 -51
- package/docs/classes/CommonError.md +8 -8
- package/docs/classes/EventClient.md +123 -73
- package/docs/classes/EventServer.md +121 -71
- package/docs/classes/EventToolFunc.md +91 -41
- package/docs/classes/FStringPromptTemplate.md +18 -18
- package/docs/classes/FewShotPromptTemplate.md +22 -22
- package/docs/classes/GolangPromptTemplate.md +18 -18
- package/docs/classes/HFEnvironment.md +9 -9
- package/docs/classes/HFInterpreter.md +17 -17
- package/docs/classes/HFTemplate.md +4 -4
- package/docs/classes/HfPromptTemplate.md +18 -18
- package/docs/classes/IntSet.md +249 -0
- package/docs/classes/NotFoundError.md +8 -8
- package/docs/classes/NotImplementationError.md +8 -8
- package/docs/classes/PromptExampleSelector.md +8 -8
- package/docs/classes/PromptTemplate.md +17 -17
- package/docs/classes/ReadableStreamError.md +8 -8
- package/docs/classes/ResClientTools.md +107 -57
- package/docs/classes/ResServerTools.md +105 -55
- package/docs/classes/SSEChannel.md +15 -15
- package/docs/classes/Semaphore.md +273 -0
- package/docs/classes/ServerTools.md +98 -48
- package/docs/classes/TaskAbortController.md +157 -0
- package/docs/classes/ToolFunc.md +80 -38
- package/docs/enums/AsyncFeatureBits.md +41 -0
- package/docs/enums/AsyncFeatures.md +41 -0
- package/docs/enums/ErrorCode.md +41 -19
- package/docs/enums/XXHashAlgorithm.md +2 -2
- package/docs/interfaces/AIChatAssistantMessageParam.md +6 -6
- package/docs/interfaces/AIChatContentPartImage.md +2 -2
- package/docs/interfaces/AIChatContentPartText.md +2 -2
- package/docs/interfaces/AIChatMessageParamBase.md +1 -1
- package/docs/interfaces/AIChatMessageToolCall.md +3 -3
- package/docs/interfaces/AIChatSystemMessageParam.md +3 -3
- package/docs/interfaces/AIChatToolMessageParam.md +4 -4
- package/docs/interfaces/AIChatUserMessageParam.md +7 -7
- package/docs/interfaces/AIResult.md +16 -5
- package/docs/interfaces/AIStreamParser.md +1 -1
- package/docs/interfaces/AIStreamParserOptions.md +1 -1
- package/docs/interfaces/BaseFunc.md +7 -7
- package/docs/interfaces/BaseFuncItem.md +6 -6
- package/docs/interfaces/CancelableAbilityOptions.md +126 -0
- package/docs/interfaces/ClientFuncItem.md +10 -10
- package/docs/interfaces/DotenvExpandOptions.md +3 -3
- package/docs/interfaces/DotenvExpandOutput.md +2 -2
- package/docs/interfaces/EventClientFuncParams.md +4 -4
- package/docs/interfaces/EventServerFuncParams.md +5 -5
- package/docs/interfaces/FewShotPromptTemplateOptions.md +11 -11
- package/docs/interfaces/FuncItem.md +7 -7
- package/docs/interfaces/FuncParam.md +16 -5
- package/docs/interfaces/PromptExampleSelectorOptions.md +2 -2
- package/docs/interfaces/PromptTemplateOptions.md +6 -6
- package/docs/interfaces/RemoteFuncItem.md +10 -10
- package/docs/interfaces/ResClientFuncParams.md +2 -2
- package/docs/interfaces/ResServerFuncParams.md +5 -5
- package/docs/interfaces/SanitizeFilenameOptions.md +2 -2
- package/docs/interfaces/ServerFuncItem.md +11 -11
- package/docs/interfaces/ServerFuncParams.md +2 -2
- package/docs/interfaces/StreamCallbacksAndOptions.md +124 -0
- package/docs/interfaces/TaskAbortControllers.md +7 -0
- package/docs/interfaces/TaskPromise.md +151 -0
- package/docs/interfaces/ToolFuncPackage.md +63 -0
- package/docs/modules.md +1124 -120
- package/package.json +3 -2
- package/dist/chunk-PYM7DCYB.mjs +0 -1
- package/docs/interfaces/AIStreamCallbacksAndOptions.md +0 -158
package/docs/modules.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
### Enumerations
|
|
8
8
|
|
|
9
|
+
- [AsyncFeatureBits](enums/AsyncFeatureBits.md)
|
|
10
|
+
- [AsyncFeatures](enums/AsyncFeatures.md)
|
|
9
11
|
- [ErrorCode](enums/ErrorCode.md)
|
|
10
12
|
- [XXHashAlgorithm](enums/XXHashAlgorithm.md)
|
|
11
13
|
|
|
@@ -14,6 +16,7 @@
|
|
|
14
16
|
- [AbortError](classes/AbortError.md)
|
|
15
17
|
- [AlreadyExistsError](classes/AlreadyExistsError.md)
|
|
16
18
|
- [BaseError](classes/BaseError.md)
|
|
19
|
+
- [CancelableAbility](classes/CancelableAbility.md)
|
|
17
20
|
- [ClientTools](classes/ClientTools.md)
|
|
18
21
|
- [CommonError](classes/CommonError.md)
|
|
19
22
|
- [ConfigFile](classes/ConfigFile.md)
|
|
@@ -27,6 +30,7 @@
|
|
|
27
30
|
- [HFInterpreter](classes/HFInterpreter.md)
|
|
28
31
|
- [HFTemplate](classes/HFTemplate.md)
|
|
29
32
|
- [HfPromptTemplate](classes/HfPromptTemplate.md)
|
|
33
|
+
- [IntSet](classes/IntSet.md)
|
|
30
34
|
- [NotFoundError](classes/NotFoundError.md)
|
|
31
35
|
- [NotImplementationError](classes/NotImplementationError.md)
|
|
32
36
|
- [PromptExampleSelector](classes/PromptExampleSelector.md)
|
|
@@ -35,7 +39,9 @@
|
|
|
35
39
|
- [ResClientTools](classes/ResClientTools.md)
|
|
36
40
|
- [ResServerTools](classes/ResServerTools.md)
|
|
37
41
|
- [SSEChannel](classes/SSEChannel.md)
|
|
42
|
+
- [Semaphore](classes/Semaphore.md)
|
|
38
43
|
- [ServerTools](classes/ServerTools.md)
|
|
44
|
+
- [TaskAbortController](classes/TaskAbortController.md)
|
|
39
45
|
- [ToolFunc](classes/ToolFunc.md)
|
|
40
46
|
|
|
41
47
|
### Interfaces
|
|
@@ -49,11 +55,11 @@
|
|
|
49
55
|
- [AIChatToolMessageParam](interfaces/AIChatToolMessageParam.md)
|
|
50
56
|
- [AIChatUserMessageParam](interfaces/AIChatUserMessageParam.md)
|
|
51
57
|
- [AIResult](interfaces/AIResult.md)
|
|
52
|
-
- [AIStreamCallbacksAndOptions](interfaces/AIStreamCallbacksAndOptions.md)
|
|
53
58
|
- [AIStreamParser](interfaces/AIStreamParser.md)
|
|
54
59
|
- [AIStreamParserOptions](interfaces/AIStreamParserOptions.md)
|
|
55
60
|
- [BaseFunc](interfaces/BaseFunc.md)
|
|
56
61
|
- [BaseFuncItem](interfaces/BaseFuncItem.md)
|
|
62
|
+
- [CancelableAbilityOptions](interfaces/CancelableAbilityOptions.md)
|
|
57
63
|
- [ClientFuncItem](interfaces/ClientFuncItem.md)
|
|
58
64
|
- [DotenvExpandOptions](interfaces/DotenvExpandOptions.md)
|
|
59
65
|
- [DotenvExpandOutput](interfaces/DotenvExpandOutput.md)
|
|
@@ -77,6 +83,10 @@
|
|
|
77
83
|
- [SanitizeFilenameOptions](interfaces/SanitizeFilenameOptions.md)
|
|
78
84
|
- [ServerFuncItem](interfaces/ServerFuncItem.md)
|
|
79
85
|
- [ServerFuncParams](interfaces/ServerFuncParams.md)
|
|
86
|
+
- [StreamCallbacksAndOptions](interfaces/StreamCallbacksAndOptions.md)
|
|
87
|
+
- [TaskAbortControllers](interfaces/TaskAbortControllers.md)
|
|
88
|
+
- [TaskPromise](interfaces/TaskPromise.md)
|
|
89
|
+
- [ToolFuncPackage](interfaces/ToolFuncPackage.md)
|
|
80
90
|
|
|
81
91
|
### Type Aliases
|
|
82
92
|
|
|
@@ -89,6 +99,7 @@
|
|
|
89
99
|
- [AIModelNameRules](modules.md#aimodelnamerules)
|
|
90
100
|
- [AITextGenerationFinishReason](modules.md#aitextgenerationfinishreason)
|
|
91
101
|
- [ActionName](modules.md#actionname)
|
|
102
|
+
- [AsyncTaskId](modules.md#asynctaskid)
|
|
92
103
|
- [ErrorCodeType](modules.md#errorcodetype)
|
|
93
104
|
- [EventErrorListenerFn](modules.md#eventerrorlistenerfn)
|
|
94
105
|
- [EventListenerFn](modules.md#eventlistenerfn)
|
|
@@ -108,6 +119,7 @@
|
|
|
108
119
|
- [ActionNames](modules.md#actionnames)
|
|
109
120
|
- [AlreadyExistsErrorCode](modules.md#alreadyexistserrorcode)
|
|
110
121
|
- [ClientToolFuncSchema](modules.md#clienttoolfuncschema)
|
|
122
|
+
- [DefaultAsyncSemaphoreCapacity](modules.md#defaultasyncsemaphorecapacity)
|
|
111
123
|
- [EventBusName](modules.md#eventbusname)
|
|
112
124
|
- [EventName](modules.md#eventname)
|
|
113
125
|
- [FilenameReservedRegex](modules.md#filenamereservedregex)
|
|
@@ -125,6 +137,9 @@
|
|
|
125
137
|
- [ResponseRStreamErrCode](modules.md#responserstreamerrcode)
|
|
126
138
|
- [SSEChannelAlreadyClosedErrCode](modules.md#ssechannelalreadyclosederrcode)
|
|
127
139
|
- [ServerToolFuncSchema](modules.md#servertoolfuncschema)
|
|
140
|
+
- [ToolAsyncCancelableBit](modules.md#toolasynccancelablebit)
|
|
141
|
+
- [ToolAsyncMultiTaskBit](modules.md#toolasyncmultitaskbit)
|
|
142
|
+
- [ToolAsyncPriorityBit](modules.md#toolasyncprioritybit)
|
|
128
143
|
- [ToolFuncSchema](modules.md#toolfuncschema)
|
|
129
144
|
- [WindowsReservedNameRegex](modules.md#windowsreservednameregex)
|
|
130
145
|
- [base32768](modules.md#base32768)
|
|
@@ -139,10 +154,12 @@
|
|
|
139
154
|
### Functions
|
|
140
155
|
|
|
141
156
|
- [AIStream](modules.md#aistream)
|
|
157
|
+
- [RateLimit](modules.md#ratelimit)
|
|
142
158
|
- [\_lrucache](modules.md#_lrucache)
|
|
143
159
|
- [backendEventable](modules.md#backendeventable)
|
|
144
160
|
- [canonicalize](modules.md#canonicalize)
|
|
145
161
|
- [canonicalizeEx](modules.md#canonicalizeex)
|
|
162
|
+
- [createAbilityInjector](modules.md#createabilityinjector)
|
|
146
163
|
- [createCallbacksTransformer](modules.md#createcallbackstransformer)
|
|
147
164
|
- [createEmptyReadableStream](modules.md#createemptyreadablestream)
|
|
148
165
|
- [createEndWithRepetitionDetector](modules.md#createendwithrepetitiondetector)
|
|
@@ -150,15 +167,18 @@
|
|
|
150
167
|
- [createEventStreamTransformer](modules.md#createeventstreamtransformer)
|
|
151
168
|
- [createHfValueFunc](modules.md#createhfvaluefunc)
|
|
152
169
|
- [createLRUCache](modules.md#createlrucache)
|
|
170
|
+
- [dateToText](modules.md#datetotext)
|
|
153
171
|
- [expandEnv](modules.md#expandenv)
|
|
154
172
|
- [expandObjEnv](modules.md#expandobjenv)
|
|
155
173
|
- [extNameLevel](modules.md#extnamelevel)
|
|
156
174
|
- [filenameReservedRegex](modules.md#filenamereservedregex-1)
|
|
175
|
+
- [formatISO](modules.md#formatiso)
|
|
157
176
|
- [getAllEnumKeys](modules.md#getallenumkeys)
|
|
158
177
|
- [getConfigFileNames](modules.md#getconfigfilenames)
|
|
159
178
|
- [getConfigs](modules.md#getconfigs)
|
|
160
179
|
- [getKeysPath](modules.md#getkeyspath)
|
|
161
180
|
- [getMultiLevelExtname](modules.md#getmultilevelextname)
|
|
181
|
+
- [getRealFilepath](modules.md#getrealfilepath)
|
|
162
182
|
- [getResponseErrorReadableStream](modules.md#getresponseerrorreadablestream)
|
|
163
183
|
- [hfParse](modules.md#hfparse)
|
|
164
184
|
- [hfTokenize](modules.md#hftokenize)
|
|
@@ -168,24 +188,36 @@
|
|
|
168
188
|
- [isModelNameMatched](modules.md#ismodelnamematched)
|
|
169
189
|
- [isValidFilename](modules.md#isvalidfilename)
|
|
170
190
|
- [isValidFilepath](modules.md#isvalidfilepath)
|
|
191
|
+
- [isWebStream](modules.md#iswebstream)
|
|
171
192
|
- [jsonFilterToWhere](modules.md#jsonfiltertowhere)
|
|
193
|
+
- [jsonToMarkdownStr](modules.md#jsontomarkdownstr)
|
|
172
194
|
- [loadFileFromPaths](modules.md#loadfilefrompaths)
|
|
173
195
|
- [loadTextFromPaths](modules.md#loadtextfrompaths)
|
|
196
|
+
- [makeToolFuncCancelable](modules.md#maketoolfunccancelable)
|
|
174
197
|
- [matchUrlProtocol](modules.md#matchurlprotocol)
|
|
198
|
+
- [messagesToText](modules.md#messagestotext)
|
|
199
|
+
- [paramsSizeToScaleStr](modules.md#paramssizetoscalestr)
|
|
200
|
+
- [parseDateFormat](modules.md#parsedateformat)
|
|
175
201
|
- [parseFString](modules.md#parsefstring)
|
|
202
|
+
- [parseISO](modules.md#parseiso)
|
|
176
203
|
- [parseJsJson](modules.md#parsejsjson)
|
|
177
204
|
- [parseYaml](modules.md#parseyaml)
|
|
178
205
|
- [reControlCharsRegex](modules.md#recontrolcharsregex)
|
|
206
|
+
- [readFilenamesRecursiveSync](modules.md#readfilenamesrecursivesync)
|
|
179
207
|
- [readableFromAsyncIterable](modules.md#readablefromasynciterable)
|
|
180
208
|
- [registerCoreTools](modules.md#registercoretools)
|
|
181
209
|
- [registerYamlTag](modules.md#registeryamltag)
|
|
182
210
|
- [sanitizeFilename](modules.md#sanitizefilename)
|
|
183
211
|
- [sanitizeFilepath](modules.md#sanitizefilepath)
|
|
184
212
|
- [saveConfigFile](modules.md#saveconfigfile)
|
|
213
|
+
- [scaleStrToParamsSize](modules.md#scalestrtoparamssize)
|
|
185
214
|
- [sortedValues](modules.md#sortedvalues)
|
|
186
215
|
- [splitSentence](modules.md#splitsentence)
|
|
187
216
|
- [stringifyYaml](modules.md#stringifyyaml)
|
|
217
|
+
- [textToDate](modules.md#texttodate)
|
|
188
218
|
- [throwError](modules.md#throwerror)
|
|
219
|
+
- [toDate](modules.md#todate)
|
|
220
|
+
- [toDateTime](modules.md#todatetime)
|
|
189
221
|
- [trimStartOfStreamHelper](modules.md#trimstartofstreamhelper)
|
|
190
222
|
- [truncTo](modules.md#truncto)
|
|
191
223
|
- [uuid](modules.md#uuid)
|
|
@@ -202,7 +234,550 @@
|
|
|
202
234
|
- [xxhash64](modules.md#xxhash64)
|
|
203
235
|
- [xxhashAsStr](modules.md#xxhashasstr)
|
|
204
236
|
|
|
205
|
-
##
|
|
237
|
+
## Common Helpers
|
|
238
|
+
|
|
239
|
+
### formatISO
|
|
240
|
+
|
|
241
|
+
▸ **formatISO**\<`DateType`\>(`date`, `options?`): `string`
|
|
242
|
+
|
|
243
|
+
#### Type parameters
|
|
244
|
+
|
|
245
|
+
| Name | Type | Description |
|
|
246
|
+
| :------ | :------ | :------ |
|
|
247
|
+
| `DateType` | extends `Date` | The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). |
|
|
248
|
+
|
|
249
|
+
#### Parameters
|
|
250
|
+
|
|
251
|
+
| Name | Type | Description |
|
|
252
|
+
| :------ | :------ | :------ |
|
|
253
|
+
| `date` | `string` \| `number` \| `DateType` | The original date |
|
|
254
|
+
| `options?` | `FormatISOOptions` | An object with options. |
|
|
255
|
+
|
|
256
|
+
#### Returns
|
|
257
|
+
|
|
258
|
+
`string`
|
|
259
|
+
|
|
260
|
+
The formatted date string (in loca.l time zone)
|
|
261
|
+
|
|
262
|
+
**`Name`**
|
|
263
|
+
|
|
264
|
+
formatISO
|
|
265
|
+
|
|
266
|
+
**`Summary`**
|
|
267
|
+
|
|
268
|
+
Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).
|
|
269
|
+
|
|
270
|
+
**`Description`**
|
|
271
|
+
|
|
272
|
+
Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.
|
|
273
|
+
|
|
274
|
+
**`Throws`**
|
|
275
|
+
|
|
276
|
+
`date` must not be Invalid Date
|
|
277
|
+
|
|
278
|
+
**`Example`**
|
|
279
|
+
|
|
280
|
+
```ts
|
|
281
|
+
// Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):
|
|
282
|
+
const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))
|
|
283
|
+
//=> '2019-09-18T19:00:52Z'
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**`Example`**
|
|
287
|
+
|
|
288
|
+
```ts
|
|
289
|
+
// Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):
|
|
290
|
+
const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })
|
|
291
|
+
//=> '20190918T190052'
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**`Example`**
|
|
295
|
+
|
|
296
|
+
```ts
|
|
297
|
+
// Represent 18 September 2019 in ISO 8601 format, date only:
|
|
298
|
+
const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })
|
|
299
|
+
//=> '2019-09-18'
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
**`Example`**
|
|
303
|
+
|
|
304
|
+
```ts
|
|
305
|
+
// Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):
|
|
306
|
+
const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })
|
|
307
|
+
//=> '19:00:52Z'
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
#### Defined in
|
|
311
|
+
|
|
312
|
+
node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/formatISO.d.ts:43
|
|
313
|
+
|
|
314
|
+
___
|
|
315
|
+
|
|
316
|
+
### parseDateFormat
|
|
317
|
+
|
|
318
|
+
▸ **parseDateFormat**\<`DateType`\>(`dateStr`, `formatStr`, `referenceDate`, `options?`): `DateType`
|
|
319
|
+
|
|
320
|
+
#### Type parameters
|
|
321
|
+
|
|
322
|
+
| Name | Type | Description |
|
|
323
|
+
| :------ | :------ | :------ |
|
|
324
|
+
| `DateType` | extends `Date` | The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). |
|
|
325
|
+
|
|
326
|
+
#### Parameters
|
|
327
|
+
|
|
328
|
+
| Name | Type | Description |
|
|
329
|
+
| :------ | :------ | :------ |
|
|
330
|
+
| `dateStr` | `string` | The string to parse |
|
|
331
|
+
| `formatStr` | `string` | The string of tokens |
|
|
332
|
+
| `referenceDate` | `string` \| `number` \| `DateType` | defines values missing from the parsed dateString |
|
|
333
|
+
| `options?` | `ParseOptions` | An object with options. see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md |
|
|
334
|
+
|
|
335
|
+
#### Returns
|
|
336
|
+
|
|
337
|
+
`DateType`
|
|
338
|
+
|
|
339
|
+
The parsed date
|
|
340
|
+
|
|
341
|
+
**`Name`**
|
|
342
|
+
|
|
343
|
+
parse
|
|
344
|
+
|
|
345
|
+
**`Summary`**
|
|
346
|
+
|
|
347
|
+
Parse the date.
|
|
348
|
+
|
|
349
|
+
**`Description`**
|
|
350
|
+
|
|
351
|
+
Return the date parsed from string using the given format string.
|
|
352
|
+
|
|
353
|
+
> ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
|
|
354
|
+
> See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
355
|
+
|
|
356
|
+
The characters in the format string wrapped between two single quotes characters (') are escaped.
|
|
357
|
+
Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
|
|
358
|
+
|
|
359
|
+
Format of the format string is based on Unicode Technical Standard #35:
|
|
360
|
+
https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
361
|
+
with a few additions (see note 5 below the table).
|
|
362
|
+
|
|
363
|
+
Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
|
|
364
|
+
and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
|
|
365
|
+
|
|
366
|
+
```javascript
|
|
367
|
+
parse('23 AM', 'HH a', new Date())
|
|
368
|
+
//=> RangeError: The format string mustn't contain `HH` and `a` at the same time
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
|
|
372
|
+
|
|
373
|
+
Accepted format string patterns:
|
|
374
|
+
| Unit |Prior| Pattern | Result examples | Notes |
|
|
375
|
+
|---------------------------------|-----|---------|-----------------------------------|-------|
|
|
376
|
+
| Era | 140 | G..GGG | AD, BC | |
|
|
377
|
+
| | | GGGG | Anno Domini, Before Christ | 2 |
|
|
378
|
+
| | | GGGGG | A, B | |
|
|
379
|
+
| Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
|
|
380
|
+
| | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
|
|
381
|
+
| | | yy | 44, 01, 00, 17 | 4 |
|
|
382
|
+
| | | yyy | 044, 001, 123, 999 | 4 |
|
|
383
|
+
| | | yyyy | 0044, 0001, 1900, 2017 | 4 |
|
|
384
|
+
| | | yyyyy | ... | 2,4 |
|
|
385
|
+
| Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
|
|
386
|
+
| | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
|
|
387
|
+
| | | YY | 44, 01, 00, 17 | 4,6 |
|
|
388
|
+
| | | YYY | 044, 001, 123, 999 | 4 |
|
|
389
|
+
| | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
|
|
390
|
+
| | | YYYYY | ... | 2,4 |
|
|
391
|
+
| ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
|
|
392
|
+
| | | RR | -43, 01, 00, 17 | 4,5 |
|
|
393
|
+
| | | RRR | -043, 001, 123, 999, -999 | 4,5 |
|
|
394
|
+
| | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
|
|
395
|
+
| | | RRRRR | ... | 2,4,5 |
|
|
396
|
+
| Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
|
|
397
|
+
| | | uu | -43, 01, 99, -99 | 4 |
|
|
398
|
+
| | | uuu | -043, 001, 123, 999, -999 | 4 |
|
|
399
|
+
| | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
|
|
400
|
+
| | | uuuuu | ... | 2,4 |
|
|
401
|
+
| Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
|
|
402
|
+
| | | Qo | 1st, 2nd, 3rd, 4th | 5 |
|
|
403
|
+
| | | QQ | 01, 02, 03, 04 | |
|
|
404
|
+
| | | QQQ | Q1, Q2, Q3, Q4 | |
|
|
405
|
+
| | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
|
|
406
|
+
| | | QQQQQ | 1, 2, 3, 4 | 4 |
|
|
407
|
+
| Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
|
|
408
|
+
| | | qo | 1st, 2nd, 3rd, 4th | 5 |
|
|
409
|
+
| | | qq | 01, 02, 03, 04 | |
|
|
410
|
+
| | | qqq | Q1, Q2, Q3, Q4 | |
|
|
411
|
+
| | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
|
|
412
|
+
| | | qqqqq | 1, 2, 3, 4 | 3 |
|
|
413
|
+
| Month (formatting) | 110 | M | 1, 2, ..., 12 | |
|
|
414
|
+
| | | Mo | 1st, 2nd, ..., 12th | 5 |
|
|
415
|
+
| | | MM | 01, 02, ..., 12 | |
|
|
416
|
+
| | | MMM | Jan, Feb, ..., Dec | |
|
|
417
|
+
| | | MMMM | January, February, ..., December | 2 |
|
|
418
|
+
| | | MMMMM | J, F, ..., D | |
|
|
419
|
+
| Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
|
|
420
|
+
| | | Lo | 1st, 2nd, ..., 12th | 5 |
|
|
421
|
+
| | | LL | 01, 02, ..., 12 | |
|
|
422
|
+
| | | LLL | Jan, Feb, ..., Dec | |
|
|
423
|
+
| | | LLLL | January, February, ..., December | 2 |
|
|
424
|
+
| | | LLLLL | J, F, ..., D | |
|
|
425
|
+
| Local week of year | 100 | w | 1, 2, ..., 53 | |
|
|
426
|
+
| | | wo | 1st, 2nd, ..., 53th | 5 |
|
|
427
|
+
| | | ww | 01, 02, ..., 53 | |
|
|
428
|
+
| ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
|
|
429
|
+
| | | Io | 1st, 2nd, ..., 53th | 5 |
|
|
430
|
+
| | | II | 01, 02, ..., 53 | 5 |
|
|
431
|
+
| Day of month | 90 | d | 1, 2, ..., 31 | |
|
|
432
|
+
| | | do | 1st, 2nd, ..., 31st | 5 |
|
|
433
|
+
| | | dd | 01, 02, ..., 31 | |
|
|
434
|
+
| Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
|
|
435
|
+
| | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
|
|
436
|
+
| | | DD | 01, 02, ..., 365, 366 | 7 |
|
|
437
|
+
| | | DDD | 001, 002, ..., 365, 366 | |
|
|
438
|
+
| | | DDDD | ... | 2 |
|
|
439
|
+
| Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |
|
|
440
|
+
| | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
|
|
441
|
+
| | | EEEEE | M, T, W, T, F, S, S | |
|
|
442
|
+
| | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
443
|
+
| ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
|
|
444
|
+
| | | io | 1st, 2nd, ..., 7th | 5 |
|
|
445
|
+
| | | ii | 01, 02, ..., 07 | 5 |
|
|
446
|
+
| | | iii | Mon, Tue, Wed, ..., Sun | 5 |
|
|
447
|
+
| | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
|
|
448
|
+
| | | iiiii | M, T, W, T, F, S, S | 5 |
|
|
449
|
+
| | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |
|
|
450
|
+
| Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
|
|
451
|
+
| | | eo | 2nd, 3rd, ..., 1st | 5 |
|
|
452
|
+
| | | ee | 02, 03, ..., 01 | |
|
|
453
|
+
| | | eee | Mon, Tue, Wed, ..., Sun | |
|
|
454
|
+
| | | eeee | Monday, Tuesday, ..., Sunday | 2 |
|
|
455
|
+
| | | eeeee | M, T, W, T, F, S, S | |
|
|
456
|
+
| | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
457
|
+
| Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
|
|
458
|
+
| | | co | 2nd, 3rd, ..., 1st | 5 |
|
|
459
|
+
| | | cc | 02, 03, ..., 01 | |
|
|
460
|
+
| | | ccc | Mon, Tue, Wed, ..., Sun | |
|
|
461
|
+
| | | cccc | Monday, Tuesday, ..., Sunday | 2 |
|
|
462
|
+
| | | ccccc | M, T, W, T, F, S, S | |
|
|
463
|
+
| | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
464
|
+
| AM, PM | 80 | a..aaa | AM, PM | |
|
|
465
|
+
| | | aaaa | a.m., p.m. | 2 |
|
|
466
|
+
| | | aaaaa | a, p | |
|
|
467
|
+
| AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
|
|
468
|
+
| | | bbbb | a.m., p.m., noon, midnight | 2 |
|
|
469
|
+
| | | bbbbb | a, p, n, mi | |
|
|
470
|
+
| Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
|
|
471
|
+
| | | BBBB | at night, in the morning, ... | 2 |
|
|
472
|
+
| | | BBBBB | at night, in the morning, ... | |
|
|
473
|
+
| Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
|
|
474
|
+
| | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
|
|
475
|
+
| | | hh | 01, 02, ..., 11, 12 | |
|
|
476
|
+
| Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
|
|
477
|
+
| | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
|
|
478
|
+
| | | HH | 00, 01, 02, ..., 23 | |
|
|
479
|
+
| Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
|
|
480
|
+
| | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
|
|
481
|
+
| | | KK | 01, 02, ..., 11, 00 | |
|
|
482
|
+
| Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
|
|
483
|
+
| | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
|
|
484
|
+
| | | kk | 24, 01, 02, ..., 23 | |
|
|
485
|
+
| Minute | 60 | m | 0, 1, ..., 59 | |
|
|
486
|
+
| | | mo | 0th, 1st, ..., 59th | 5 |
|
|
487
|
+
| | | mm | 00, 01, ..., 59 | |
|
|
488
|
+
| Second | 50 | s | 0, 1, ..., 59 | |
|
|
489
|
+
| | | so | 0th, 1st, ..., 59th | 5 |
|
|
490
|
+
| | | ss | 00, 01, ..., 59 | |
|
|
491
|
+
| Seconds timestamp | 40 | t | 512969520 | |
|
|
492
|
+
| | | tt | ... | 2 |
|
|
493
|
+
| Fraction of second | 30 | S | 0, 1, ..., 9 | |
|
|
494
|
+
| | | SS | 00, 01, ..., 99 | |
|
|
495
|
+
| | | SSS | 000, 001, ..., 999 | |
|
|
496
|
+
| | | SSSS | ... | 2 |
|
|
497
|
+
| Milliseconds timestamp | 20 | T | 512969520900 | |
|
|
498
|
+
| | | TT | ... | 2 |
|
|
499
|
+
| Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
|
|
500
|
+
| | | XX | -0800, +0530, Z | |
|
|
501
|
+
| | | XXX | -08:00, +05:30, Z | |
|
|
502
|
+
| | | XXXX | -0800, +0530, Z, +123456 | 2 |
|
|
503
|
+
| | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
|
|
504
|
+
| Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
|
|
505
|
+
| | | xx | -0800, +0530, +0000 | |
|
|
506
|
+
| | | xxx | -08:00, +05:30, +00:00 | 2 |
|
|
507
|
+
| | | xxxx | -0800, +0530, +0000, +123456 | |
|
|
508
|
+
| | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
|
|
509
|
+
| Long localized date | NA | P | 05/29/1453 | 5,8 |
|
|
510
|
+
| | | PP | May 29, 1453 | |
|
|
511
|
+
| | | PPP | May 29th, 1453 | |
|
|
512
|
+
| | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
|
|
513
|
+
| Long localized time | NA | p | 12:00 AM | 5,8 |
|
|
514
|
+
| | | pp | 12:00:00 AM | |
|
|
515
|
+
| Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
|
|
516
|
+
| | | PPpp | May 29, 1453, 12:00:00 AM | |
|
|
517
|
+
| | | PPPpp | May 29th, 1453 at ... | |
|
|
518
|
+
| | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
|
|
519
|
+
Notes:
|
|
520
|
+
1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
|
|
521
|
+
are the same as "stand-alone" units, but are different in some languages.
|
|
522
|
+
"Formatting" units are declined according to the rules of the language
|
|
523
|
+
in the context of a date. "Stand-alone" units are always nominative singular.
|
|
524
|
+
In `format` function, they will produce different result:
|
|
525
|
+
|
|
526
|
+
`format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
|
|
527
|
+
|
|
528
|
+
`format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
|
|
529
|
+
|
|
530
|
+
`parse` will try to match both formatting and stand-alone units interchangably.
|
|
531
|
+
|
|
532
|
+
2. Any sequence of the identical letters is a pattern, unless it is escaped by
|
|
533
|
+
the single quote characters (see below).
|
|
534
|
+
If the sequence is longer than listed in table:
|
|
535
|
+
- for numerical units (`yyyyyyyy`) `parse` will try to match a number
|
|
536
|
+
as wide as the sequence
|
|
537
|
+
- for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.
|
|
538
|
+
These variations are marked with "2" in the last column of the table.
|
|
539
|
+
|
|
540
|
+
3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
|
|
541
|
+
These tokens represent the shortest form of the quarter.
|
|
542
|
+
|
|
543
|
+
4. The main difference between `y` and `u` patterns are B.C. years:
|
|
544
|
+
|
|
545
|
+
| Year | `y` | `u` |
|
|
546
|
+
|------|-----|-----|
|
|
547
|
+
| AC 1 | 1 | 1 |
|
|
548
|
+
| BC 1 | 1 | 0 |
|
|
549
|
+
| BC 2 | 2 | -1 |
|
|
550
|
+
|
|
551
|
+
Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
|
|
552
|
+
|
|
553
|
+
`parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`
|
|
554
|
+
|
|
555
|
+
`parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`
|
|
556
|
+
|
|
557
|
+
while `uu` will just assign the year as is:
|
|
558
|
+
|
|
559
|
+
`parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`
|
|
560
|
+
|
|
561
|
+
`parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`
|
|
562
|
+
|
|
563
|
+
The same difference is true for local and ISO week-numbering years (`Y` and `R`),
|
|
564
|
+
except local week-numbering years are dependent on `options.weekStartsOn`
|
|
565
|
+
and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)
|
|
566
|
+
and [setWeekYear](https://date-fns.org/docs/setWeekYear)).
|
|
567
|
+
|
|
568
|
+
5. These patterns are not in the Unicode Technical Standard #35:
|
|
569
|
+
- `i`: ISO day of week
|
|
570
|
+
- `I`: ISO week of year
|
|
571
|
+
- `R`: ISO week-numbering year
|
|
572
|
+
- `o`: ordinal number modifier
|
|
573
|
+
- `P`: long localized date
|
|
574
|
+
- `p`: long localized time
|
|
575
|
+
|
|
576
|
+
6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
|
|
577
|
+
You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
578
|
+
|
|
579
|
+
7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
|
|
580
|
+
You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
581
|
+
|
|
582
|
+
8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
|
|
583
|
+
on the given locale.
|
|
584
|
+
|
|
585
|
+
using `en-US` locale: `P` => `MM/dd/yyyy`
|
|
586
|
+
using `en-US` locale: `p` => `hh:mm a`
|
|
587
|
+
using `pt-BR` locale: `P` => `dd/MM/yyyy`
|
|
588
|
+
using `pt-BR` locale: `p` => `HH:mm`
|
|
589
|
+
|
|
590
|
+
Values will be assigned to the date in the descending order of its unit's priority.
|
|
591
|
+
Units of an equal priority overwrite each other in the order of appearance.
|
|
592
|
+
|
|
593
|
+
If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),
|
|
594
|
+
the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.
|
|
595
|
+
|
|
596
|
+
`referenceDate` must be passed for correct work of the function.
|
|
597
|
+
If you're not sure which `referenceDate` to supply, create a new instance of Date:
|
|
598
|
+
`parse('02/11/2014', 'MM/dd/yyyy', new Date())`
|
|
599
|
+
In this case parsing will be done in the context of the current date.
|
|
600
|
+
If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,
|
|
601
|
+
then `Invalid Date` will be returned.
|
|
602
|
+
|
|
603
|
+
The result may vary by locale.
|
|
604
|
+
|
|
605
|
+
If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
|
|
606
|
+
|
|
607
|
+
If parsing failed, `Invalid Date` will be returned.
|
|
608
|
+
Invalid Date is a Date, whose time value is NaN.
|
|
609
|
+
Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
610
|
+
|
|
611
|
+
**`Throws`**
|
|
612
|
+
|
|
613
|
+
`options.locale` must contain `match` property
|
|
614
|
+
|
|
615
|
+
**`Throws`**
|
|
616
|
+
|
|
617
|
+
use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
618
|
+
|
|
619
|
+
**`Throws`**
|
|
620
|
+
|
|
621
|
+
use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
622
|
+
|
|
623
|
+
**`Throws`**
|
|
624
|
+
|
|
625
|
+
use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
626
|
+
|
|
627
|
+
**`Throws`**
|
|
628
|
+
|
|
629
|
+
use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
630
|
+
|
|
631
|
+
**`Throws`**
|
|
632
|
+
|
|
633
|
+
format string contains an unescaped latin alphabet character
|
|
634
|
+
|
|
635
|
+
**`Example`**
|
|
636
|
+
|
|
637
|
+
```ts
|
|
638
|
+
// Parse 11 February 2014 from middle-endian format:
|
|
639
|
+
var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())
|
|
640
|
+
//=> Tue Feb 11 2014 00:00:00
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
**`Example`**
|
|
644
|
+
|
|
645
|
+
```ts
|
|
646
|
+
// Parse 28th of February in Esperanto locale in the context of 2010 year:
|
|
647
|
+
import eo from 'date-fns/locale/eo'
|
|
648
|
+
var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), {
|
|
649
|
+
locale: eo
|
|
650
|
+
})
|
|
651
|
+
//=> Sun Feb 28 2010 00:00:00
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
#### Defined in
|
|
655
|
+
|
|
656
|
+
node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse.d.ts:315
|
|
657
|
+
|
|
658
|
+
___
|
|
659
|
+
|
|
660
|
+
### parseISO
|
|
661
|
+
|
|
662
|
+
▸ **parseISO**(`argument`, `options?`): `Date`
|
|
663
|
+
|
|
664
|
+
#### Parameters
|
|
665
|
+
|
|
666
|
+
| Name | Type | Description |
|
|
667
|
+
| :------ | :------ | :------ |
|
|
668
|
+
| `argument` | `string` | The value to convert |
|
|
669
|
+
| `options?` | `ParseISOOptions` | An object with options |
|
|
670
|
+
|
|
671
|
+
#### Returns
|
|
672
|
+
|
|
673
|
+
`Date`
|
|
674
|
+
|
|
675
|
+
The parsed date in the local time zone
|
|
676
|
+
|
|
677
|
+
**`Name`**
|
|
678
|
+
|
|
679
|
+
parseISO
|
|
680
|
+
|
|
681
|
+
**`Summary`**
|
|
682
|
+
|
|
683
|
+
Parse ISO string
|
|
684
|
+
|
|
685
|
+
**`Description`**
|
|
686
|
+
|
|
687
|
+
Parse the given string in ISO 8601 format and return an instance of Date.
|
|
688
|
+
|
|
689
|
+
Function accepts complete ISO 8601 formats as well as partial implementations.
|
|
690
|
+
ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
|
|
691
|
+
|
|
692
|
+
If the argument isn't a string, the function cannot parse the string or
|
|
693
|
+
the values are invalid, it returns Invalid Date.
|
|
694
|
+
|
|
695
|
+
**`Example`**
|
|
696
|
+
|
|
697
|
+
```ts
|
|
698
|
+
// Convert string '2014-02-11T11:30:30' to date:
|
|
699
|
+
const result = parseISO('2014-02-11T11:30:30')
|
|
700
|
+
//=> Tue Feb 11 2014 11:30:30
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
**`Example`**
|
|
704
|
+
|
|
705
|
+
```ts
|
|
706
|
+
// Convert string '+02014101' to date,
|
|
707
|
+
// if the additional number of digits in the extended year format is 1:
|
|
708
|
+
const result = parseISO('+02014101', { additionalDigits: 1 })
|
|
709
|
+
//=> Fri Apr 11 2014 00:00:00
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
#### Defined in
|
|
713
|
+
|
|
714
|
+
node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parseISO.d.ts:40
|
|
715
|
+
|
|
716
|
+
___
|
|
717
|
+
|
|
718
|
+
### toDate
|
|
719
|
+
|
|
720
|
+
▸ **toDate**\<`DateType`\>(`argument`): `DateType`
|
|
721
|
+
|
|
722
|
+
#### Type parameters
|
|
723
|
+
|
|
724
|
+
| Name | Type | Description |
|
|
725
|
+
| :------ | :------ | :------ |
|
|
726
|
+
| `DateType` | extends `Date` | The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc). |
|
|
727
|
+
|
|
728
|
+
#### Parameters
|
|
729
|
+
|
|
730
|
+
| Name | Type | Description |
|
|
731
|
+
| :------ | :------ | :------ |
|
|
732
|
+
| `argument` | `string` \| `number` \| `DateType` | The value to convert |
|
|
733
|
+
|
|
734
|
+
#### Returns
|
|
735
|
+
|
|
736
|
+
`DateType`
|
|
737
|
+
|
|
738
|
+
The parsed date in the local time zone
|
|
739
|
+
|
|
740
|
+
**`Name`**
|
|
741
|
+
|
|
742
|
+
toDate
|
|
743
|
+
|
|
744
|
+
**`Summary`**
|
|
745
|
+
|
|
746
|
+
Convert the given argument to an instance of Date.
|
|
747
|
+
|
|
748
|
+
**`Description`**
|
|
749
|
+
|
|
750
|
+
Convert the given argument to an instance of Date.
|
|
751
|
+
|
|
752
|
+
If the argument is an instance of Date, the function returns its clone.
|
|
753
|
+
|
|
754
|
+
If the argument is a number, it is treated as a timestamp.
|
|
755
|
+
|
|
756
|
+
If the argument is none of the above, the function returns Invalid Date.
|
|
757
|
+
|
|
758
|
+
**Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
759
|
+
|
|
760
|
+
**`Example`**
|
|
761
|
+
|
|
762
|
+
```ts
|
|
763
|
+
// Clone the date:
|
|
764
|
+
const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
765
|
+
//=> Tue Feb 11 2014 11:30:30
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
**`Example`**
|
|
769
|
+
|
|
770
|
+
```ts
|
|
771
|
+
// Convert the timestamp to date:
|
|
772
|
+
const result = toDate(1392098430000)
|
|
773
|
+
//=> Tue Feb 11 2014 11:30:30
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
#### Defined in
|
|
777
|
+
|
|
778
|
+
node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/toDate.d.ts:33
|
|
779
|
+
|
|
780
|
+
## Other
|
|
206
781
|
|
|
207
782
|
### AIChatContentPart
|
|
208
783
|
|
|
@@ -210,7 +785,7 @@
|
|
|
210
785
|
|
|
211
786
|
#### Defined in
|
|
212
787
|
|
|
213
|
-
[packages/ai-tool/src/utils/chat.ts:
|
|
788
|
+
[packages/ai-tool/src/utils/chat.ts:74](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/chat.ts#L74)
|
|
214
789
|
|
|
215
790
|
___
|
|
216
791
|
|
|
@@ -220,7 +795,7 @@ ___
|
|
|
220
795
|
|
|
221
796
|
#### Defined in
|
|
222
797
|
|
|
223
|
-
[packages/ai-tool/src/utils/chat.ts:
|
|
798
|
+
[packages/ai-tool/src/utils/chat.ts:44](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/chat.ts#L44)
|
|
224
799
|
|
|
225
800
|
___
|
|
226
801
|
|
|
@@ -230,7 +805,7 @@ ___
|
|
|
230
805
|
|
|
231
806
|
#### Defined in
|
|
232
807
|
|
|
233
|
-
[packages/ai-tool/src/utils/chat.ts:
|
|
808
|
+
[packages/ai-tool/src/utils/chat.ts:42](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/chat.ts#L42)
|
|
234
809
|
|
|
235
810
|
___
|
|
236
811
|
|
|
@@ -240,7 +815,7 @@ ___
|
|
|
240
815
|
|
|
241
816
|
#### Defined in
|
|
242
817
|
|
|
243
|
-
[packages/ai-tool/src/utils/chat.ts:
|
|
818
|
+
[packages/ai-tool/src/utils/chat.ts:36](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/chat.ts#L36)
|
|
244
819
|
|
|
245
820
|
___
|
|
246
821
|
|
|
@@ -250,7 +825,7 @@ ___
|
|
|
250
825
|
|
|
251
826
|
#### Defined in
|
|
252
827
|
|
|
253
|
-
[packages/ai-tool/src/utils/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/
|
|
828
|
+
[packages/ai-tool/src/utils/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/consts.ts#L10)
|
|
254
829
|
|
|
255
830
|
___
|
|
256
831
|
|
|
@@ -274,7 +849,7 @@ ___
|
|
|
274
849
|
|
|
275
850
|
#### Defined in
|
|
276
851
|
|
|
277
|
-
[packages/ai-tool/src/utils/consts.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
852
|
+
[packages/ai-tool/src/utils/consts.ts:8](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/consts.ts#L8)
|
|
278
853
|
|
|
279
854
|
___
|
|
280
855
|
|
|
@@ -284,7 +859,7 @@ ___
|
|
|
284
859
|
|
|
285
860
|
#### Defined in
|
|
286
861
|
|
|
287
|
-
[packages/ai-tool/src/utils/consts.ts:11](https://github.com/isdk/ai-tool.js/blob/
|
|
862
|
+
[packages/ai-tool/src/utils/consts.ts:11](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/consts.ts#L11)
|
|
288
863
|
|
|
289
864
|
___
|
|
290
865
|
|
|
@@ -294,7 +869,7 @@ ___
|
|
|
294
869
|
|
|
295
870
|
#### Defined in
|
|
296
871
|
|
|
297
|
-
[packages/ai-tool/src/utils/chat.ts:
|
|
872
|
+
[packages/ai-tool/src/utils/chat.ts:13](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/chat.ts#L13)
|
|
298
873
|
|
|
299
874
|
___
|
|
300
875
|
|
|
@@ -304,7 +879,17 @@ ___
|
|
|
304
879
|
|
|
305
880
|
#### Defined in
|
|
306
881
|
|
|
307
|
-
[packages/ai-tool/src/utils/consts.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
882
|
+
[packages/ai-tool/src/utils/consts.ts:6](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/consts.ts#L6)
|
|
883
|
+
|
|
884
|
+
___
|
|
885
|
+
|
|
886
|
+
### AsyncTaskId
|
|
887
|
+
|
|
888
|
+
Ƭ **AsyncTaskId**: `string` \| `number`
|
|
889
|
+
|
|
890
|
+
#### Defined in
|
|
891
|
+
|
|
892
|
+
[packages/ai-tool/src/utils/cancelable-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/cancelable-ability.ts#L8)
|
|
308
893
|
|
|
309
894
|
___
|
|
310
895
|
|
|
@@ -314,7 +899,7 @@ ___
|
|
|
314
899
|
|
|
315
900
|
#### Defined in
|
|
316
901
|
|
|
317
|
-
[packages/ai-tool/src/utils/base-error.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
902
|
+
[packages/ai-tool/src/utils/base-error.ts:3](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/base-error.ts#L3)
|
|
318
903
|
|
|
319
904
|
___
|
|
320
905
|
|
|
@@ -341,7 +926,7 @@ ___
|
|
|
341
926
|
|
|
342
927
|
#### Defined in
|
|
343
928
|
|
|
344
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
929
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:9](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/event/event-ability.ts#L9)
|
|
345
930
|
|
|
346
931
|
___
|
|
347
932
|
|
|
@@ -367,7 +952,7 @@ ___
|
|
|
367
952
|
|
|
368
953
|
#### Defined in
|
|
369
954
|
|
|
370
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
955
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/event/event-ability.ts#L8)
|
|
371
956
|
|
|
372
957
|
___
|
|
373
958
|
|
|
@@ -380,7 +965,7 @@ a literal text or a variable name.
|
|
|
380
965
|
|
|
381
966
|
#### Defined in
|
|
382
967
|
|
|
383
|
-
[packages/ai-tool/src/utils/prompt/template/python.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
968
|
+
[packages/ai-tool/src/utils/prompt/template/python.ts:6](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/template/python.ts#L6)
|
|
384
969
|
|
|
385
970
|
___
|
|
386
971
|
|
|
@@ -390,7 +975,7 @@ ___
|
|
|
390
975
|
|
|
391
976
|
#### Defined in
|
|
392
977
|
|
|
393
|
-
[packages/ai-tool/src/tool-func.ts:
|
|
978
|
+
[packages/ai-tool/src/tool-func.ts:24](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/tool-func.ts#L24)
|
|
394
979
|
|
|
395
980
|
___
|
|
396
981
|
|
|
@@ -406,7 +991,7 @@ ___
|
|
|
406
991
|
|
|
407
992
|
#### Defined in
|
|
408
993
|
|
|
409
|
-
[packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
994
|
+
[packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:3](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/prompt-example-selector.ts#L3)
|
|
410
995
|
|
|
411
996
|
___
|
|
412
997
|
|
|
@@ -416,7 +1001,7 @@ ___
|
|
|
416
1001
|
|
|
417
1002
|
#### Defined in
|
|
418
1003
|
|
|
419
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:17](https://github.com/isdk/ai-tool.js/blob/
|
|
1004
|
+
[packages/ai-tool/src/utils/prompt/consts.ts:17](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/consts.ts#L17)
|
|
420
1005
|
|
|
421
1006
|
___
|
|
422
1007
|
|
|
@@ -426,7 +1011,7 @@ ___
|
|
|
426
1011
|
|
|
427
1012
|
#### Defined in
|
|
428
1013
|
|
|
429
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/
|
|
1014
|
+
[packages/ai-tool/src/utils/prompt/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/consts.ts#L10)
|
|
430
1015
|
|
|
431
1016
|
___
|
|
432
1017
|
|
|
@@ -451,9 +1036,9 @@ ___
|
|
|
451
1036
|
|
|
452
1037
|
#### Defined in
|
|
453
1038
|
|
|
454
|
-
[packages/ai-tool/src/tool-func.ts:
|
|
1039
|
+
[packages/ai-tool/src/tool-func.ts:38](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/tool-func.ts#L38)
|
|
455
1040
|
|
|
456
|
-
|
|
1041
|
+
___
|
|
457
1042
|
|
|
458
1043
|
### AIChatRoles
|
|
459
1044
|
|
|
@@ -461,7 +1046,7 @@ ___
|
|
|
461
1046
|
|
|
462
1047
|
#### Defined in
|
|
463
1048
|
|
|
464
|
-
[packages/ai-tool/src/utils/chat.ts:
|
|
1049
|
+
[packages/ai-tool/src/utils/chat.ts:41](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/chat.ts#L41)
|
|
465
1050
|
|
|
466
1051
|
___
|
|
467
1052
|
|
|
@@ -471,7 +1056,7 @@ ___
|
|
|
471
1056
|
|
|
472
1057
|
#### Defined in
|
|
473
1058
|
|
|
474
|
-
[packages/ai-tool/src/utils/chat.ts:
|
|
1059
|
+
[packages/ai-tool/src/utils/chat.ts:35](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/chat.ts#L35)
|
|
475
1060
|
|
|
476
1061
|
___
|
|
477
1062
|
|
|
@@ -481,7 +1066,7 @@ ___
|
|
|
481
1066
|
|
|
482
1067
|
#### Defined in
|
|
483
1068
|
|
|
484
|
-
[packages/ai-tool/src/utils/chat.ts:
|
|
1069
|
+
[packages/ai-tool/src/utils/chat.ts:4](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/chat.ts#L4)
|
|
485
1070
|
|
|
486
1071
|
___
|
|
487
1072
|
|
|
@@ -491,7 +1076,7 @@ ___
|
|
|
491
1076
|
|
|
492
1077
|
#### Defined in
|
|
493
1078
|
|
|
494
|
-
[packages/ai-tool/src/utils/base-error.ts:
|
|
1079
|
+
[packages/ai-tool/src/utils/base-error.ts:33](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/base-error.ts#L33)
|
|
495
1080
|
|
|
496
1081
|
___
|
|
497
1082
|
|
|
@@ -501,7 +1086,7 @@ ___
|
|
|
501
1086
|
|
|
502
1087
|
#### Defined in
|
|
503
1088
|
|
|
504
|
-
[packages/ai-tool/src/utils/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/
|
|
1089
|
+
[packages/ai-tool/src/utils/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/consts.ts#L5)
|
|
505
1090
|
|
|
506
1091
|
___
|
|
507
1092
|
|
|
@@ -511,7 +1096,7 @@ ___
|
|
|
511
1096
|
|
|
512
1097
|
#### Defined in
|
|
513
1098
|
|
|
514
|
-
[packages/ai-tool/src/utils/base-error.ts:
|
|
1099
|
+
[packages/ai-tool/src/utils/base-error.ts:32](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/base-error.ts#L32)
|
|
515
1100
|
|
|
516
1101
|
___
|
|
517
1102
|
|
|
@@ -539,7 +1124,17 @@ ___
|
|
|
539
1124
|
|
|
540
1125
|
#### Defined in
|
|
541
1126
|
|
|
542
|
-
[packages/ai-tool/src/client-tools.ts:153](https://github.com/isdk/ai-tool.js/blob/
|
|
1127
|
+
[packages/ai-tool/src/client-tools.ts:153](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/client-tools.ts#L153)
|
|
1128
|
+
|
|
1129
|
+
___
|
|
1130
|
+
|
|
1131
|
+
### DefaultAsyncSemaphoreCapacity
|
|
1132
|
+
|
|
1133
|
+
• `Const` **DefaultAsyncSemaphoreCapacity**: ``32``
|
|
1134
|
+
|
|
1135
|
+
#### Defined in
|
|
1136
|
+
|
|
1137
|
+
[packages/ai-tool/src/utils/async-semaphore.ts:6](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/async-semaphore.ts#L6)
|
|
543
1138
|
|
|
544
1139
|
___
|
|
545
1140
|
|
|
@@ -549,7 +1144,7 @@ ___
|
|
|
549
1144
|
|
|
550
1145
|
#### Defined in
|
|
551
1146
|
|
|
552
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:7](https://github.com/isdk/ai-tool.js/blob/
|
|
1147
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:7](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/event/event-ability.ts#L7)
|
|
553
1148
|
|
|
554
1149
|
___
|
|
555
1150
|
|
|
@@ -559,7 +1154,7 @@ ___
|
|
|
559
1154
|
|
|
560
1155
|
#### Defined in
|
|
561
1156
|
|
|
562
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
1157
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:6](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/event/event-ability.ts#L6)
|
|
563
1158
|
|
|
564
1159
|
___
|
|
565
1160
|
|
|
@@ -572,7 +1167,7 @@ do not use /g global option here: when the regex is executed multiple times, it
|
|
|
572
1167
|
|
|
573
1168
|
#### Defined in
|
|
574
1169
|
|
|
575
|
-
[packages/ai-tool/src/utils/filename.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
1170
|
+
[packages/ai-tool/src/utils/filename.ts:8](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/filename.ts#L8)
|
|
576
1171
|
|
|
577
1172
|
___
|
|
578
1173
|
|
|
@@ -589,7 +1184,7 @@ ___
|
|
|
589
1184
|
|
|
590
1185
|
#### Defined in
|
|
591
1186
|
|
|
592
|
-
[packages/ai-tool/src/utils/prompt/template/jinja/src/builtins.ts:52](https://github.com/isdk/ai-tool.js/blob/
|
|
1187
|
+
[packages/ai-tool/src/utils/prompt/template/jinja/src/builtins.ts:52](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/template/jinja/src/builtins.ts#L52)
|
|
593
1188
|
|
|
594
1189
|
___
|
|
595
1190
|
|
|
@@ -599,7 +1194,7 @@ ___
|
|
|
599
1194
|
|
|
600
1195
|
#### Defined in
|
|
601
1196
|
|
|
602
|
-
[packages/ai-tool/src/utils/base-error.ts:
|
|
1197
|
+
[packages/ai-tool/src/utils/base-error.ts:29](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/base-error.ts#L29)
|
|
603
1198
|
|
|
604
1199
|
___
|
|
605
1200
|
|
|
@@ -609,7 +1204,7 @@ ___
|
|
|
609
1204
|
|
|
610
1205
|
#### Defined in
|
|
611
1206
|
|
|
612
|
-
[packages/ai-tool/src/utils/base-error.ts:
|
|
1207
|
+
[packages/ai-tool/src/utils/base-error.ts:31](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/base-error.ts#L31)
|
|
613
1208
|
|
|
614
1209
|
___
|
|
615
1210
|
|
|
@@ -619,7 +1214,7 @@ ___
|
|
|
619
1214
|
|
|
620
1215
|
#### Defined in
|
|
621
1216
|
|
|
622
|
-
[packages/ai-tool/src/utils/base-error.ts:
|
|
1217
|
+
[packages/ai-tool/src/utils/base-error.ts:30](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/base-error.ts#L30)
|
|
623
1218
|
|
|
624
1219
|
___
|
|
625
1220
|
|
|
@@ -629,7 +1224,7 @@ ___
|
|
|
629
1224
|
|
|
630
1225
|
#### Defined in
|
|
631
1226
|
|
|
632
|
-
[packages/ai-tool/src/utils/consts.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
1227
|
+
[packages/ai-tool/src/utils/consts.ts:3](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/consts.ts#L3)
|
|
633
1228
|
|
|
634
1229
|
___
|
|
635
1230
|
|
|
@@ -639,7 +1234,7 @@ ___
|
|
|
639
1234
|
|
|
640
1235
|
#### Defined in
|
|
641
1236
|
|
|
642
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:12](https://github.com/isdk/ai-tool.js/blob/
|
|
1237
|
+
[packages/ai-tool/src/utils/prompt/consts.ts:12](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/consts.ts#L12)
|
|
643
1238
|
|
|
644
1239
|
___
|
|
645
1240
|
|
|
@@ -652,7 +1247,7 @@ defaults to `chat`
|
|
|
652
1247
|
|
|
653
1248
|
#### Defined in
|
|
654
1249
|
|
|
655
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/
|
|
1250
|
+
[packages/ai-tool/src/utils/prompt/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/consts.ts#L5)
|
|
656
1251
|
|
|
657
1252
|
___
|
|
658
1253
|
|
|
@@ -662,7 +1257,7 @@ ___
|
|
|
662
1257
|
|
|
663
1258
|
#### Defined in
|
|
664
1259
|
|
|
665
|
-
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
1260
|
+
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:3](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/stream/error-readable-stream.ts#L3)
|
|
666
1261
|
|
|
667
1262
|
___
|
|
668
1263
|
|
|
@@ -690,7 +1285,7 @@ ___
|
|
|
690
1285
|
|
|
691
1286
|
#### Defined in
|
|
692
1287
|
|
|
693
|
-
[packages/ai-tool/src/utils/consts.ts:13](https://github.com/isdk/ai-tool.js/blob/
|
|
1288
|
+
[packages/ai-tool/src/utils/consts.ts:13](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/consts.ts#L13)
|
|
694
1289
|
|
|
695
1290
|
___
|
|
696
1291
|
|
|
@@ -708,7 +1303,7 @@ ___
|
|
|
708
1303
|
|
|
709
1304
|
#### Defined in
|
|
710
1305
|
|
|
711
|
-
[packages/ai-tool/src/res-client-tools.ts:68](https://github.com/isdk/ai-tool.js/blob/
|
|
1306
|
+
[packages/ai-tool/src/res-client-tools.ts:68](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/res-client-tools.ts#L68)
|
|
712
1307
|
|
|
713
1308
|
___
|
|
714
1309
|
|
|
@@ -725,7 +1320,7 @@ ___
|
|
|
725
1320
|
|
|
726
1321
|
#### Defined in
|
|
727
1322
|
|
|
728
|
-
[packages/ai-tool/src/res-server-tools.ts:77](https://github.com/isdk/ai-tool.js/blob/
|
|
1323
|
+
[packages/ai-tool/src/res-server-tools.ts:77](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/res-server-tools.ts#L77)
|
|
729
1324
|
|
|
730
1325
|
___
|
|
731
1326
|
|
|
@@ -735,7 +1330,7 @@ ___
|
|
|
735
1330
|
|
|
736
1331
|
#### Defined in
|
|
737
1332
|
|
|
738
|
-
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:4](https://github.com/isdk/ai-tool.js/blob/
|
|
1333
|
+
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:4](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/stream/error-readable-stream.ts#L4)
|
|
739
1334
|
|
|
740
1335
|
___
|
|
741
1336
|
|
|
@@ -745,7 +1340,7 @@ ___
|
|
|
745
1340
|
|
|
746
1341
|
#### Defined in
|
|
747
1342
|
|
|
748
|
-
[packages/ai-tool/src/utils/event/sse-channel.ts:17](https://github.com/isdk/ai-tool.js/blob/
|
|
1343
|
+
[packages/ai-tool/src/utils/event/sse-channel.ts:17](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/event/sse-channel.ts#L17)
|
|
749
1344
|
|
|
750
1345
|
___
|
|
751
1346
|
|
|
@@ -773,7 +1368,37 @@ ___
|
|
|
773
1368
|
|
|
774
1369
|
#### Defined in
|
|
775
1370
|
|
|
776
|
-
[packages/ai-tool/src/server-tools.ts:66](https://github.com/isdk/ai-tool.js/blob/
|
|
1371
|
+
[packages/ai-tool/src/server-tools.ts:66](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/server-tools.ts#L66)
|
|
1372
|
+
|
|
1373
|
+
___
|
|
1374
|
+
|
|
1375
|
+
### ToolAsyncCancelableBit
|
|
1376
|
+
|
|
1377
|
+
• `Const` **ToolAsyncCancelableBit**: ``1``
|
|
1378
|
+
|
|
1379
|
+
#### Defined in
|
|
1380
|
+
|
|
1381
|
+
[packages/ai-tool/src/tool-func.ts:8](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/tool-func.ts#L8)
|
|
1382
|
+
|
|
1383
|
+
___
|
|
1384
|
+
|
|
1385
|
+
### ToolAsyncMultiTaskBit
|
|
1386
|
+
|
|
1387
|
+
• `Const` **ToolAsyncMultiTaskBit**: ``0``
|
|
1388
|
+
|
|
1389
|
+
#### Defined in
|
|
1390
|
+
|
|
1391
|
+
[packages/ai-tool/src/tool-func.ts:7](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/tool-func.ts#L7)
|
|
1392
|
+
|
|
1393
|
+
___
|
|
1394
|
+
|
|
1395
|
+
### ToolAsyncPriorityBit
|
|
1396
|
+
|
|
1397
|
+
• `Const` **ToolAsyncPriorityBit**: ``2``
|
|
1398
|
+
|
|
1399
|
+
#### Defined in
|
|
1400
|
+
|
|
1401
|
+
[packages/ai-tool/src/tool-func.ts:9](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/tool-func.ts#L9)
|
|
777
1402
|
|
|
778
1403
|
___
|
|
779
1404
|
|
|
@@ -785,6 +1410,8 @@ ___
|
|
|
785
1410
|
|
|
786
1411
|
| Name | Type |
|
|
787
1412
|
| :------ | :------ |
|
|
1413
|
+
| `asyncFeatures` | \{ `type`: `string` = 'number' } |
|
|
1414
|
+
| `asyncFeatures.type` | `string` |
|
|
788
1415
|
| `depends` | \{ `exported`: `boolean` = false; `type`: `string` = 'object' } |
|
|
789
1416
|
| `depends.exported` | `boolean` |
|
|
790
1417
|
| `depends.type` | `string` |
|
|
@@ -806,7 +1433,7 @@ ___
|
|
|
806
1433
|
|
|
807
1434
|
#### Defined in
|
|
808
1435
|
|
|
809
|
-
[packages/ai-tool/src/tool-func.ts:
|
|
1436
|
+
[packages/ai-tool/src/tool-func.ts:342](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/tool-func.ts#L342)
|
|
810
1437
|
|
|
811
1438
|
___
|
|
812
1439
|
|
|
@@ -818,7 +1445,7 @@ Regular expression pattern for reserved names on Windows systems.
|
|
|
818
1445
|
|
|
819
1446
|
#### Defined in
|
|
820
1447
|
|
|
821
|
-
[packages/ai-tool/src/utils/filename.ts:13](https://github.com/isdk/ai-tool.js/blob/
|
|
1448
|
+
[packages/ai-tool/src/utils/filename.ts:13](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/filename.ts#L13)
|
|
822
1449
|
|
|
823
1450
|
___
|
|
824
1451
|
|
|
@@ -828,7 +1455,7 @@ ___
|
|
|
828
1455
|
|
|
829
1456
|
#### Defined in
|
|
830
1457
|
|
|
831
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:5](https://github.com/isdk/ai-tool.js/blob/
|
|
1458
|
+
[packages/ai-tool/src/utils/hash/xxhash.ts:5](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/hash/xxhash.ts#L5)
|
|
832
1459
|
|
|
833
1460
|
___
|
|
834
1461
|
|
|
@@ -838,7 +1465,7 @@ ___
|
|
|
838
1465
|
|
|
839
1466
|
#### Defined in
|
|
840
1467
|
|
|
841
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
1468
|
+
[packages/ai-tool/src/utils/prompt/prompt-template.ts:8](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/prompt-template.ts#L8)
|
|
842
1469
|
|
|
843
1470
|
___
|
|
844
1471
|
|
|
@@ -848,7 +1475,7 @@ ___
|
|
|
848
1475
|
|
|
849
1476
|
#### Defined in
|
|
850
1477
|
|
|
851
|
-
[packages/ai-tool/src/funcs/event.ts:22](https://github.com/isdk/ai-tool.js/blob/
|
|
1478
|
+
[packages/ai-tool/src/funcs/event.ts:22](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/funcs/event.ts#L22)
|
|
852
1479
|
|
|
853
1480
|
___
|
|
854
1481
|
|
|
@@ -858,7 +1485,7 @@ ___
|
|
|
858
1485
|
|
|
859
1486
|
#### Defined in
|
|
860
1487
|
|
|
861
|
-
[packages/ai-tool/src/funcs/event-client.ts:180](https://github.com/isdk/ai-tool.js/blob/
|
|
1488
|
+
[packages/ai-tool/src/funcs/event-client.ts:180](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/funcs/event-client.ts#L180)
|
|
862
1489
|
|
|
863
1490
|
___
|
|
864
1491
|
|
|
@@ -868,7 +1495,7 @@ ___
|
|
|
868
1495
|
|
|
869
1496
|
#### Defined in
|
|
870
1497
|
|
|
871
|
-
[packages/ai-tool/src/funcs/event-server.ts:133](https://github.com/isdk/ai-tool.js/blob/
|
|
1498
|
+
[packages/ai-tool/src/funcs/event-server.ts:133](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/funcs/event-server.ts#L133)
|
|
872
1499
|
|
|
873
1500
|
___
|
|
874
1501
|
|
|
@@ -878,7 +1505,7 @@ ___
|
|
|
878
1505
|
|
|
879
1506
|
#### Defined in
|
|
880
1507
|
|
|
881
|
-
[packages/ai-tool/src/funcs/lrucache.ts:40](https://github.com/isdk/ai-tool.js/blob/
|
|
1508
|
+
[packages/ai-tool/src/funcs/lrucache.ts:40](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/funcs/lrucache.ts#L40)
|
|
882
1509
|
|
|
883
1510
|
___
|
|
884
1511
|
|
|
@@ -900,7 +1527,7 @@ ___
|
|
|
900
1527
|
|
|
901
1528
|
node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:78
|
|
902
1529
|
|
|
903
|
-
|
|
1530
|
+
___
|
|
904
1531
|
|
|
905
1532
|
### AIStream
|
|
906
1533
|
|
|
@@ -943,7 +1570,38 @@ Will throw an error if the response is not OK.
|
|
|
943
1570
|
|
|
944
1571
|
#### Defined in
|
|
945
1572
|
|
|
946
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:
|
|
1573
|
+
[packages/ai-tool/src/utils/stream/ai-stream.ts:122](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/stream/ai-stream.ts#L122)
|
|
1574
|
+
|
|
1575
|
+
___
|
|
1576
|
+
|
|
1577
|
+
### RateLimit
|
|
1578
|
+
|
|
1579
|
+
▸ **RateLimit**(`rps`, `«destructured»?`): () => `Promise`\<`void`\>
|
|
1580
|
+
|
|
1581
|
+
Creates a rate limiter function that blocks with a promise whenever the rate limit is hit and resolves the promise once the call rate is within the limit set by rps. The second argument is optional.
|
|
1582
|
+
|
|
1583
|
+
#### Parameters
|
|
1584
|
+
|
|
1585
|
+
| Name | Type | Default value |
|
|
1586
|
+
| :------ | :------ | :------ |
|
|
1587
|
+
| `rps` | `number` | `undefined` |
|
|
1588
|
+
| `«destructured»` | `Object` | `{}` |
|
|
1589
|
+
| › `timeUnit?` | `number` | `1000` |
|
|
1590
|
+
| › `uniformDistribution?` | `boolean` | `false` |
|
|
1591
|
+
|
|
1592
|
+
#### Returns
|
|
1593
|
+
|
|
1594
|
+
`fn`
|
|
1595
|
+
|
|
1596
|
+
▸ (): `Promise`\<`void`\>
|
|
1597
|
+
|
|
1598
|
+
##### Returns
|
|
1599
|
+
|
|
1600
|
+
`Promise`\<`void`\>
|
|
1601
|
+
|
|
1602
|
+
#### Defined in
|
|
1603
|
+
|
|
1604
|
+
[packages/ai-tool/src/utils/async-semaphore.ts:347](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/async-semaphore.ts#L347)
|
|
947
1605
|
|
|
948
1606
|
___
|
|
949
1607
|
|
|
@@ -967,19 +1625,19 @@ ___
|
|
|
967
1625
|
|
|
968
1626
|
#### Defined in
|
|
969
1627
|
|
|
970
|
-
[packages/ai-tool/src/funcs/lrucache.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
1628
|
+
[packages/ai-tool/src/funcs/lrucache.ts:6](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/funcs/lrucache.ts#L6)
|
|
971
1629
|
|
|
972
1630
|
___
|
|
973
1631
|
|
|
974
1632
|
### backendEventable
|
|
975
1633
|
|
|
976
|
-
▸ **backendEventable**(`targetClass
|
|
1634
|
+
▸ **backendEventable**(`targetClass?`, `options?`): `Function`
|
|
977
1635
|
|
|
978
1636
|
#### Parameters
|
|
979
1637
|
|
|
980
1638
|
| Name | Type |
|
|
981
1639
|
| :------ | :------ |
|
|
982
|
-
| `targetClass
|
|
1640
|
+
| `targetClass?` | `Function` |
|
|
983
1641
|
| `options?` | `AbilityOptions` |
|
|
984
1642
|
|
|
985
1643
|
#### Returns
|
|
@@ -988,7 +1646,7 @@ ___
|
|
|
988
1646
|
|
|
989
1647
|
#### Defined in
|
|
990
1648
|
|
|
991
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:80](https://github.com/isdk/ai-tool.js/blob/
|
|
1649
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:80](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/event/event-ability.ts#L80)
|
|
992
1650
|
|
|
993
1651
|
___
|
|
994
1652
|
|
|
@@ -1033,28 +1691,111 @@ node_modules/.pnpm/json-canonicalize@1.0.6/node_modules/json-canonicalize/types/
|
|
|
1033
1691
|
|
|
1034
1692
|
___
|
|
1035
1693
|
|
|
1694
|
+
### createAbilityInjector
|
|
1695
|
+
|
|
1696
|
+
▸ **createAbilityInjector**(`abilityClass`, `isGetClassFunc?`, `injectorOpts?`): `AbilityFn`
|
|
1697
|
+
|
|
1698
|
+
#### Parameters
|
|
1699
|
+
|
|
1700
|
+
| Name | Type |
|
|
1701
|
+
| :------ | :------ |
|
|
1702
|
+
| `abilityClass` | `Function` |
|
|
1703
|
+
| `isGetClassFunc?` | `boolean` |
|
|
1704
|
+
| `injectorOpts?` | `AbilityInjectorOptions` |
|
|
1705
|
+
|
|
1706
|
+
#### Returns
|
|
1707
|
+
|
|
1708
|
+
`AbilityFn`
|
|
1709
|
+
|
|
1710
|
+
#### Defined in
|
|
1711
|
+
|
|
1712
|
+
node_modules/.pnpm/custom-ability@2.0.0-alpha.7/node_modules/custom-ability/lib/custom-ability.d.ts:29
|
|
1713
|
+
|
|
1714
|
+
▸ **createAbilityInjector**(`abilityClass`, `aCoreMethod?`, `isGetClassFunc?`, `injectorOpts?`): `AbilityFn`
|
|
1715
|
+
|
|
1716
|
+
#### Parameters
|
|
1717
|
+
|
|
1718
|
+
| Name | Type |
|
|
1719
|
+
| :------ | :------ |
|
|
1720
|
+
| `abilityClass` | `Function` |
|
|
1721
|
+
| `aCoreMethod?` | `string` \| `string`[] |
|
|
1722
|
+
| `isGetClassFunc?` | `boolean` |
|
|
1723
|
+
| `injectorOpts?` | `AbilityInjectorOptions` |
|
|
1724
|
+
|
|
1725
|
+
#### Returns
|
|
1726
|
+
|
|
1727
|
+
`AbilityFn`
|
|
1728
|
+
|
|
1729
|
+
#### Defined in
|
|
1730
|
+
|
|
1731
|
+
node_modules/.pnpm/custom-ability@2.0.0-alpha.7/node_modules/custom-ability/lib/custom-ability.d.ts:30
|
|
1732
|
+
|
|
1733
|
+
▸ **createAbilityInjector**(`abilityClass`, `aCoreMethod?`, `injectorOpts?`): `AbilityFn`
|
|
1734
|
+
|
|
1735
|
+
#### Parameters
|
|
1736
|
+
|
|
1737
|
+
| Name | Type |
|
|
1738
|
+
| :------ | :------ |
|
|
1739
|
+
| `abilityClass` | `Function` |
|
|
1740
|
+
| `aCoreMethod?` | `string` \| `string`[] |
|
|
1741
|
+
| `injectorOpts?` | `AbilityInjectorOptions` |
|
|
1742
|
+
|
|
1743
|
+
#### Returns
|
|
1744
|
+
|
|
1745
|
+
`AbilityFn`
|
|
1746
|
+
|
|
1747
|
+
#### Defined in
|
|
1748
|
+
|
|
1749
|
+
node_modules/.pnpm/custom-ability@2.0.0-alpha.7/node_modules/custom-ability/lib/custom-ability.d.ts:31
|
|
1750
|
+
|
|
1751
|
+
▸ **createAbilityInjector**(`abilityClass`, `injectorOpts?`): `AbilityFn`
|
|
1752
|
+
|
|
1753
|
+
#### Parameters
|
|
1754
|
+
|
|
1755
|
+
| Name | Type |
|
|
1756
|
+
| :------ | :------ |
|
|
1757
|
+
| `abilityClass` | `Function` |
|
|
1758
|
+
| `injectorOpts?` | `AbilityInjectorOptions` |
|
|
1759
|
+
|
|
1760
|
+
#### Returns
|
|
1761
|
+
|
|
1762
|
+
`AbilityFn`
|
|
1763
|
+
|
|
1764
|
+
#### Defined in
|
|
1765
|
+
|
|
1766
|
+
node_modules/.pnpm/custom-ability@2.0.0-alpha.7/node_modules/custom-ability/lib/custom-ability.d.ts:32
|
|
1767
|
+
|
|
1768
|
+
___
|
|
1769
|
+
|
|
1036
1770
|
### createCallbacksTransformer
|
|
1037
1771
|
|
|
1038
|
-
▸ **createCallbacksTransformer
|
|
1772
|
+
▸ **createCallbacksTransformer**\<`I`, `O`\>(`cb`): `TransformStream`\<`I`, `O`\>
|
|
1039
1773
|
|
|
1040
|
-
Creates a transform stream that
|
|
1774
|
+
Creates a transform stream that invokes optional callback functions.
|
|
1041
1775
|
The transform stream uses the provided callbacks to execute custom logic at different stages of the stream's lifecycle.
|
|
1042
1776
|
- `onStart`: Called once when the stream is initialized.
|
|
1043
|
-
- `
|
|
1777
|
+
- `onTransform`: Called for each tokenized message.
|
|
1044
1778
|
- `onCompletion`: Called every time an AIStream completion message is received. This can occur multiple times when using e.g. OpenAI functions
|
|
1045
1779
|
- `onFinal`: Called once when the stream is closed with the final completion message.
|
|
1046
1780
|
|
|
1047
1781
|
This function is useful when you want to process a stream of messages and perform specific actions during the stream's lifecycle.
|
|
1048
1782
|
|
|
1783
|
+
#### Type parameters
|
|
1784
|
+
|
|
1785
|
+
| Name | Type |
|
|
1786
|
+
| :------ | :------ |
|
|
1787
|
+
| `I` | `any` |
|
|
1788
|
+
| `O` | `any` |
|
|
1789
|
+
|
|
1049
1790
|
#### Parameters
|
|
1050
1791
|
|
|
1051
1792
|
| Name | Type |
|
|
1052
1793
|
| :------ | :------ |
|
|
1053
|
-
| `cb` | `undefined` \| [`
|
|
1794
|
+
| `cb` | `undefined` \| [`StreamCallbacksAndOptions`](interfaces/StreamCallbacksAndOptions.md)\<`I`, `O`\> |
|
|
1054
1795
|
|
|
1055
1796
|
#### Returns
|
|
1056
1797
|
|
|
1057
|
-
`TransformStream
|
|
1798
|
+
`TransformStream`\<`I`, `O`\>
|
|
1058
1799
|
|
|
1059
1800
|
A transform stream that encodes input messages as Uint8Array and allows the execution of custom logic through callbacks.
|
|
1060
1801
|
|
|
@@ -1063,8 +1804,7 @@ A transform stream that encodes input messages as Uint8Array and allows the exec
|
|
|
1063
1804
|
```ts
|
|
1064
1805
|
const callbacks = {
|
|
1065
1806
|
onStart: async () => console.log('Stream started'),
|
|
1066
|
-
|
|
1067
|
-
onCompletion: async (completion) => console.log(`Completion: ${completion}`)
|
|
1807
|
+
onTransform: async (chunk) => console.log('Token:',chunk),
|
|
1068
1808
|
onFinal: async () => data.close()
|
|
1069
1809
|
};
|
|
1070
1810
|
const transformer = createCallbacksTransformer(callbacks);
|
|
@@ -1072,7 +1812,7 @@ const transformer = createCallbacksTransformer(callbacks);
|
|
|
1072
1812
|
|
|
1073
1813
|
#### Defined in
|
|
1074
1814
|
|
|
1075
|
-
[packages/ai-tool/src/utils/stream/
|
|
1815
|
+
[packages/ai-tool/src/utils/stream/create-callbacks-stream.ts:36](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/stream/create-callbacks-stream.ts#L36)
|
|
1076
1816
|
|
|
1077
1817
|
___
|
|
1078
1818
|
|
|
@@ -1092,13 +1832,13 @@ An empty and closed ReadableStream instance.
|
|
|
1092
1832
|
|
|
1093
1833
|
#### Defined in
|
|
1094
1834
|
|
|
1095
|
-
[packages/ai-tool/src/utils/stream/create-empty-stream.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
1835
|
+
[packages/ai-tool/src/utils/stream/create-empty-stream.ts:8](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/stream/create-empty-stream.ts#L8)
|
|
1096
1836
|
|
|
1097
1837
|
___
|
|
1098
1838
|
|
|
1099
1839
|
### createEndWithRepetitionDetector
|
|
1100
1840
|
|
|
1101
|
-
▸ **createEndWithRepetitionDetector**(`repetitionThreshold`): (`value`: `string`) => `
|
|
1841
|
+
▸ **createEndWithRepetitionDetector**(`repetitionThreshold`): (`value`: `string`) => ``null`` \| `RegExpExecArray`
|
|
1102
1842
|
|
|
1103
1843
|
#### Parameters
|
|
1104
1844
|
|
|
@@ -1110,7 +1850,7 @@ ___
|
|
|
1110
1850
|
|
|
1111
1851
|
`fn`
|
|
1112
1852
|
|
|
1113
|
-
▸ (`value`): `
|
|
1853
|
+
▸ (`value`): ``null`` \| `RegExpExecArray`
|
|
1114
1854
|
|
|
1115
1855
|
##### Parameters
|
|
1116
1856
|
|
|
@@ -1120,11 +1860,11 @@ ___
|
|
|
1120
1860
|
|
|
1121
1861
|
##### Returns
|
|
1122
1862
|
|
|
1123
|
-
`
|
|
1863
|
+
``null`` \| `RegExpExecArray`
|
|
1124
1864
|
|
|
1125
1865
|
#### Defined in
|
|
1126
1866
|
|
|
1127
|
-
[packages/ai-tool/src/utils/end-with-repeated-sequence.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
1867
|
+
[packages/ai-tool/src/utils/end-with-repeated-sequence.ts:3](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/end-with-repeated-sequence.ts#L3)
|
|
1128
1868
|
|
|
1129
1869
|
___
|
|
1130
1870
|
|
|
@@ -1150,7 +1890,7 @@ Error object
|
|
|
1150
1890
|
|
|
1151
1891
|
#### Defined in
|
|
1152
1892
|
|
|
1153
|
-
[packages/ai-tool/src/utils/base-error.ts:
|
|
1893
|
+
[packages/ai-tool/src/utils/base-error.ts:220](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/base-error.ts#L220)
|
|
1154
1894
|
|
|
1155
1895
|
___
|
|
1156
1896
|
|
|
@@ -1181,7 +1921,7 @@ TransformStream parsing events.
|
|
|
1181
1921
|
|
|
1182
1922
|
#### Defined in
|
|
1183
1923
|
|
|
1184
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:
|
|
1924
|
+
[packages/ai-tool/src/utils/stream/ai-stream.ts:37](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/stream/ai-stream.ts#L37)
|
|
1185
1925
|
|
|
1186
1926
|
___
|
|
1187
1927
|
|
|
@@ -1213,7 +1953,7 @@ ___
|
|
|
1213
1953
|
|
|
1214
1954
|
#### Defined in
|
|
1215
1955
|
|
|
1216
|
-
[packages/ai-tool/src/utils/prompt/hf-prompt-template.ts:148](https://github.com/isdk/ai-tool.js/blob/
|
|
1956
|
+
[packages/ai-tool/src/utils/prompt/hf-prompt-template.ts:148](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/hf-prompt-template.ts#L148)
|
|
1217
1957
|
|
|
1218
1958
|
___
|
|
1219
1959
|
|
|
@@ -1234,7 +1974,28 @@ ___
|
|
|
1234
1974
|
|
|
1235
1975
|
#### Defined in
|
|
1236
1976
|
|
|
1237
|
-
[packages/ai-tool/src/funcs/lrucache.ts:22](https://github.com/isdk/ai-tool.js/blob/
|
|
1977
|
+
[packages/ai-tool/src/funcs/lrucache.ts:22](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/funcs/lrucache.ts#L22)
|
|
1978
|
+
|
|
1979
|
+
___
|
|
1980
|
+
|
|
1981
|
+
### dateToText
|
|
1982
|
+
|
|
1983
|
+
▸ **dateToText**(`date`, `format?`): `string`
|
|
1984
|
+
|
|
1985
|
+
#### Parameters
|
|
1986
|
+
|
|
1987
|
+
| Name | Type | Default value |
|
|
1988
|
+
| :------ | :------ | :------ |
|
|
1989
|
+
| `date` | `Date` | `undefined` |
|
|
1990
|
+
| `format` | `string` | `FormatDateStr` |
|
|
1991
|
+
|
|
1992
|
+
#### Returns
|
|
1993
|
+
|
|
1994
|
+
`string`
|
|
1995
|
+
|
|
1996
|
+
#### Defined in
|
|
1997
|
+
|
|
1998
|
+
[packages/ai-tool/src/utils/to-datetime.ts:29](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/to-datetime.ts#L29)
|
|
1238
1999
|
|
|
1239
2000
|
___
|
|
1240
2001
|
|
|
@@ -1273,7 +2034,7 @@ console.log(process.env.HELLO) // undefined
|
|
|
1273
2034
|
|
|
1274
2035
|
#### Defined in
|
|
1275
2036
|
|
|
1276
|
-
[packages/ai-tool/src/utils/prompt/template/env.ts:82](https://github.com/isdk/ai-tool.js/blob/
|
|
2037
|
+
[packages/ai-tool/src/utils/prompt/template/env.ts:82](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/template/env.ts#L82)
|
|
1277
2038
|
|
|
1278
2039
|
___
|
|
1279
2040
|
|
|
@@ -1317,7 +2078,7 @@ const expandedObj = expandObjEnv(obj, { processEnv: myCustomEnv }); // Assuming
|
|
|
1317
2078
|
|
|
1318
2079
|
#### Defined in
|
|
1319
2080
|
|
|
1320
|
-
[packages/ai-tool/src/utils/prompt/template/env.ts:142](https://github.com/isdk/ai-tool.js/blob/
|
|
2081
|
+
[packages/ai-tool/src/utils/prompt/template/env.ts:142](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/template/env.ts#L142)
|
|
1321
2082
|
|
|
1322
2083
|
___
|
|
1323
2084
|
|
|
@@ -1357,7 +2118,7 @@ extNameLevel(".json5");
|
|
|
1357
2118
|
|
|
1358
2119
|
#### Defined in
|
|
1359
2120
|
|
|
1360
|
-
[packages/ai-tool/src/utils/filename.ts:209](https://github.com/isdk/ai-tool.js/blob/
|
|
2121
|
+
[packages/ai-tool/src/utils/filename.ts:209](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/filename.ts#L209)
|
|
1361
2122
|
|
|
1362
2123
|
___
|
|
1363
2124
|
|
|
@@ -1376,7 +2137,7 @@ A compiled regular expression for reserved filename characters.
|
|
|
1376
2137
|
|
|
1377
2138
|
#### Defined in
|
|
1378
2139
|
|
|
1379
|
-
[packages/ai-tool/src/utils/filename.ts:42](https://github.com/isdk/ai-tool.js/blob/
|
|
2140
|
+
[packages/ai-tool/src/utils/filename.ts:42](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/filename.ts#L42)
|
|
1380
2141
|
|
|
1381
2142
|
___
|
|
1382
2143
|
|
|
@@ -1406,7 +2167,7 @@ An array containing all string keys of the specified enumeration.
|
|
|
1406
2167
|
|
|
1407
2168
|
#### Defined in
|
|
1408
2169
|
|
|
1409
|
-
[packages/ai-tool/src/utils/get-all-enum-keys.ts:7](https://github.com/isdk/ai-tool.js/blob/
|
|
2170
|
+
[packages/ai-tool/src/utils/get-all-enum-keys.ts:7](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/get-all-enum-keys.ts#L7)
|
|
1410
2171
|
|
|
1411
2172
|
___
|
|
1412
2173
|
|
|
@@ -1427,7 +2188,7 @@ ___
|
|
|
1427
2188
|
|
|
1428
2189
|
#### Defined in
|
|
1429
2190
|
|
|
1430
|
-
[packages/ai-tool/src/utils/config.ts:56](https://github.com/isdk/ai-tool.js/blob/
|
|
2191
|
+
[packages/ai-tool/src/utils/config.ts:56](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/config.ts#L56)
|
|
1431
2192
|
|
|
1432
2193
|
___
|
|
1433
2194
|
|
|
@@ -1448,7 +2209,7 @@ ___
|
|
|
1448
2209
|
|
|
1449
2210
|
#### Defined in
|
|
1450
2211
|
|
|
1451
|
-
[packages/ai-tool/src/utils/config.ts:80](https://github.com/isdk/ai-tool.js/blob/
|
|
2212
|
+
[packages/ai-tool/src/utils/config.ts:80](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/config.ts#L80)
|
|
1452
2213
|
|
|
1453
2214
|
___
|
|
1454
2215
|
|
|
@@ -1485,7 +2246,7 @@ console.log(getKeysPath(obj)); // Output: ['a.b.c', 'd[0]', 'd[1].e']
|
|
|
1485
2246
|
|
|
1486
2247
|
#### Defined in
|
|
1487
2248
|
|
|
1488
|
-
[packages/ai-tool/src/utils/get-keys-path.ts:16](https://github.com/isdk/ai-tool.js/blob/
|
|
2249
|
+
[packages/ai-tool/src/utils/get-keys-path.ts:16](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/get-keys-path.ts#L16)
|
|
1489
2250
|
|
|
1490
2251
|
___
|
|
1491
2252
|
|
|
@@ -1510,7 +2271,38 @@ Returns a concatenated string of multiple extensions, or an empty string if no e
|
|
|
1510
2271
|
|
|
1511
2272
|
#### Defined in
|
|
1512
2273
|
|
|
1513
|
-
[packages/ai-tool/src/utils/filename.ts:174](https://github.com/isdk/ai-tool.js/blob/
|
|
2274
|
+
[packages/ai-tool/src/utils/filename.ts:174](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/filename.ts#L174)
|
|
2275
|
+
|
|
2276
|
+
___
|
|
2277
|
+
|
|
2278
|
+
### getRealFilepath
|
|
2279
|
+
|
|
2280
|
+
▸ **getRealFilepath**(`filepath`): `string`
|
|
2281
|
+
|
|
2282
|
+
Resolves the real file path, handling symbolic links.
|
|
2283
|
+
|
|
2284
|
+
#### Parameters
|
|
2285
|
+
|
|
2286
|
+
| Name | Type | Description |
|
|
2287
|
+
| :------ | :------ | :------ |
|
|
2288
|
+
| `filepath` | `string` | The file path to resolve. |
|
|
2289
|
+
|
|
2290
|
+
#### Returns
|
|
2291
|
+
|
|
2292
|
+
`string`
|
|
2293
|
+
|
|
2294
|
+
The real file path.
|
|
2295
|
+
|
|
2296
|
+
**`Example`**
|
|
2297
|
+
|
|
2298
|
+
```typescript
|
|
2299
|
+
const realPath = getRealFilepath('/path/to/symbolic/link');
|
|
2300
|
+
console.log(realPath); // Outputs the resolved path.
|
|
2301
|
+
```
|
|
2302
|
+
|
|
2303
|
+
#### Defined in
|
|
2304
|
+
|
|
2305
|
+
[packages/ai-tool/src/utils/load-file-from-paths.ts:141](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/load-file-from-paths.ts#L141)
|
|
1514
2306
|
|
|
1515
2307
|
___
|
|
1516
2308
|
|
|
@@ -1530,7 +2322,7 @@ ___
|
|
|
1530
2322
|
|
|
1531
2323
|
#### Defined in
|
|
1532
2324
|
|
|
1533
|
-
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:12](https://github.com/isdk/ai-tool.js/blob/
|
|
2325
|
+
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:12](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/stream/error-readable-stream.ts#L12)
|
|
1534
2326
|
|
|
1535
2327
|
___
|
|
1536
2328
|
|
|
@@ -1553,7 +2345,7 @@ Operator precedence can be found here: https://developer.mozilla.org/en-US/docs/
|
|
|
1553
2345
|
|
|
1554
2346
|
#### Defined in
|
|
1555
2347
|
|
|
1556
|
-
[packages/ai-tool/src/utils/prompt/template/jinja/src/parser.ts:30](https://github.com/isdk/ai-tool.js/blob/
|
|
2348
|
+
[packages/ai-tool/src/utils/prompt/template/jinja/src/parser.ts:30](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/template/jinja/src/parser.ts#L30)
|
|
1557
2349
|
|
|
1558
2350
|
___
|
|
1559
2351
|
|
|
@@ -1576,7 +2368,7 @@ Generate a list of tokens from a source string.
|
|
|
1576
2368
|
|
|
1577
2369
|
#### Defined in
|
|
1578
2370
|
|
|
1579
|
-
[packages/ai-tool/src/utils/prompt/template/jinja/src/lexer.ts:189](https://github.com/isdk/ai-tool.js/blob/
|
|
2371
|
+
[packages/ai-tool/src/utils/prompt/template/jinja/src/lexer.ts:189](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/template/jinja/src/lexer.ts#L189)
|
|
1580
2372
|
|
|
1581
2373
|
___
|
|
1582
2374
|
|
|
@@ -1598,7 +2390,7 @@ ___
|
|
|
1598
2390
|
|
|
1599
2391
|
#### Defined in
|
|
1600
2392
|
|
|
1601
|
-
[packages/ai-tool/src/utils/prompt/template/env.ts:17](https://github.com/isdk/ai-tool.js/blob/
|
|
2393
|
+
[packages/ai-tool/src/utils/prompt/template/env.ts:17](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/template/env.ts#L17)
|
|
1602
2394
|
|
|
1603
2395
|
___
|
|
1604
2396
|
|
|
@@ -1623,7 +2415,7 @@ template have been replaced with their corresponding values.
|
|
|
1623
2415
|
|
|
1624
2416
|
#### Defined in
|
|
1625
2417
|
|
|
1626
|
-
[packages/ai-tool/src/utils/prompt/template/python.ts:71](https://github.com/isdk/ai-tool.js/blob/
|
|
2418
|
+
[packages/ai-tool/src/utils/prompt/template/python.ts:71](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/template/python.ts#L71)
|
|
1627
2419
|
|
|
1628
2420
|
___
|
|
1629
2421
|
|
|
@@ -1647,7 +2439,7 @@ Parse and interpolate template
|
|
|
1647
2439
|
|
|
1648
2440
|
#### Defined in
|
|
1649
2441
|
|
|
1650
|
-
[packages/ai-tool/src/utils/prompt/template/golang.ts:269](https://github.com/isdk/ai-tool.js/blob/
|
|
2442
|
+
[packages/ai-tool/src/utils/prompt/template/golang.ts:269](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/template/golang.ts#L269)
|
|
1651
2443
|
|
|
1652
2444
|
___
|
|
1653
2445
|
|
|
@@ -1686,7 +2478,7 @@ IsModelNameMatched("gpt-2", (modelName) => modelName.startsWith("gpt-")) // retu
|
|
|
1686
2478
|
|
|
1687
2479
|
#### Defined in
|
|
1688
2480
|
|
|
1689
|
-
[packages/ai-tool/src/utils/is-model-name-matched.ts:21](https://github.com/isdk/ai-tool.js/blob/
|
|
2481
|
+
[packages/ai-tool/src/utils/is-model-name-matched.ts:21](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/is-model-name-matched.ts#L21)
|
|
1690
2482
|
|
|
1691
2483
|
___
|
|
1692
2484
|
|
|
@@ -1721,7 +2513,7 @@ isValidFilename('my<file.txt'); // Returns false
|
|
|
1721
2513
|
|
|
1722
2514
|
#### Defined in
|
|
1723
2515
|
|
|
1724
|
-
[packages/ai-tool/src/utils/filename.ts:63](https://github.com/isdk/ai-tool.js/blob/
|
|
2516
|
+
[packages/ai-tool/src/utils/filename.ts:63](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/filename.ts#L63)
|
|
1725
2517
|
|
|
1726
2518
|
___
|
|
1727
2519
|
|
|
@@ -1745,7 +2537,27 @@ A boolean indicating whether the filepath is valid. Returns true if valid; false
|
|
|
1745
2537
|
|
|
1746
2538
|
#### Defined in
|
|
1747
2539
|
|
|
1748
|
-
[packages/ai-tool/src/utils/filename.ts:72](https://github.com/isdk/ai-tool.js/blob/
|
|
2540
|
+
[packages/ai-tool/src/utils/filename.ts:72](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/filename.ts#L72)
|
|
2541
|
+
|
|
2542
|
+
___
|
|
2543
|
+
|
|
2544
|
+
### isWebStream
|
|
2545
|
+
|
|
2546
|
+
▸ **isWebStream**(`val`): `boolean`
|
|
2547
|
+
|
|
2548
|
+
#### Parameters
|
|
2549
|
+
|
|
2550
|
+
| Name | Type |
|
|
2551
|
+
| :------ | :------ |
|
|
2552
|
+
| `val` | `any` |
|
|
2553
|
+
|
|
2554
|
+
#### Returns
|
|
2555
|
+
|
|
2556
|
+
`boolean`
|
|
2557
|
+
|
|
2558
|
+
#### Defined in
|
|
2559
|
+
|
|
2560
|
+
[packages/ai-tool/src/utils/stream/is-web-stream.ts:1](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/stream/is-web-stream.ts#L1)
|
|
1749
2561
|
|
|
1750
2562
|
___
|
|
1751
2563
|
|
|
@@ -1786,7 +2598,32 @@ console.log(jsonFilterToWhere(jsonFilter)); // Outputs a WHERE clause based on t
|
|
|
1786
2598
|
|
|
1787
2599
|
#### Defined in
|
|
1788
2600
|
|
|
1789
|
-
[packages/ai-tool/src/utils/json-filter.ts:
|
|
2601
|
+
[packages/ai-tool/src/utils/json-filter.ts:123](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/json-filter.ts#L123)
|
|
2602
|
+
|
|
2603
|
+
___
|
|
2604
|
+
|
|
2605
|
+
### jsonToMarkdownStr
|
|
2606
|
+
|
|
2607
|
+
▸ **jsonToMarkdownStr**(`mem`, `options?`): `string`
|
|
2608
|
+
|
|
2609
|
+
#### Parameters
|
|
2610
|
+
|
|
2611
|
+
| Name | Type |
|
|
2612
|
+
| :------ | :------ |
|
|
2613
|
+
| `mem` | `any` |
|
|
2614
|
+
| `options?` | `Object` |
|
|
2615
|
+
| `options.arrayTag?` | `string` |
|
|
2616
|
+
| `options.level?` | `number` |
|
|
2617
|
+
| `options.objectTag?` | `string` |
|
|
2618
|
+
| `options.visiting?` | `Set`\<`any`\> |
|
|
2619
|
+
|
|
2620
|
+
#### Returns
|
|
2621
|
+
|
|
2622
|
+
`string`
|
|
2623
|
+
|
|
2624
|
+
#### Defined in
|
|
2625
|
+
|
|
2626
|
+
[packages/ai-tool/src/utils/json-to-markdown-str.ts:2](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/json-to-markdown-str.ts#L2)
|
|
1790
2627
|
|
|
1791
2628
|
___
|
|
1792
2629
|
|
|
@@ -1804,6 +2641,7 @@ Loads a file from given paths, optionally searching for specific extensions.
|
|
|
1804
2641
|
| `searchPaths?` | `string`[] | An array of directories to search for the file. Defaults to the current directory (`"."`) if not provided. |
|
|
1805
2642
|
| `extNames?` | `string`[] | An array of file extensions to try, in order of preference. If not provided, the file will be searched for without any extension. |
|
|
1806
2643
|
| `options?` | `Object` | - |
|
|
2644
|
+
| `options.exclude?` | `string` \| `string`[] | - |
|
|
1807
2645
|
| `options.filepath?` | `string` | - |
|
|
1808
2646
|
|
|
1809
2647
|
#### Returns
|
|
@@ -1824,13 +2662,13 @@ const content = loadFileFromPaths('config', ['/etc', '/usr/local/etc'], ['.json'
|
|
|
1824
2662
|
|
|
1825
2663
|
#### Defined in
|
|
1826
2664
|
|
|
1827
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:22](https://github.com/isdk/ai-tool.js/blob/
|
|
2665
|
+
[packages/ai-tool/src/utils/load-file-from-paths.ts:22](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/load-file-from-paths.ts#L22)
|
|
1828
2666
|
|
|
1829
2667
|
___
|
|
1830
2668
|
|
|
1831
2669
|
### loadTextFromPaths
|
|
1832
2670
|
|
|
1833
|
-
▸ **loadTextFromPaths**(`filename`, `searchPaths?`, `extNames?`, `options?`): `string`
|
|
2671
|
+
▸ **loadTextFromPaths**(`filename`, `searchPaths?`, `extNames?`, `options?`, `exclude?`): `string`
|
|
1834
2672
|
|
|
1835
2673
|
#### Parameters
|
|
1836
2674
|
|
|
@@ -1840,6 +2678,7 @@ ___
|
|
|
1840
2678
|
| `searchPaths?` | `string`[] |
|
|
1841
2679
|
| `extNames?` | `string`[] |
|
|
1842
2680
|
| `options?` | `BufferEncoding` \| \{ `encoding?`: BufferEncoding \| undefined ; `filepath?`: `string` } |
|
|
2681
|
+
| `exclude?` | `string` \| `string`[] |
|
|
1843
2682
|
|
|
1844
2683
|
#### Returns
|
|
1845
2684
|
|
|
@@ -1847,7 +2686,28 @@ ___
|
|
|
1847
2686
|
|
|
1848
2687
|
#### Defined in
|
|
1849
2688
|
|
|
1850
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:
|
|
2689
|
+
[packages/ai-tool/src/utils/load-file-from-paths.ts:75](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/load-file-from-paths.ts#L75)
|
|
2690
|
+
|
|
2691
|
+
___
|
|
2692
|
+
|
|
2693
|
+
### makeToolFuncCancelable
|
|
2694
|
+
|
|
2695
|
+
▸ **makeToolFuncCancelable**(`Tool`, `options?`): typeof [`ToolFunc`](classes/ToolFunc.md)
|
|
2696
|
+
|
|
2697
|
+
#### Parameters
|
|
2698
|
+
|
|
2699
|
+
| Name | Type |
|
|
2700
|
+
| :------ | :------ |
|
|
2701
|
+
| `Tool` | typeof [`ToolFunc`](classes/ToolFunc.md) |
|
|
2702
|
+
| `options?` | [`CancelableAbilityOptions`](interfaces/CancelableAbilityOptions.md) |
|
|
2703
|
+
|
|
2704
|
+
#### Returns
|
|
2705
|
+
|
|
2706
|
+
typeof [`ToolFunc`](classes/ToolFunc.md)
|
|
2707
|
+
|
|
2708
|
+
#### Defined in
|
|
2709
|
+
|
|
2710
|
+
[packages/ai-tool/src/utils/cancelable-ability.ts:340](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/cancelable-ability.ts#L340)
|
|
1851
2711
|
|
|
1852
2712
|
___
|
|
1853
2713
|
|
|
@@ -1896,7 +2756,53 @@ matchUrlProtocol("noProtocolHere");
|
|
|
1896
2756
|
|
|
1897
2757
|
#### Defined in
|
|
1898
2758
|
|
|
1899
|
-
[packages/ai-tool/src/utils/match-url-protocol.ts:23](https://github.com/isdk/ai-tool.js/blob/
|
|
2759
|
+
[packages/ai-tool/src/utils/match-url-protocol.ts:23](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/match-url-protocol.ts#L23)
|
|
2760
|
+
|
|
2761
|
+
___
|
|
2762
|
+
|
|
2763
|
+
### messagesToText
|
|
2764
|
+
|
|
2765
|
+
▸ **messagesToText**(`messages`): `string`
|
|
2766
|
+
|
|
2767
|
+
#### Parameters
|
|
2768
|
+
|
|
2769
|
+
| Name | Type |
|
|
2770
|
+
| :------ | :------ |
|
|
2771
|
+
| `messages` | [`AIChatMessageParamBase`](interfaces/AIChatMessageParamBase.md)[] |
|
|
2772
|
+
|
|
2773
|
+
#### Returns
|
|
2774
|
+
|
|
2775
|
+
`string`
|
|
2776
|
+
|
|
2777
|
+
#### Defined in
|
|
2778
|
+
|
|
2779
|
+
[packages/ai-tool/src/utils/chat.ts:116](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/chat.ts#L116)
|
|
2780
|
+
|
|
2781
|
+
___
|
|
2782
|
+
|
|
2783
|
+
### paramsSizeToScaleStr
|
|
2784
|
+
|
|
2785
|
+
▸ **paramsSizeToScaleStr**(`paramsSize`, `fractionDigits?`): `string`
|
|
2786
|
+
|
|
2787
|
+
Formats a parameter size in bytes into a string with an appropriate scale (T, B, M, or K),
|
|
2788
|
+
optionally specifying the number of fractional digits to display.
|
|
2789
|
+
|
|
2790
|
+
#### Parameters
|
|
2791
|
+
|
|
2792
|
+
| Name | Type | Default value | Description |
|
|
2793
|
+
| :------ | :------ | :------ | :------ |
|
|
2794
|
+
| `paramsSize` | `number` | `undefined` | The parameter size in bytes. |
|
|
2795
|
+
| `fractionDigits` | `number` | `0` | The number of fractional digits to include in the formatted output. Default is 0 (no fractional digits). |
|
|
2796
|
+
|
|
2797
|
+
#### Returns
|
|
2798
|
+
|
|
2799
|
+
`string`
|
|
2800
|
+
|
|
2801
|
+
A string representing the formatted parameter size with the appropriate scale unit and the specified number of fractional digits.
|
|
2802
|
+
|
|
2803
|
+
#### Defined in
|
|
2804
|
+
|
|
2805
|
+
[packages/ai-tool/src/utils/convert-params-size.ts:11](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/convert-params-size.ts#L11)
|
|
1900
2806
|
|
|
1901
2807
|
___
|
|
1902
2808
|
|
|
@@ -1921,7 +2827,7 @@ extract from langchain.js/langchain-core/src/prompts/template.ts
|
|
|
1921
2827
|
|
|
1922
2828
|
#### Defined in
|
|
1923
2829
|
|
|
1924
|
-
[packages/ai-tool/src/utils/prompt/template/python.ts:16](https://github.com/isdk/ai-tool.js/blob/
|
|
2830
|
+
[packages/ai-tool/src/utils/prompt/template/python.ts:16](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/template/python.ts#L16)
|
|
1925
2831
|
|
|
1926
2832
|
___
|
|
1927
2833
|
|
|
@@ -1955,7 +2861,7 @@ console.log(json); // { name: 'John' }
|
|
|
1955
2861
|
|
|
1956
2862
|
#### Defined in
|
|
1957
2863
|
|
|
1958
|
-
[packages/ai-tool/src/utils/parse-js-json.ts:14](https://github.com/isdk/ai-tool.js/blob/
|
|
2864
|
+
[packages/ai-tool/src/utils/parse-js-json.ts:14](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/parse-js-json.ts#L14)
|
|
1959
2865
|
|
|
1960
2866
|
___
|
|
1961
2867
|
|
|
@@ -1975,7 +2881,7 @@ ___
|
|
|
1975
2881
|
|
|
1976
2882
|
#### Defined in
|
|
1977
2883
|
|
|
1978
|
-
[packages/ai-tool/src/utils/config.ts:25](https://github.com/isdk/ai-tool.js/blob/
|
|
2884
|
+
[packages/ai-tool/src/utils/config.ts:25](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/config.ts#L25)
|
|
1979
2885
|
|
|
1980
2886
|
___
|
|
1981
2887
|
|
|
@@ -1993,7 +2899,40 @@ A compiled regular expression for control characters in a filename.
|
|
|
1993
2899
|
|
|
1994
2900
|
#### Defined in
|
|
1995
2901
|
|
|
1996
|
-
[packages/ai-tool/src/utils/filename.ts:50](https://github.com/isdk/ai-tool.js/blob/
|
|
2902
|
+
[packages/ai-tool/src/utils/filename.ts:50](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/filename.ts#L50)
|
|
2903
|
+
|
|
2904
|
+
___
|
|
2905
|
+
|
|
2906
|
+
### readFilenamesRecursiveSync
|
|
2907
|
+
|
|
2908
|
+
▸ **readFilenamesRecursiveSync**(`dir`, `isFileMatched?`): `string`[]
|
|
2909
|
+
|
|
2910
|
+
Recursively reads all filenames in the given directory or directories.
|
|
2911
|
+
Optionally filters the results using a file matching callback.
|
|
2912
|
+
|
|
2913
|
+
#### Parameters
|
|
2914
|
+
|
|
2915
|
+
| Name | Type | Description |
|
|
2916
|
+
| :------ | :------ | :------ |
|
|
2917
|
+
| `dir` | `string` \| `string`[] | A single directory path or an array of directory paths to start the search from. |
|
|
2918
|
+
| `isFileMatched?` | (`filepath`: `string`) => `boolean` | An optional callback that determines whether a file should be included in the result. |
|
|
2919
|
+
|
|
2920
|
+
#### Returns
|
|
2921
|
+
|
|
2922
|
+
`string`[]
|
|
2923
|
+
|
|
2924
|
+
An array of file paths that match the criteria.
|
|
2925
|
+
|
|
2926
|
+
**`Example`**
|
|
2927
|
+
|
|
2928
|
+
```typescript
|
|
2929
|
+
const files = readFilenamesRecursiveSync('/path/to/directory', (filepath) => filepath.endsWith('.js'));
|
|
2930
|
+
console.log(files); // Outputs an array of JavaScript file paths.
|
|
2931
|
+
```
|
|
2932
|
+
|
|
2933
|
+
#### Defined in
|
|
2934
|
+
|
|
2935
|
+
[packages/ai-tool/src/utils/load-file-from-paths.ts:101](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/load-file-from-paths.ts#L101)
|
|
1997
2936
|
|
|
1998
2937
|
___
|
|
1999
2938
|
|
|
@@ -2022,7 +2961,7 @@ https://github.com/whatwg/streams/commit/8d7a0bf26eb2cc23e884ddbaac7c1da4b91cf2b
|
|
|
2022
2961
|
|
|
2023
2962
|
#### Defined in
|
|
2024
2963
|
|
|
2025
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:
|
|
2964
|
+
[packages/ai-tool/src/utils/stream/ai-stream.ts:166](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/stream/ai-stream.ts#L166)
|
|
2026
2965
|
|
|
2027
2966
|
___
|
|
2028
2967
|
|
|
@@ -2036,7 +2975,7 @@ ___
|
|
|
2036
2975
|
|
|
2037
2976
|
#### Defined in
|
|
2038
2977
|
|
|
2039
|
-
[packages/ai-tool/src/funcs/index.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
2978
|
+
[packages/ai-tool/src/funcs/index.ts:9](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/funcs/index.ts#L9)
|
|
2040
2979
|
|
|
2041
2980
|
___
|
|
2042
2981
|
|
|
@@ -2056,7 +2995,7 @@ ___
|
|
|
2056
2995
|
|
|
2057
2996
|
#### Defined in
|
|
2058
2997
|
|
|
2059
|
-
[packages/ai-tool/src/utils/config.ts:15](https://github.com/isdk/ai-tool.js/blob/
|
|
2998
|
+
[packages/ai-tool/src/utils/config.ts:15](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/config.ts#L15)
|
|
2060
2999
|
|
|
2061
3000
|
___
|
|
2062
3001
|
|
|
@@ -2085,7 +3024,7 @@ The sanitized filename.
|
|
|
2085
3024
|
|
|
2086
3025
|
#### Defined in
|
|
2087
3026
|
|
|
2088
|
-
[packages/ai-tool/src/utils/filename.ts:97](https://github.com/isdk/ai-tool.js/blob/
|
|
3027
|
+
[packages/ai-tool/src/utils/filename.ts:97](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/filename.ts#L97)
|
|
2089
3028
|
|
|
2090
3029
|
___
|
|
2091
3030
|
|
|
@@ -2110,7 +3049,7 @@ The sanitized file path as a string.
|
|
|
2110
3049
|
|
|
2111
3050
|
#### Defined in
|
|
2112
3051
|
|
|
2113
|
-
[packages/ai-tool/src/utils/filename.ts:149](https://github.com/isdk/ai-tool.js/blob/
|
|
3052
|
+
[packages/ai-tool/src/utils/filename.ts:149](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/filename.ts#L149)
|
|
2114
3053
|
|
|
2115
3054
|
___
|
|
2116
3055
|
|
|
@@ -2132,7 +3071,31 @@ ___
|
|
|
2132
3071
|
|
|
2133
3072
|
#### Defined in
|
|
2134
3073
|
|
|
2135
|
-
[packages/ai-tool/src/utils/config.ts:85](https://github.com/isdk/ai-tool.js/blob/
|
|
3074
|
+
[packages/ai-tool/src/utils/config.ts:85](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/config.ts#L85)
|
|
3075
|
+
|
|
3076
|
+
___
|
|
3077
|
+
|
|
3078
|
+
### scaleStrToParamsSize
|
|
3079
|
+
|
|
3080
|
+
▸ **scaleStrToParamsSize**(`scale`): `number`
|
|
3081
|
+
|
|
3082
|
+
Converts a formatted parameters size string (with units T, B, M, or K) back to its byte value.
|
|
3083
|
+
|
|
3084
|
+
#### Parameters
|
|
3085
|
+
|
|
3086
|
+
| Name | Type | Description |
|
|
3087
|
+
| :------ | :------ | :------ |
|
|
3088
|
+
| `scale` | `string` | The formatted parameter size string (e.g., "1.23B", "456M", "789K", or "123"). |
|
|
3089
|
+
|
|
3090
|
+
#### Returns
|
|
3091
|
+
|
|
3092
|
+
`number`
|
|
3093
|
+
|
|
3094
|
+
The parameter size in bytes.
|
|
3095
|
+
|
|
3096
|
+
#### Defined in
|
|
3097
|
+
|
|
3098
|
+
[packages/ai-tool/src/utils/convert-params-size.ts:44](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/convert-params-size.ts#L44)
|
|
2136
3099
|
|
|
2137
3100
|
___
|
|
2138
3101
|
|
|
@@ -2158,7 +3121,7 @@ ___
|
|
|
2158
3121
|
|
|
2159
3122
|
#### Defined in
|
|
2160
3123
|
|
|
2161
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:4](https://github.com/isdk/ai-tool.js/blob/
|
|
3124
|
+
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:4](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/prompt/few-shot-prompt-template.ts#L4)
|
|
2162
3125
|
|
|
2163
3126
|
___
|
|
2164
3127
|
|
|
@@ -2188,7 +3151,7 @@ console.log(splitSentence(text)); // returns ['Hello world!', 'How are you toda
|
|
|
2188
3151
|
|
|
2189
3152
|
#### Defined in
|
|
2190
3153
|
|
|
2191
|
-
[packages/ai-tool/src/utils/split-sentence.ts:29](https://github.com/isdk/ai-tool.js/blob/
|
|
3154
|
+
[packages/ai-tool/src/utils/split-sentence.ts:29](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/split-sentence.ts#L29)
|
|
2192
3155
|
|
|
2193
3156
|
___
|
|
2194
3157
|
|
|
@@ -2235,6 +3198,27 @@ node_modules/.pnpm/yaml@2.4.3/node_modules/yaml/dist/public-api.d.ts:43
|
|
|
2235
3198
|
|
|
2236
3199
|
___
|
|
2237
3200
|
|
|
3201
|
+
### textToDate
|
|
3202
|
+
|
|
3203
|
+
▸ **textToDate**(`date`, `format?`): `Date`
|
|
3204
|
+
|
|
3205
|
+
#### Parameters
|
|
3206
|
+
|
|
3207
|
+
| Name | Type | Default value |
|
|
3208
|
+
| :------ | :------ | :------ |
|
|
3209
|
+
| `date` | `string` | `undefined` |
|
|
3210
|
+
| `format` | `string` | `FormatDateStr` |
|
|
3211
|
+
|
|
3212
|
+
#### Returns
|
|
3213
|
+
|
|
3214
|
+
`Date`
|
|
3215
|
+
|
|
3216
|
+
#### Defined in
|
|
3217
|
+
|
|
3218
|
+
[packages/ai-tool/src/utils/to-datetime.ts:25](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/to-datetime.ts#L25)
|
|
3219
|
+
|
|
3220
|
+
___
|
|
3221
|
+
|
|
2238
3222
|
### throwError
|
|
2239
3223
|
|
|
2240
3224
|
▸ **throwError**(`message`, `name?`, `status?`): `void`
|
|
@@ -2259,7 +3243,27 @@ Throws a BaseError object
|
|
|
2259
3243
|
|
|
2260
3244
|
#### Defined in
|
|
2261
3245
|
|
|
2262
|
-
[packages/ai-tool/src/utils/base-error.ts:
|
|
3246
|
+
[packages/ai-tool/src/utils/base-error.ts:235](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/base-error.ts#L235)
|
|
3247
|
+
|
|
3248
|
+
___
|
|
3249
|
+
|
|
3250
|
+
### toDateTime
|
|
3251
|
+
|
|
3252
|
+
▸ **toDateTime**(`date`): `undefined` \| `Date`
|
|
3253
|
+
|
|
3254
|
+
#### Parameters
|
|
3255
|
+
|
|
3256
|
+
| Name | Type |
|
|
3257
|
+
| :------ | :------ |
|
|
3258
|
+
| `date` | `string` \| `number` \| `Date` |
|
|
3259
|
+
|
|
3260
|
+
#### Returns
|
|
3261
|
+
|
|
3262
|
+
`undefined` \| `Date`
|
|
3263
|
+
|
|
3264
|
+
#### Defined in
|
|
3265
|
+
|
|
3266
|
+
[packages/ai-tool/src/utils/to-datetime.ts:9](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/to-datetime.ts#L9)
|
|
2263
3267
|
|
|
2264
3268
|
___
|
|
2265
3269
|
|
|
@@ -2301,7 +3305,7 @@ const output2 = trimStart(" text"); // " text"
|
|
|
2301
3305
|
|
|
2302
3306
|
#### Defined in
|
|
2303
3307
|
|
|
2304
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:
|
|
3308
|
+
[packages/ai-tool/src/utils/stream/ai-stream.ts:92](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/stream/ai-stream.ts#L92)
|
|
2305
3309
|
|
|
2306
3310
|
___
|
|
2307
3311
|
|
|
@@ -2341,7 +3345,7 @@ truncTo(1.2345, 2, 0.6)
|
|
|
2341
3345
|
|
|
2342
3346
|
#### Defined in
|
|
2343
3347
|
|
|
2344
|
-
[packages/ai-tool/src/utils/trunc-to.ts:19](https://github.com/isdk/ai-tool.js/blob/
|
|
3348
|
+
[packages/ai-tool/src/utils/trunc-to.ts:19](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/trunc-to.ts#L19)
|
|
2345
3349
|
|
|
2346
3350
|
___
|
|
2347
3351
|
|
|
@@ -2362,7 +3366,7 @@ ___
|
|
|
2362
3366
|
|
|
2363
3367
|
#### Defined in
|
|
2364
3368
|
|
|
2365
|
-
[packages/ai-tool/src/utils/hash/uuid.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
3369
|
+
[packages/ai-tool/src/utils/hash/uuid.ts:8](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/hash/uuid.ts#L8)
|
|
2366
3370
|
|
|
2367
3371
|
___
|
|
2368
3372
|
|
|
@@ -2597,7 +3601,7 @@ ___
|
|
|
2597
3601
|
|
|
2598
3602
|
#### Defined in
|
|
2599
3603
|
|
|
2600
|
-
[packages/ai-tool/src/utils/wait.ts:1](https://github.com/isdk/ai-tool.js/blob/
|
|
3604
|
+
[packages/ai-tool/src/utils/wait.ts:1](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/wait.ts#L1)
|
|
2601
3605
|
|
|
2602
3606
|
___
|
|
2603
3607
|
|
|
@@ -2619,7 +3623,7 @@ ___
|
|
|
2619
3623
|
|
|
2620
3624
|
#### Defined in
|
|
2621
3625
|
|
|
2622
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:32](https://github.com/isdk/ai-tool.js/blob/
|
|
3626
|
+
[packages/ai-tool/src/utils/hash/xxhash.ts:32](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/hash/xxhash.ts#L32)
|
|
2623
3627
|
|
|
2624
3628
|
___
|
|
2625
3629
|
|
|
@@ -2640,7 +3644,7 @@ ___
|
|
|
2640
3644
|
|
|
2641
3645
|
#### Defined in
|
|
2642
3646
|
|
|
2643
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:11](https://github.com/isdk/ai-tool.js/blob/
|
|
3647
|
+
[packages/ai-tool/src/utils/hash/xxhash.ts:11](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/hash/xxhash.ts#L11)
|
|
2644
3648
|
|
|
2645
3649
|
___
|
|
2646
3650
|
|
|
@@ -2661,7 +3665,7 @@ ___
|
|
|
2661
3665
|
|
|
2662
3666
|
#### Defined in
|
|
2663
3667
|
|
|
2664
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:18](https://github.com/isdk/ai-tool.js/blob/
|
|
3668
|
+
[packages/ai-tool/src/utils/hash/xxhash.ts:18](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/hash/xxhash.ts#L18)
|
|
2665
3669
|
|
|
2666
3670
|
___
|
|
2667
3671
|
|
|
@@ -2683,4 +3687,4 @@ ___
|
|
|
2683
3687
|
|
|
2684
3688
|
#### Defined in
|
|
2685
3689
|
|
|
2686
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:48](https://github.com/isdk/ai-tool.js/blob/
|
|
3690
|
+
[packages/ai-tool/src/utils/hash/xxhash.ts:48](https://github.com/isdk/ai-tool.js/blob/787e914a1f5dab2d24312399a6f123f0e8360403/src/utils/hash/xxhash.ts#L48)
|