@isdk/ai-tool 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-PY6NRGZE.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-nP9lSU6E.d.mts → index-DUEs7T8M.d.mts} +2 -2
- package/dist/{index-nP9lSU6E.d.ts → index-DUEs7T8M.d.ts} +2 -2
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/README.md +5 -3
- package/docs/_media/CONTRIBUTING.md +18 -0
- package/docs/_media/LICENSE-MIT +22 -0
- package/docs/classes/AbortError.md +108 -129
- package/docs/classes/AlreadyExistsError.md +105 -126
- package/docs/classes/BaseError.md +112 -125
- package/docs/classes/CancelableAbility.md +136 -188
- package/docs/classes/ClientTools.md +1005 -1107
- package/docs/classes/CommonError.md +115 -136
- package/docs/classes/ConfigFile.md +150 -163
- package/docs/classes/EventClient.md +1128 -1282
- package/docs/classes/EventServer.md +1165 -1303
- package/docs/classes/EventToolFunc.md +958 -1028
- package/docs/classes/FStringPromptTemplate.md +352 -438
- package/docs/classes/FewShotPromptTemplate.md +364 -464
- package/docs/classes/GolangPromptTemplate.md +352 -438
- package/docs/classes/HFEnvironment.md +53 -79
- package/docs/classes/HFInterpreter.md +20 -377
- package/docs/classes/HFTemplate.md +21 -33
- package/docs/classes/HfPromptTemplate.md +352 -438
- package/docs/classes/IntSet.md +67 -100
- package/docs/classes/NotFoundError.md +105 -126
- package/docs/classes/NotImplementationError.md +105 -126
- package/docs/classes/PromptExampleSelector.md +58 -70
- package/docs/classes/PromptTemplate.md +338 -422
- package/docs/classes/ReadableStreamError.md +108 -129
- package/docs/classes/ResClientTools.md +916 -1026
- package/docs/classes/ResServerTools.md +919 -1026
- package/docs/classes/SSEChannel.md +93 -112
- package/docs/classes/Semaphore.md +44 -140
- package/docs/classes/ServerTools.md +981 -1072
- package/docs/classes/TaskAbortController.md +46 -66
- package/docs/classes/ToolFunc.md +840 -910
- package/docs/enumerations/AsyncFeatureBits.md +37 -0
- package/docs/enumerations/AsyncFeatures.md +37 -0
- package/docs/enumerations/ErrorCode.md +217 -0
- package/docs/enumerations/XXHashAlgorithm.md +27 -0
- package/docs/functions/AIArgProcessor.md +27 -0
- package/docs/functions/AIStream.md +50 -0
- package/docs/functions/ChoiceArgProcessor.md +27 -0
- package/docs/functions/RateLimit.md +33 -0
- package/docs/functions/TemplateArgProcessor.md +27 -0
- package/docs/functions/backendEventable.md +23 -0
- package/docs/functions/canonicalize.md +21 -0
- package/docs/functions/countRegexMatches.md +33 -0
- package/docs/functions/createAbilityInjector.md +87 -0
- package/docs/functions/createCallbacksTransformer.md +49 -0
- package/docs/functions/createEmptyReadableStream.md +23 -0
- package/docs/functions/createEndWithRepetitionDetector.md +29 -0
- package/docs/functions/createError.md +35 -0
- package/docs/functions/createEventStreamTransformer.md +33 -0
- package/docs/functions/createHfValueFunc.md +29 -0
- package/docs/functions/createLRUCache.md +23 -0
- package/docs/functions/dateToText.md +23 -0
- package/docs/functions/expandEnv.md +40 -0
- package/docs/functions/expandObjEnv.md +54 -0
- package/docs/functions/extNameLevel.md +43 -0
- package/docs/functions/fileIsExists.md +34 -0
- package/docs/functions/filenameReservedRegex.md +22 -0
- package/docs/functions/filterValidFnScope.md +21 -0
- package/docs/functions/findPort.md +23 -0
- package/docs/functions/formatISO.md +71 -0
- package/docs/functions/getAllEnumKeys.md +31 -0
- package/docs/functions/getConfigFileNames.md +23 -0
- package/docs/functions/getConfigs.md +23 -0
- package/docs/functions/getKeysPath.md +38 -0
- package/docs/functions/getMultiLevelExtname.md +31 -0
- package/docs/functions/getPackageDir.md +39 -0
- package/docs/functions/getRealFilepath.md +34 -0
- package/docs/functions/getResponseErrorReadableStream.md +21 -0
- package/docs/functions/hfParse.md +24 -0
- package/docs/functions/hfTokenize.md +25 -0
- package/docs/functions/interpolateEnv.md +25 -0
- package/docs/functions/interpolateFString.md +27 -0
- package/docs/functions/interpolateGolangTemplate.md +31 -0
- package/docs/functions/isModelNameMatched.md +45 -0
- package/docs/functions/isValidFilename.md +38 -0
- package/docs/functions/isValidFilepath.md +27 -0
- package/docs/functions/isWebStream.md +21 -0
- package/docs/functions/jsonFilterToWhere.md +45 -0
- package/docs/functions/jsonToMarkdownStr.md +31 -0
- package/docs/functions/loadFileFromPaths.md +54 -0
- package/docs/functions/loadTextFromPaths.md +29 -0
- package/docs/functions/lrucache.md +29 -0
- package/docs/functions/makeToolFuncCancelable.md +23 -0
- package/docs/functions/matchUrlProtocol.md +48 -0
- package/docs/functions/memoize.md +27 -0
- package/docs/functions/messagesToText.md +21 -0
- package/docs/functions/paramsSizeToScaleStr.md +32 -0
- package/docs/functions/parseCommand.md +33 -0
- package/docs/functions/parseDateFormat.md +360 -0
- package/docs/functions/parseFString.md +26 -0
- package/docs/functions/parseISO.md +72 -0
- package/docs/functions/parseJsJson.md +38 -0
- package/docs/functions/parseObjectArgInfo.md +27 -0
- package/docs/functions/parseObjectArgumentInfos.md +25 -0
- package/docs/functions/parseObjectArguments.md +68 -0
- package/docs/functions/parseObjectArgumentsAsArgInfos.md +42 -0
- package/docs/functions/parseYaml.md +21 -0
- package/docs/functions/quoteStr.md +21 -0
- package/docs/functions/reControlCharsRegex.md +21 -0
- package/docs/functions/readFilenamesRecursiveSync.md +47 -0
- package/docs/functions/readableFromAsyncIterable.md +28 -0
- package/docs/functions/registerCoreTools.md +17 -0
- package/docs/functions/registerYamlTag.md +21 -0
- package/docs/functions/sanitizeFilename.md +37 -0
- package/docs/functions/sanitizeFilepath.md +31 -0
- package/docs/functions/saveConfigFile.md +25 -0
- package/docs/functions/scaleStrToParamsSize.md +27 -0
- package/docs/functions/simplifyObjectArguments.md +21 -0
- package/docs/functions/sortedValues.md +25 -0
- package/docs/functions/splitSentence.md +37 -0
- package/docs/functions/stringifyYaml.md +49 -0
- package/docs/functions/textToDate.md +23 -0
- package/docs/functions/throwError.md +37 -0
- package/docs/functions/toDate.md +76 -0
- package/docs/functions/toDateTime.md +21 -0
- package/docs/functions/trimStartOfStreamHelper.md +41 -0
- package/docs/functions/truncTo.md +47 -0
- package/docs/functions/uuid.md +23 -0
- package/docs/functions/uuidParse.md +21 -0
- package/docs/functions/uuidStringify.md +23 -0
- package/docs/functions/uuidValidate.md +21 -0
- package/docs/functions/uuidVersion.md +21 -0
- package/docs/functions/uuidv1.md +47 -0
- package/docs/functions/uuidv4.md +47 -0
- package/docs/functions/uuidv5.md +51 -0
- package/docs/functions/wait.md +21 -0
- package/docs/functions/xxhash.md +25 -0
- package/docs/functions/xxhash32.md +23 -0
- package/docs/functions/xxhash64.md +23 -0
- package/docs/functions/xxhashAsStr.md +25 -0
- package/docs/globals.md +236 -0
- package/docs/interfaces/AIChatAssistantMessageParam.md +29 -38
- package/docs/interfaces/AIChatContentPartImage.md +11 -16
- package/docs/interfaces/AIChatContentPartText.md +9 -12
- package/docs/interfaces/AIChatMessageParamBase.md +12 -19
- package/docs/interfaces/AIChatMessageToolCall.md +18 -21
- package/docs/interfaces/AIChatSystemMessageParam.md +16 -22
- package/docs/interfaces/AIChatToolMessageParam.md +19 -26
- package/docs/interfaces/AIChatUserMessageParam.md +32 -42
- package/docs/interfaces/AIChoiceConfig.md +31 -39
- package/docs/interfaces/AIResult.md +29 -32
- package/docs/interfaces/AIStreamParser.md +24 -18
- package/docs/interfaces/AIStreamParserOptions.md +8 -10
- package/docs/interfaces/BaseFunc.md +55 -75
- package/docs/interfaces/BaseFuncItem.md +43 -61
- package/docs/interfaces/CancelableAbilityOptions.md +43 -54
- package/docs/interfaces/ClientFuncItem.md +66 -83
- package/docs/interfaces/DotenvExpandOptions.md +15 -19
- package/docs/interfaces/DotenvExpandOutput.md +11 -14
- package/docs/interfaces/DotenvParseInput.md +6 -2
- package/docs/interfaces/DotenvParseOutput.md +6 -2
- package/docs/interfaces/DotenvPopulateInput.md +6 -2
- package/docs/interfaces/EventClientFuncParams.md +22 -33
- package/docs/interfaces/EventServerFuncParams.md +27 -35
- package/docs/interfaces/FewShotPromptTemplateOptions.md +58 -74
- package/docs/interfaces/FuncItem.md +53 -70
- package/docs/interfaces/FuncParam.md +29 -36
- package/docs/interfaces/FuncParams.md +6 -2
- package/docs/interfaces/Funcs.md +6 -2
- package/docs/interfaces/JsonFilter.md +6 -2
- package/docs/interfaces/ParseObjectArgumentOptions.md +23 -29
- package/docs/interfaces/PromptExampleSelectorOptions.md +13 -16
- package/docs/interfaces/PromptTemplateOptions.md +31 -40
- package/docs/interfaces/RemoteFuncItem.md +64 -82
- package/docs/interfaces/ResClientFuncParams.md +14 -19
- package/docs/interfaces/ResServerFuncParams.md +28 -36
- package/docs/interfaces/SanitizeFilenameOptions.md +11 -14
- package/docs/interfaces/ServerFuncItem.md +70 -88
- package/docs/interfaces/ServerFuncParams.md +15 -20
- package/docs/interfaces/StreamCallbacksAndOptions.md +36 -65
- package/docs/interfaces/TaskAbortControllers.md +6 -2
- package/docs/interfaces/TaskPromise.md +48 -61
- package/docs/interfaces/ToolFuncPackage.md +18 -32
- package/docs/type-aliases/AIChatContentPart.md +13 -0
- package/docs/type-aliases/AIChatMessageParam.md +13 -0
- package/docs/type-aliases/AIChatRole.md +13 -0
- package/docs/type-aliases/AIMessageType.md +13 -0
- package/docs/type-aliases/AIModelNameRule.md +13 -0
- package/docs/type-aliases/AIModelNameRuleFn.md +21 -0
- package/docs/type-aliases/AIModelNameRules.md +13 -0
- package/docs/type-aliases/AITextGenerationFinishReason.md +13 -0
- package/docs/type-aliases/ActionName.md +13 -0
- package/docs/type-aliases/AsyncTaskId.md +13 -0
- package/docs/type-aliases/EventErrorListenerFn.md +27 -0
- package/docs/type-aliases/EventListenerFn.md +25 -0
- package/docs/type-aliases/FStringPromptTemplateNode.md +16 -0
- package/docs/type-aliases/FuncParamType.md +13 -0
- package/docs/type-aliases/PromptExamples.md +17 -0
- package/docs/type-aliases/PromptTemplateType.md +13 -0
- package/docs/type-aliases/PromptType.md +13 -0
- package/docs/type-aliases/TFunc.md +23 -0
- package/docs/variables/AIChatRoles.md +13 -0
- package/docs/variables/AIMessageTypes.md +13 -0
- package/docs/variables/AITextGenerationFinishReasons.md +13 -0
- package/docs/variables/AbortErrorCode.md +13 -0
- package/docs/variables/ActionNames.md +13 -0
- package/docs/variables/AlreadyExistsErrorCode.md +13 -0
- package/docs/variables/ClientToolFuncSchema.md +87 -0
- package/docs/variables/DefaultAsyncSemaphoreCapacity.md +13 -0
- package/docs/variables/EventBusName.md +13 -0
- package/docs/variables/EventName.md +13 -0
- package/docs/variables/FilenameReservedRegex.md +16 -0
- package/docs/variables/HFBuiltins.md +92 -0
- package/docs/variables/InternalErrorCode.md +13 -0
- package/docs/variables/NotFoundErrorCode.md +13 -0
- package/docs/variables/NotImplementedErrorCode.md +13 -0
- package/docs/variables/PASSING_SCORE.md +13 -0
- package/docs/variables/PromptTemplateTypes.md +13 -0
- package/docs/variables/PromptTypes.md +16 -0
- package/docs/variables/RStreamErrCode.md +13 -0
- package/docs/variables/RemoteToolFuncSchema.md +87 -0
- package/docs/variables/ResponseRStreamErrCode.md +13 -0
- package/docs/variables/SSEChannelAlreadyClosedErrCode.md +13 -0
- package/docs/variables/ServerToolFuncSchema.md +87 -0
- package/docs/variables/ToolAsyncCancelableBit.md +13 -0
- package/docs/variables/ToolAsyncMultiTaskBit.md +13 -0
- package/docs/variables/ToolAsyncPriorityBit.md +13 -0
- package/docs/variables/ToolFuncSchema.md +125 -0
- package/docs/variables/WindowsReservedNameRegex.md +15 -0
- package/docs/variables/base32768.md +13 -0
- package/docs/variables/defaultTemplateFormat.md +13 -0
- package/docs/variables/event.md +13 -0
- package/docs/variables/eventClient.md +13 -0
- package/docs/variables/eventServer.md +13 -0
- package/docs/variables/lrucache.md +13 -0
- package/docs/variables/mimeType.md +13 -0
- package/docs/variables/uuidNIL.md +13 -0
- package/package.json +26 -27
- package/dist/chunk-W2LO3HZT.mjs +0 -1
- package/docs/.nojekyll +0 -1
- package/docs/enums/AsyncFeatureBits.md +0 -41
- package/docs/enums/AsyncFeatures.md +0 -41
- package/docs/enums/ErrorCode.md +0 -239
- package/docs/enums/XXHashAlgorithm.md +0 -30
- package/docs/modules.md +0 -4062
package/docs/modules.md
DELETED
|
@@ -1,4062 +0,0 @@
|
|
|
1
|
-
[@isdk/ai-tool](README.md) / Exports
|
|
2
|
-
|
|
3
|
-
# @isdk/ai-tool
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### Enumerations
|
|
8
|
-
|
|
9
|
-
- [AsyncFeatureBits](enums/AsyncFeatureBits.md)
|
|
10
|
-
- [AsyncFeatures](enums/AsyncFeatures.md)
|
|
11
|
-
- [ErrorCode](enums/ErrorCode.md)
|
|
12
|
-
- [XXHashAlgorithm](enums/XXHashAlgorithm.md)
|
|
13
|
-
|
|
14
|
-
### Classes
|
|
15
|
-
|
|
16
|
-
- [AbortError](classes/AbortError.md)
|
|
17
|
-
- [AlreadyExistsError](classes/AlreadyExistsError.md)
|
|
18
|
-
- [BaseError](classes/BaseError.md)
|
|
19
|
-
- [CancelableAbility](classes/CancelableAbility.md)
|
|
20
|
-
- [ClientTools](classes/ClientTools.md)
|
|
21
|
-
- [CommonError](classes/CommonError.md)
|
|
22
|
-
- [ConfigFile](classes/ConfigFile.md)
|
|
23
|
-
- [EventClient](classes/EventClient.md)
|
|
24
|
-
- [EventServer](classes/EventServer.md)
|
|
25
|
-
- [EventToolFunc](classes/EventToolFunc.md)
|
|
26
|
-
- [FStringPromptTemplate](classes/FStringPromptTemplate.md)
|
|
27
|
-
- [FewShotPromptTemplate](classes/FewShotPromptTemplate.md)
|
|
28
|
-
- [GolangPromptTemplate](classes/GolangPromptTemplate.md)
|
|
29
|
-
- [HFEnvironment](classes/HFEnvironment.md)
|
|
30
|
-
- [HFInterpreter](classes/HFInterpreter.md)
|
|
31
|
-
- [HFTemplate](classes/HFTemplate.md)
|
|
32
|
-
- [HfPromptTemplate](classes/HfPromptTemplate.md)
|
|
33
|
-
- [IntSet](classes/IntSet.md)
|
|
34
|
-
- [NotFoundError](classes/NotFoundError.md)
|
|
35
|
-
- [NotImplementationError](classes/NotImplementationError.md)
|
|
36
|
-
- [PromptExampleSelector](classes/PromptExampleSelector.md)
|
|
37
|
-
- [PromptTemplate](classes/PromptTemplate.md)
|
|
38
|
-
- [ReadableStreamError](classes/ReadableStreamError.md)
|
|
39
|
-
- [ResClientTools](classes/ResClientTools.md)
|
|
40
|
-
- [ResServerTools](classes/ResServerTools.md)
|
|
41
|
-
- [SSEChannel](classes/SSEChannel.md)
|
|
42
|
-
- [Semaphore](classes/Semaphore.md)
|
|
43
|
-
- [ServerTools](classes/ServerTools.md)
|
|
44
|
-
- [TaskAbortController](classes/TaskAbortController.md)
|
|
45
|
-
- [ToolFunc](classes/ToolFunc.md)
|
|
46
|
-
|
|
47
|
-
### Interfaces
|
|
48
|
-
|
|
49
|
-
- [AIChatAssistantMessageParam](interfaces/AIChatAssistantMessageParam.md)
|
|
50
|
-
- [AIChatContentPartImage](interfaces/AIChatContentPartImage.md)
|
|
51
|
-
- [AIChatContentPartText](interfaces/AIChatContentPartText.md)
|
|
52
|
-
- [AIChatMessageParamBase](interfaces/AIChatMessageParamBase.md)
|
|
53
|
-
- [AIChatMessageToolCall](interfaces/AIChatMessageToolCall.md)
|
|
54
|
-
- [AIChatSystemMessageParam](interfaces/AIChatSystemMessageParam.md)
|
|
55
|
-
- [AIChatToolMessageParam](interfaces/AIChatToolMessageParam.md)
|
|
56
|
-
- [AIChatUserMessageParam](interfaces/AIChatUserMessageParam.md)
|
|
57
|
-
- [AIChoiceConfig](interfaces/AIChoiceConfig.md)
|
|
58
|
-
- [AIResult](interfaces/AIResult.md)
|
|
59
|
-
- [AIStreamParser](interfaces/AIStreamParser.md)
|
|
60
|
-
- [AIStreamParserOptions](interfaces/AIStreamParserOptions.md)
|
|
61
|
-
- [BaseFunc](interfaces/BaseFunc.md)
|
|
62
|
-
- [BaseFuncItem](interfaces/BaseFuncItem.md)
|
|
63
|
-
- [CancelableAbilityOptions](interfaces/CancelableAbilityOptions.md)
|
|
64
|
-
- [ClientFuncItem](interfaces/ClientFuncItem.md)
|
|
65
|
-
- [DotenvExpandOptions](interfaces/DotenvExpandOptions.md)
|
|
66
|
-
- [DotenvExpandOutput](interfaces/DotenvExpandOutput.md)
|
|
67
|
-
- [DotenvParseInput](interfaces/DotenvParseInput.md)
|
|
68
|
-
- [DotenvParseOutput](interfaces/DotenvParseOutput.md)
|
|
69
|
-
- [DotenvPopulateInput](interfaces/DotenvPopulateInput.md)
|
|
70
|
-
- [EventClientFuncParams](interfaces/EventClientFuncParams.md)
|
|
71
|
-
- [EventServerFuncParams](interfaces/EventServerFuncParams.md)
|
|
72
|
-
- [FewShotPromptTemplateOptions](interfaces/FewShotPromptTemplateOptions.md)
|
|
73
|
-
- [FuncItem](interfaces/FuncItem.md)
|
|
74
|
-
- [FuncParam](interfaces/FuncParam.md)
|
|
75
|
-
- [FuncParams](interfaces/FuncParams.md)
|
|
76
|
-
- [Funcs](interfaces/Funcs.md)
|
|
77
|
-
- [JsonFilter](interfaces/JsonFilter.md)
|
|
78
|
-
- [ParseObjectArgumentOptions](interfaces/ParseObjectArgumentOptions.md)
|
|
79
|
-
- [PromptExampleSelectorOptions](interfaces/PromptExampleSelectorOptions.md)
|
|
80
|
-
- [PromptTemplateOptions](interfaces/PromptTemplateOptions.md)
|
|
81
|
-
- [RemoteFuncItem](interfaces/RemoteFuncItem.md)
|
|
82
|
-
- [ResClientFuncParams](interfaces/ResClientFuncParams.md)
|
|
83
|
-
- [ResServerFuncParams](interfaces/ResServerFuncParams.md)
|
|
84
|
-
- [SanitizeFilenameOptions](interfaces/SanitizeFilenameOptions.md)
|
|
85
|
-
- [ServerFuncItem](interfaces/ServerFuncItem.md)
|
|
86
|
-
- [ServerFuncParams](interfaces/ServerFuncParams.md)
|
|
87
|
-
- [StreamCallbacksAndOptions](interfaces/StreamCallbacksAndOptions.md)
|
|
88
|
-
- [TaskAbortControllers](interfaces/TaskAbortControllers.md)
|
|
89
|
-
- [TaskPromise](interfaces/TaskPromise.md)
|
|
90
|
-
- [ToolFuncPackage](interfaces/ToolFuncPackage.md)
|
|
91
|
-
|
|
92
|
-
### Type Aliases
|
|
93
|
-
|
|
94
|
-
- [AIChatContentPart](modules.md#aichatcontentpart)
|
|
95
|
-
- [AIChatMessageParam](modules.md#aichatmessageparam)
|
|
96
|
-
- [AIChatRole](modules.md#aichatrole)
|
|
97
|
-
- [AIMessageType](modules.md#aimessagetype)
|
|
98
|
-
- [AIModelNameRule](modules.md#aimodelnamerule)
|
|
99
|
-
- [AIModelNameRuleFn](modules.md#aimodelnamerulefn)
|
|
100
|
-
- [AIModelNameRules](modules.md#aimodelnamerules)
|
|
101
|
-
- [AITextGenerationFinishReason](modules.md#aitextgenerationfinishreason)
|
|
102
|
-
- [ActionName](modules.md#actionname)
|
|
103
|
-
- [AsyncTaskId](modules.md#asynctaskid)
|
|
104
|
-
- [EventErrorListenerFn](modules.md#eventerrorlistenerfn)
|
|
105
|
-
- [EventListenerFn](modules.md#eventlistenerfn)
|
|
106
|
-
- [FStringPromptTemplateNode](modules.md#fstringprompttemplatenode)
|
|
107
|
-
- [FuncParamType](modules.md#funcparamtype)
|
|
108
|
-
- [PromptExamples](modules.md#promptexamples)
|
|
109
|
-
- [PromptTemplateType](modules.md#prompttemplatetype)
|
|
110
|
-
- [PromptType](modules.md#prompttype)
|
|
111
|
-
- [TFunc](modules.md#tfunc)
|
|
112
|
-
|
|
113
|
-
### Variables
|
|
114
|
-
|
|
115
|
-
- [AIChatRoles](modules.md#aichatroles)
|
|
116
|
-
- [AIMessageTypes](modules.md#aimessagetypes)
|
|
117
|
-
- [AITextGenerationFinishReasons](modules.md#aitextgenerationfinishreasons)
|
|
118
|
-
- [AbortErrorCode](modules.md#aborterrorcode)
|
|
119
|
-
- [ActionNames](modules.md#actionnames)
|
|
120
|
-
- [AlreadyExistsErrorCode](modules.md#alreadyexistserrorcode)
|
|
121
|
-
- [ClientToolFuncSchema](modules.md#clienttoolfuncschema)
|
|
122
|
-
- [DefaultAsyncSemaphoreCapacity](modules.md#defaultasyncsemaphorecapacity)
|
|
123
|
-
- [EventBusName](modules.md#eventbusname)
|
|
124
|
-
- [EventName](modules.md#eventname)
|
|
125
|
-
- [FilenameReservedRegex](modules.md#filenamereservedregex)
|
|
126
|
-
- [HFBuiltins](modules.md#hfbuiltins)
|
|
127
|
-
- [InternalErrorCode](modules.md#internalerrorcode)
|
|
128
|
-
- [NotFoundErrorCode](modules.md#notfounderrorcode)
|
|
129
|
-
- [NotImplementedErrorCode](modules.md#notimplementederrorcode)
|
|
130
|
-
- [PASSING\_SCORE](modules.md#passing_score)
|
|
131
|
-
- [PromptTemplateTypes](modules.md#prompttemplatetypes)
|
|
132
|
-
- [PromptTypes](modules.md#prompttypes)
|
|
133
|
-
- [RStreamErrCode](modules.md#rstreamerrcode)
|
|
134
|
-
- [RemoteToolFuncSchema](modules.md#remotetoolfuncschema)
|
|
135
|
-
- [ResponseRStreamErrCode](modules.md#responserstreamerrcode)
|
|
136
|
-
- [SSEChannelAlreadyClosedErrCode](modules.md#ssechannelalreadyclosederrcode)
|
|
137
|
-
- [ServerToolFuncSchema](modules.md#servertoolfuncschema)
|
|
138
|
-
- [ToolAsyncCancelableBit](modules.md#toolasynccancelablebit)
|
|
139
|
-
- [ToolAsyncMultiTaskBit](modules.md#toolasyncmultitaskbit)
|
|
140
|
-
- [ToolAsyncPriorityBit](modules.md#toolasyncprioritybit)
|
|
141
|
-
- [ToolFuncSchema](modules.md#toolfuncschema)
|
|
142
|
-
- [WindowsReservedNameRegex](modules.md#windowsreservednameregex)
|
|
143
|
-
- [base32768](modules.md#base32768)
|
|
144
|
-
- [defaultTemplateFormat](modules.md#defaulttemplateformat)
|
|
145
|
-
- [event](modules.md#event)
|
|
146
|
-
- [eventClient](modules.md#eventclient)
|
|
147
|
-
- [eventServer](modules.md#eventserver)
|
|
148
|
-
- [lrucache](modules.md#lrucache)
|
|
149
|
-
- [mimeType](modules.md#mimetype)
|
|
150
|
-
- [uuidNIL](modules.md#uuidnil)
|
|
151
|
-
|
|
152
|
-
### Functions
|
|
153
|
-
|
|
154
|
-
- [AIArgProcessor](modules.md#aiargprocessor)
|
|
155
|
-
- [AIStream](modules.md#aistream)
|
|
156
|
-
- [ChoiceArgProcessor](modules.md#choiceargprocessor)
|
|
157
|
-
- [RateLimit](modules.md#ratelimit)
|
|
158
|
-
- [TemplateArgProcessor](modules.md#templateargprocessor)
|
|
159
|
-
- [\_lrucache](modules.md#_lrucache)
|
|
160
|
-
- [backendEventable](modules.md#backendeventable)
|
|
161
|
-
- [canonicalize](modules.md#canonicalize)
|
|
162
|
-
- [countRegexMatches](modules.md#countregexmatches)
|
|
163
|
-
- [createAbilityInjector](modules.md#createabilityinjector)
|
|
164
|
-
- [createCallbacksTransformer](modules.md#createcallbackstransformer)
|
|
165
|
-
- [createEmptyReadableStream](modules.md#createemptyreadablestream)
|
|
166
|
-
- [createEndWithRepetitionDetector](modules.md#createendwithrepetitiondetector)
|
|
167
|
-
- [createError](modules.md#createerror)
|
|
168
|
-
- [createEventStreamTransformer](modules.md#createeventstreamtransformer)
|
|
169
|
-
- [createHfValueFunc](modules.md#createhfvaluefunc)
|
|
170
|
-
- [createLRUCache](modules.md#createlrucache)
|
|
171
|
-
- [dateToText](modules.md#datetotext)
|
|
172
|
-
- [expandEnv](modules.md#expandenv)
|
|
173
|
-
- [expandObjEnv](modules.md#expandobjenv)
|
|
174
|
-
- [extNameLevel](modules.md#extnamelevel)
|
|
175
|
-
- [fileIsExists](modules.md#fileisexists)
|
|
176
|
-
- [filenameReservedRegex](modules.md#filenamereservedregex-1)
|
|
177
|
-
- [filterValidFnScope](modules.md#filtervalidfnscope)
|
|
178
|
-
- [findPort](modules.md#findport)
|
|
179
|
-
- [formatISO](modules.md#formatiso)
|
|
180
|
-
- [getAllEnumKeys](modules.md#getallenumkeys)
|
|
181
|
-
- [getConfigFileNames](modules.md#getconfigfilenames)
|
|
182
|
-
- [getConfigs](modules.md#getconfigs)
|
|
183
|
-
- [getKeysPath](modules.md#getkeyspath)
|
|
184
|
-
- [getMultiLevelExtname](modules.md#getmultilevelextname)
|
|
185
|
-
- [getPackageDir](modules.md#getpackagedir)
|
|
186
|
-
- [getRealFilepath](modules.md#getrealfilepath)
|
|
187
|
-
- [getResponseErrorReadableStream](modules.md#getresponseerrorreadablestream)
|
|
188
|
-
- [hfParse](modules.md#hfparse)
|
|
189
|
-
- [hfTokenize](modules.md#hftokenize)
|
|
190
|
-
- [interpolateEnv](modules.md#interpolateenv)
|
|
191
|
-
- [interpolateFString](modules.md#interpolatefstring)
|
|
192
|
-
- [interpolateGolangTemplate](modules.md#interpolategolangtemplate)
|
|
193
|
-
- [isModelNameMatched](modules.md#ismodelnamematched)
|
|
194
|
-
- [isValidFilename](modules.md#isvalidfilename)
|
|
195
|
-
- [isValidFilepath](modules.md#isvalidfilepath)
|
|
196
|
-
- [isWebStream](modules.md#iswebstream)
|
|
197
|
-
- [jsonFilterToWhere](modules.md#jsonfiltertowhere)
|
|
198
|
-
- [jsonToMarkdownStr](modules.md#jsontomarkdownstr)
|
|
199
|
-
- [loadFileFromPaths](modules.md#loadfilefrompaths)
|
|
200
|
-
- [loadTextFromPaths](modules.md#loadtextfrompaths)
|
|
201
|
-
- [makeToolFuncCancelable](modules.md#maketoolfunccancelable)
|
|
202
|
-
- [matchUrlProtocol](modules.md#matchurlprotocol)
|
|
203
|
-
- [memoize](modules.md#memoize)
|
|
204
|
-
- [messagesToText](modules.md#messagestotext)
|
|
205
|
-
- [paramsSizeToScaleStr](modules.md#paramssizetoscalestr)
|
|
206
|
-
- [parseCommand](modules.md#parsecommand)
|
|
207
|
-
- [parseDateFormat](modules.md#parsedateformat)
|
|
208
|
-
- [parseFString](modules.md#parsefstring)
|
|
209
|
-
- [parseISO](modules.md#parseiso)
|
|
210
|
-
- [parseJsJson](modules.md#parsejsjson)
|
|
211
|
-
- [parseObjectArgInfo](modules.md#parseobjectarginfo)
|
|
212
|
-
- [parseObjectArgumentInfos](modules.md#parseobjectargumentinfos)
|
|
213
|
-
- [parseObjectArguments](modules.md#parseobjectarguments)
|
|
214
|
-
- [parseObjectArgumentsAsArgInfos](modules.md#parseobjectargumentsasarginfos)
|
|
215
|
-
- [parseYaml](modules.md#parseyaml)
|
|
216
|
-
- [quoteStr](modules.md#quotestr)
|
|
217
|
-
- [reControlCharsRegex](modules.md#recontrolcharsregex)
|
|
218
|
-
- [readFilenamesRecursiveSync](modules.md#readfilenamesrecursivesync)
|
|
219
|
-
- [readableFromAsyncIterable](modules.md#readablefromasynciterable)
|
|
220
|
-
- [registerCoreTools](modules.md#registercoretools)
|
|
221
|
-
- [registerYamlTag](modules.md#registeryamltag)
|
|
222
|
-
- [sanitizeFilename](modules.md#sanitizefilename)
|
|
223
|
-
- [sanitizeFilepath](modules.md#sanitizefilepath)
|
|
224
|
-
- [saveConfigFile](modules.md#saveconfigfile)
|
|
225
|
-
- [scaleStrToParamsSize](modules.md#scalestrtoparamssize)
|
|
226
|
-
- [simplifyObjectArguments](modules.md#simplifyobjectarguments)
|
|
227
|
-
- [sortedValues](modules.md#sortedvalues)
|
|
228
|
-
- [splitSentence](modules.md#splitsentence)
|
|
229
|
-
- [stringifyYaml](modules.md#stringifyyaml)
|
|
230
|
-
- [textToDate](modules.md#texttodate)
|
|
231
|
-
- [throwError](modules.md#throwerror)
|
|
232
|
-
- [toDate](modules.md#todate)
|
|
233
|
-
- [toDateTime](modules.md#todatetime)
|
|
234
|
-
- [trimStartOfStreamHelper](modules.md#trimstartofstreamhelper)
|
|
235
|
-
- [truncTo](modules.md#truncto)
|
|
236
|
-
- [uuid](modules.md#uuid)
|
|
237
|
-
- [uuidParse](modules.md#uuidparse)
|
|
238
|
-
- [uuidStringify](modules.md#uuidstringify)
|
|
239
|
-
- [uuidValidate](modules.md#uuidvalidate)
|
|
240
|
-
- [uuidVersion](modules.md#uuidversion)
|
|
241
|
-
- [uuidv1](modules.md#uuidv1)
|
|
242
|
-
- [uuidv4](modules.md#uuidv4)
|
|
243
|
-
- [uuidv5](modules.md#uuidv5)
|
|
244
|
-
- [wait](modules.md#wait)
|
|
245
|
-
- [xxhash](modules.md#xxhash)
|
|
246
|
-
- [xxhash32](modules.md#xxhash32)
|
|
247
|
-
- [xxhash64](modules.md#xxhash64)
|
|
248
|
-
- [xxhashAsStr](modules.md#xxhashasstr)
|
|
249
|
-
|
|
250
|
-
## Common Helpers
|
|
251
|
-
|
|
252
|
-
### formatISO
|
|
253
|
-
|
|
254
|
-
▸ **formatISO**\<`DateType`\>(`date`, `options?`): `string`
|
|
255
|
-
|
|
256
|
-
#### Type parameters
|
|
257
|
-
|
|
258
|
-
| Name | Type | Description |
|
|
259
|
-
| :------ | :------ | :------ |
|
|
260
|
-
| `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). |
|
|
261
|
-
|
|
262
|
-
#### Parameters
|
|
263
|
-
|
|
264
|
-
| Name | Type | Description |
|
|
265
|
-
| :------ | :------ | :------ |
|
|
266
|
-
| `date` | `string` \| `number` \| `DateType` | The original date |
|
|
267
|
-
| `options?` | `FormatISOOptions` | An object with options. |
|
|
268
|
-
|
|
269
|
-
#### Returns
|
|
270
|
-
|
|
271
|
-
`string`
|
|
272
|
-
|
|
273
|
-
The formatted date string (in loca.l time zone)
|
|
274
|
-
|
|
275
|
-
**`Name`**
|
|
276
|
-
|
|
277
|
-
formatISO
|
|
278
|
-
|
|
279
|
-
**`Summary`**
|
|
280
|
-
|
|
281
|
-
Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).
|
|
282
|
-
|
|
283
|
-
**`Description`**
|
|
284
|
-
|
|
285
|
-
Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.
|
|
286
|
-
|
|
287
|
-
**`Throws`**
|
|
288
|
-
|
|
289
|
-
`date` must not be Invalid Date
|
|
290
|
-
|
|
291
|
-
**`Example`**
|
|
292
|
-
|
|
293
|
-
```ts
|
|
294
|
-
// Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):
|
|
295
|
-
const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))
|
|
296
|
-
//=> '2019-09-18T19:00:52Z'
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
**`Example`**
|
|
300
|
-
|
|
301
|
-
```ts
|
|
302
|
-
// Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):
|
|
303
|
-
const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })
|
|
304
|
-
//=> '20190918T190052'
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
**`Example`**
|
|
308
|
-
|
|
309
|
-
```ts
|
|
310
|
-
// Represent 18 September 2019 in ISO 8601 format, date only:
|
|
311
|
-
const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })
|
|
312
|
-
//=> '2019-09-18'
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
**`Example`**
|
|
316
|
-
|
|
317
|
-
```ts
|
|
318
|
-
// Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):
|
|
319
|
-
const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })
|
|
320
|
-
//=> '19:00:52Z'
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
#### Defined in
|
|
324
|
-
|
|
325
|
-
node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/formatISO.d.ts:43
|
|
326
|
-
|
|
327
|
-
___
|
|
328
|
-
|
|
329
|
-
### parseDateFormat
|
|
330
|
-
|
|
331
|
-
▸ **parseDateFormat**\<`DateType`\>(`dateStr`, `formatStr`, `referenceDate`, `options?`): `DateType`
|
|
332
|
-
|
|
333
|
-
#### Type parameters
|
|
334
|
-
|
|
335
|
-
| Name | Type | Description |
|
|
336
|
-
| :------ | :------ | :------ |
|
|
337
|
-
| `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). |
|
|
338
|
-
|
|
339
|
-
#### Parameters
|
|
340
|
-
|
|
341
|
-
| Name | Type | Description |
|
|
342
|
-
| :------ | :------ | :------ |
|
|
343
|
-
| `dateStr` | `string` | The string to parse |
|
|
344
|
-
| `formatStr` | `string` | The string of tokens |
|
|
345
|
-
| `referenceDate` | `string` \| `number` \| `DateType` | defines values missing from the parsed dateString |
|
|
346
|
-
| `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 |
|
|
347
|
-
|
|
348
|
-
#### Returns
|
|
349
|
-
|
|
350
|
-
`DateType`
|
|
351
|
-
|
|
352
|
-
The parsed date
|
|
353
|
-
|
|
354
|
-
**`Name`**
|
|
355
|
-
|
|
356
|
-
parse
|
|
357
|
-
|
|
358
|
-
**`Summary`**
|
|
359
|
-
|
|
360
|
-
Parse the date.
|
|
361
|
-
|
|
362
|
-
**`Description`**
|
|
363
|
-
|
|
364
|
-
Return the date parsed from string using the given format string.
|
|
365
|
-
|
|
366
|
-
> ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
|
|
367
|
-
> See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
368
|
-
|
|
369
|
-
The characters in the format string wrapped between two single quotes characters (') are escaped.
|
|
370
|
-
Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
|
|
371
|
-
|
|
372
|
-
Format of the format string is based on Unicode Technical Standard #35:
|
|
373
|
-
https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
374
|
-
with a few additions (see note 5 below the table).
|
|
375
|
-
|
|
376
|
-
Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
|
|
377
|
-
and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
|
|
378
|
-
|
|
379
|
-
```javascript
|
|
380
|
-
parse('23 AM', 'HH a', new Date())
|
|
381
|
-
//=> RangeError: The format string mustn't contain `HH` and `a` at the same time
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
|
|
385
|
-
|
|
386
|
-
Accepted format string patterns:
|
|
387
|
-
| Unit |Prior| Pattern | Result examples | Notes |
|
|
388
|
-
|---------------------------------|-----|---------|-----------------------------------|-------|
|
|
389
|
-
| Era | 140 | G..GGG | AD, BC | |
|
|
390
|
-
| | | GGGG | Anno Domini, Before Christ | 2 |
|
|
391
|
-
| | | GGGGG | A, B | |
|
|
392
|
-
| Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
|
|
393
|
-
| | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
|
|
394
|
-
| | | yy | 44, 01, 00, 17 | 4 |
|
|
395
|
-
| | | yyy | 044, 001, 123, 999 | 4 |
|
|
396
|
-
| | | yyyy | 0044, 0001, 1900, 2017 | 4 |
|
|
397
|
-
| | | yyyyy | ... | 2,4 |
|
|
398
|
-
| Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
|
|
399
|
-
| | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
|
|
400
|
-
| | | YY | 44, 01, 00, 17 | 4,6 |
|
|
401
|
-
| | | YYY | 044, 001, 123, 999 | 4 |
|
|
402
|
-
| | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
|
|
403
|
-
| | | YYYYY | ... | 2,4 |
|
|
404
|
-
| ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
|
|
405
|
-
| | | RR | -43, 01, 00, 17 | 4,5 |
|
|
406
|
-
| | | RRR | -043, 001, 123, 999, -999 | 4,5 |
|
|
407
|
-
| | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
|
|
408
|
-
| | | RRRRR | ... | 2,4,5 |
|
|
409
|
-
| Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
|
|
410
|
-
| | | uu | -43, 01, 99, -99 | 4 |
|
|
411
|
-
| | | uuu | -043, 001, 123, 999, -999 | 4 |
|
|
412
|
-
| | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
|
|
413
|
-
| | | uuuuu | ... | 2,4 |
|
|
414
|
-
| Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
|
|
415
|
-
| | | Qo | 1st, 2nd, 3rd, 4th | 5 |
|
|
416
|
-
| | | QQ | 01, 02, 03, 04 | |
|
|
417
|
-
| | | QQQ | Q1, Q2, Q3, Q4 | |
|
|
418
|
-
| | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
|
|
419
|
-
| | | QQQQQ | 1, 2, 3, 4 | 4 |
|
|
420
|
-
| Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
|
|
421
|
-
| | | qo | 1st, 2nd, 3rd, 4th | 5 |
|
|
422
|
-
| | | qq | 01, 02, 03, 04 | |
|
|
423
|
-
| | | qqq | Q1, Q2, Q3, Q4 | |
|
|
424
|
-
| | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
|
|
425
|
-
| | | qqqqq | 1, 2, 3, 4 | 3 |
|
|
426
|
-
| Month (formatting) | 110 | M | 1, 2, ..., 12 | |
|
|
427
|
-
| | | Mo | 1st, 2nd, ..., 12th | 5 |
|
|
428
|
-
| | | MM | 01, 02, ..., 12 | |
|
|
429
|
-
| | | MMM | Jan, Feb, ..., Dec | |
|
|
430
|
-
| | | MMMM | January, February, ..., December | 2 |
|
|
431
|
-
| | | MMMMM | J, F, ..., D | |
|
|
432
|
-
| Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
|
|
433
|
-
| | | Lo | 1st, 2nd, ..., 12th | 5 |
|
|
434
|
-
| | | LL | 01, 02, ..., 12 | |
|
|
435
|
-
| | | LLL | Jan, Feb, ..., Dec | |
|
|
436
|
-
| | | LLLL | January, February, ..., December | 2 |
|
|
437
|
-
| | | LLLLL | J, F, ..., D | |
|
|
438
|
-
| Local week of year | 100 | w | 1, 2, ..., 53 | |
|
|
439
|
-
| | | wo | 1st, 2nd, ..., 53th | 5 |
|
|
440
|
-
| | | ww | 01, 02, ..., 53 | |
|
|
441
|
-
| ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
|
|
442
|
-
| | | Io | 1st, 2nd, ..., 53th | 5 |
|
|
443
|
-
| | | II | 01, 02, ..., 53 | 5 |
|
|
444
|
-
| Day of month | 90 | d | 1, 2, ..., 31 | |
|
|
445
|
-
| | | do | 1st, 2nd, ..., 31st | 5 |
|
|
446
|
-
| | | dd | 01, 02, ..., 31 | |
|
|
447
|
-
| Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
|
|
448
|
-
| | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
|
|
449
|
-
| | | DD | 01, 02, ..., 365, 366 | 7 |
|
|
450
|
-
| | | DDD | 001, 002, ..., 365, 366 | |
|
|
451
|
-
| | | DDDD | ... | 2 |
|
|
452
|
-
| Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |
|
|
453
|
-
| | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
|
|
454
|
-
| | | EEEEE | M, T, W, T, F, S, S | |
|
|
455
|
-
| | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
456
|
-
| ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
|
|
457
|
-
| | | io | 1st, 2nd, ..., 7th | 5 |
|
|
458
|
-
| | | ii | 01, 02, ..., 07 | 5 |
|
|
459
|
-
| | | iii | Mon, Tue, Wed, ..., Sun | 5 |
|
|
460
|
-
| | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
|
|
461
|
-
| | | iiiii | M, T, W, T, F, S, S | 5 |
|
|
462
|
-
| | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |
|
|
463
|
-
| Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
|
|
464
|
-
| | | eo | 2nd, 3rd, ..., 1st | 5 |
|
|
465
|
-
| | | ee | 02, 03, ..., 01 | |
|
|
466
|
-
| | | eee | Mon, Tue, Wed, ..., Sun | |
|
|
467
|
-
| | | eeee | Monday, Tuesday, ..., Sunday | 2 |
|
|
468
|
-
| | | eeeee | M, T, W, T, F, S, S | |
|
|
469
|
-
| | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
470
|
-
| Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
|
|
471
|
-
| | | co | 2nd, 3rd, ..., 1st | 5 |
|
|
472
|
-
| | | cc | 02, 03, ..., 01 | |
|
|
473
|
-
| | | ccc | Mon, Tue, Wed, ..., Sun | |
|
|
474
|
-
| | | cccc | Monday, Tuesday, ..., Sunday | 2 |
|
|
475
|
-
| | | ccccc | M, T, W, T, F, S, S | |
|
|
476
|
-
| | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
477
|
-
| AM, PM | 80 | a..aaa | AM, PM | |
|
|
478
|
-
| | | aaaa | a.m., p.m. | 2 |
|
|
479
|
-
| | | aaaaa | a, p | |
|
|
480
|
-
| AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
|
|
481
|
-
| | | bbbb | a.m., p.m., noon, midnight | 2 |
|
|
482
|
-
| | | bbbbb | a, p, n, mi | |
|
|
483
|
-
| Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
|
|
484
|
-
| | | BBBB | at night, in the morning, ... | 2 |
|
|
485
|
-
| | | BBBBB | at night, in the morning, ... | |
|
|
486
|
-
| Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
|
|
487
|
-
| | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
|
|
488
|
-
| | | hh | 01, 02, ..., 11, 12 | |
|
|
489
|
-
| Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
|
|
490
|
-
| | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
|
|
491
|
-
| | | HH | 00, 01, 02, ..., 23 | |
|
|
492
|
-
| Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
|
|
493
|
-
| | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
|
|
494
|
-
| | | KK | 01, 02, ..., 11, 00 | |
|
|
495
|
-
| Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
|
|
496
|
-
| | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
|
|
497
|
-
| | | kk | 24, 01, 02, ..., 23 | |
|
|
498
|
-
| Minute | 60 | m | 0, 1, ..., 59 | |
|
|
499
|
-
| | | mo | 0th, 1st, ..., 59th | 5 |
|
|
500
|
-
| | | mm | 00, 01, ..., 59 | |
|
|
501
|
-
| Second | 50 | s | 0, 1, ..., 59 | |
|
|
502
|
-
| | | so | 0th, 1st, ..., 59th | 5 |
|
|
503
|
-
| | | ss | 00, 01, ..., 59 | |
|
|
504
|
-
| Seconds timestamp | 40 | t | 512969520 | |
|
|
505
|
-
| | | tt | ... | 2 |
|
|
506
|
-
| Fraction of second | 30 | S | 0, 1, ..., 9 | |
|
|
507
|
-
| | | SS | 00, 01, ..., 99 | |
|
|
508
|
-
| | | SSS | 000, 001, ..., 999 | |
|
|
509
|
-
| | | SSSS | ... | 2 |
|
|
510
|
-
| Milliseconds timestamp | 20 | T | 512969520900 | |
|
|
511
|
-
| | | TT | ... | 2 |
|
|
512
|
-
| Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
|
|
513
|
-
| | | XX | -0800, +0530, Z | |
|
|
514
|
-
| | | XXX | -08:00, +05:30, Z | |
|
|
515
|
-
| | | XXXX | -0800, +0530, Z, +123456 | 2 |
|
|
516
|
-
| | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
|
|
517
|
-
| Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
|
|
518
|
-
| | | xx | -0800, +0530, +0000 | |
|
|
519
|
-
| | | xxx | -08:00, +05:30, +00:00 | 2 |
|
|
520
|
-
| | | xxxx | -0800, +0530, +0000, +123456 | |
|
|
521
|
-
| | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
|
|
522
|
-
| Long localized date | NA | P | 05/29/1453 | 5,8 |
|
|
523
|
-
| | | PP | May 29, 1453 | |
|
|
524
|
-
| | | PPP | May 29th, 1453 | |
|
|
525
|
-
| | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
|
|
526
|
-
| Long localized time | NA | p | 12:00 AM | 5,8 |
|
|
527
|
-
| | | pp | 12:00:00 AM | |
|
|
528
|
-
| Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
|
|
529
|
-
| | | PPpp | May 29, 1453, 12:00:00 AM | |
|
|
530
|
-
| | | PPPpp | May 29th, 1453 at ... | |
|
|
531
|
-
| | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
|
|
532
|
-
Notes:
|
|
533
|
-
1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
|
|
534
|
-
are the same as "stand-alone" units, but are different in some languages.
|
|
535
|
-
"Formatting" units are declined according to the rules of the language
|
|
536
|
-
in the context of a date. "Stand-alone" units are always nominative singular.
|
|
537
|
-
In `format` function, they will produce different result:
|
|
538
|
-
|
|
539
|
-
`format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
|
|
540
|
-
|
|
541
|
-
`format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
|
|
542
|
-
|
|
543
|
-
`parse` will try to match both formatting and stand-alone units interchangably.
|
|
544
|
-
|
|
545
|
-
2. Any sequence of the identical letters is a pattern, unless it is escaped by
|
|
546
|
-
the single quote characters (see below).
|
|
547
|
-
If the sequence is longer than listed in table:
|
|
548
|
-
- for numerical units (`yyyyyyyy`) `parse` will try to match a number
|
|
549
|
-
as wide as the sequence
|
|
550
|
-
- for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.
|
|
551
|
-
These variations are marked with "2" in the last column of the table.
|
|
552
|
-
|
|
553
|
-
3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
|
|
554
|
-
These tokens represent the shortest form of the quarter.
|
|
555
|
-
|
|
556
|
-
4. The main difference between `y` and `u` patterns are B.C. years:
|
|
557
|
-
|
|
558
|
-
| Year | `y` | `u` |
|
|
559
|
-
|------|-----|-----|
|
|
560
|
-
| AC 1 | 1 | 1 |
|
|
561
|
-
| BC 1 | 1 | 0 |
|
|
562
|
-
| BC 2 | 2 | -1 |
|
|
563
|
-
|
|
564
|
-
Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
|
|
565
|
-
|
|
566
|
-
`parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`
|
|
567
|
-
|
|
568
|
-
`parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`
|
|
569
|
-
|
|
570
|
-
while `uu` will just assign the year as is:
|
|
571
|
-
|
|
572
|
-
`parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`
|
|
573
|
-
|
|
574
|
-
`parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`
|
|
575
|
-
|
|
576
|
-
The same difference is true for local and ISO week-numbering years (`Y` and `R`),
|
|
577
|
-
except local week-numbering years are dependent on `options.weekStartsOn`
|
|
578
|
-
and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)
|
|
579
|
-
and [setWeekYear](https://date-fns.org/docs/setWeekYear)).
|
|
580
|
-
|
|
581
|
-
5. These patterns are not in the Unicode Technical Standard #35:
|
|
582
|
-
- `i`: ISO day of week
|
|
583
|
-
- `I`: ISO week of year
|
|
584
|
-
- `R`: ISO week-numbering year
|
|
585
|
-
- `o`: ordinal number modifier
|
|
586
|
-
- `P`: long localized date
|
|
587
|
-
- `p`: long localized time
|
|
588
|
-
|
|
589
|
-
6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
|
|
590
|
-
You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
591
|
-
|
|
592
|
-
7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
|
|
593
|
-
You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
594
|
-
|
|
595
|
-
8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
|
|
596
|
-
on the given locale.
|
|
597
|
-
|
|
598
|
-
using `en-US` locale: `P` => `MM/dd/yyyy`
|
|
599
|
-
using `en-US` locale: `p` => `hh:mm a`
|
|
600
|
-
using `pt-BR` locale: `P` => `dd/MM/yyyy`
|
|
601
|
-
using `pt-BR` locale: `p` => `HH:mm`
|
|
602
|
-
|
|
603
|
-
Values will be assigned to the date in the descending order of its unit's priority.
|
|
604
|
-
Units of an equal priority overwrite each other in the order of appearance.
|
|
605
|
-
|
|
606
|
-
If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),
|
|
607
|
-
the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.
|
|
608
|
-
|
|
609
|
-
`referenceDate` must be passed for correct work of the function.
|
|
610
|
-
If you're not sure which `referenceDate` to supply, create a new instance of Date:
|
|
611
|
-
`parse('02/11/2014', 'MM/dd/yyyy', new Date())`
|
|
612
|
-
In this case parsing will be done in the context of the current date.
|
|
613
|
-
If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,
|
|
614
|
-
then `Invalid Date` will be returned.
|
|
615
|
-
|
|
616
|
-
The result may vary by locale.
|
|
617
|
-
|
|
618
|
-
If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
|
|
619
|
-
|
|
620
|
-
If parsing failed, `Invalid Date` will be returned.
|
|
621
|
-
Invalid Date is a Date, whose time value is NaN.
|
|
622
|
-
Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
623
|
-
|
|
624
|
-
**`Throws`**
|
|
625
|
-
|
|
626
|
-
`options.locale` must contain `match` property
|
|
627
|
-
|
|
628
|
-
**`Throws`**
|
|
629
|
-
|
|
630
|
-
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
|
|
631
|
-
|
|
632
|
-
**`Throws`**
|
|
633
|
-
|
|
634
|
-
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
|
|
635
|
-
|
|
636
|
-
**`Throws`**
|
|
637
|
-
|
|
638
|
-
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
|
|
639
|
-
|
|
640
|
-
**`Throws`**
|
|
641
|
-
|
|
642
|
-
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
|
|
643
|
-
|
|
644
|
-
**`Throws`**
|
|
645
|
-
|
|
646
|
-
format string contains an unescaped latin alphabet character
|
|
647
|
-
|
|
648
|
-
**`Example`**
|
|
649
|
-
|
|
650
|
-
```ts
|
|
651
|
-
// Parse 11 February 2014 from middle-endian format:
|
|
652
|
-
var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())
|
|
653
|
-
//=> Tue Feb 11 2014 00:00:00
|
|
654
|
-
```
|
|
655
|
-
|
|
656
|
-
**`Example`**
|
|
657
|
-
|
|
658
|
-
```ts
|
|
659
|
-
// Parse 28th of February in Esperanto locale in the context of 2010 year:
|
|
660
|
-
import eo from 'date-fns/locale/eo'
|
|
661
|
-
var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), {
|
|
662
|
-
locale: eo
|
|
663
|
-
})
|
|
664
|
-
//=> Sun Feb 28 2010 00:00:00
|
|
665
|
-
```
|
|
666
|
-
|
|
667
|
-
#### Defined in
|
|
668
|
-
|
|
669
|
-
node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parse.d.ts:315
|
|
670
|
-
|
|
671
|
-
___
|
|
672
|
-
|
|
673
|
-
### parseISO
|
|
674
|
-
|
|
675
|
-
▸ **parseISO**(`argument`, `options?`): `Date`
|
|
676
|
-
|
|
677
|
-
#### Parameters
|
|
678
|
-
|
|
679
|
-
| Name | Type | Description |
|
|
680
|
-
| :------ | :------ | :------ |
|
|
681
|
-
| `argument` | `string` | The value to convert |
|
|
682
|
-
| `options?` | `ParseISOOptions` | An object with options |
|
|
683
|
-
|
|
684
|
-
#### Returns
|
|
685
|
-
|
|
686
|
-
`Date`
|
|
687
|
-
|
|
688
|
-
The parsed date in the local time zone
|
|
689
|
-
|
|
690
|
-
**`Name`**
|
|
691
|
-
|
|
692
|
-
parseISO
|
|
693
|
-
|
|
694
|
-
**`Summary`**
|
|
695
|
-
|
|
696
|
-
Parse ISO string
|
|
697
|
-
|
|
698
|
-
**`Description`**
|
|
699
|
-
|
|
700
|
-
Parse the given string in ISO 8601 format and return an instance of Date.
|
|
701
|
-
|
|
702
|
-
Function accepts complete ISO 8601 formats as well as partial implementations.
|
|
703
|
-
ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
|
|
704
|
-
|
|
705
|
-
If the argument isn't a string, the function cannot parse the string or
|
|
706
|
-
the values are invalid, it returns Invalid Date.
|
|
707
|
-
|
|
708
|
-
**`Example`**
|
|
709
|
-
|
|
710
|
-
```ts
|
|
711
|
-
// Convert string '2014-02-11T11:30:30' to date:
|
|
712
|
-
const result = parseISO('2014-02-11T11:30:30')
|
|
713
|
-
//=> Tue Feb 11 2014 11:30:30
|
|
714
|
-
```
|
|
715
|
-
|
|
716
|
-
**`Example`**
|
|
717
|
-
|
|
718
|
-
```ts
|
|
719
|
-
// Convert string '+02014101' to date,
|
|
720
|
-
// if the additional number of digits in the extended year format is 1:
|
|
721
|
-
const result = parseISO('+02014101', { additionalDigits: 1 })
|
|
722
|
-
//=> Fri Apr 11 2014 00:00:00
|
|
723
|
-
```
|
|
724
|
-
|
|
725
|
-
#### Defined in
|
|
726
|
-
|
|
727
|
-
node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/parseISO.d.ts:40
|
|
728
|
-
|
|
729
|
-
___
|
|
730
|
-
|
|
731
|
-
### toDate
|
|
732
|
-
|
|
733
|
-
▸ **toDate**\<`DateType`\>(`argument`): `DateType`
|
|
734
|
-
|
|
735
|
-
#### Type parameters
|
|
736
|
-
|
|
737
|
-
| Name | Type | Description |
|
|
738
|
-
| :------ | :------ | :------ |
|
|
739
|
-
| `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). |
|
|
740
|
-
|
|
741
|
-
#### Parameters
|
|
742
|
-
|
|
743
|
-
| Name | Type | Description |
|
|
744
|
-
| :------ | :------ | :------ |
|
|
745
|
-
| `argument` | `string` \| `number` \| `DateType` | The value to convert |
|
|
746
|
-
|
|
747
|
-
#### Returns
|
|
748
|
-
|
|
749
|
-
`DateType`
|
|
750
|
-
|
|
751
|
-
The parsed date in the local time zone
|
|
752
|
-
|
|
753
|
-
**`Name`**
|
|
754
|
-
|
|
755
|
-
toDate
|
|
756
|
-
|
|
757
|
-
**`Summary`**
|
|
758
|
-
|
|
759
|
-
Convert the given argument to an instance of Date.
|
|
760
|
-
|
|
761
|
-
**`Description`**
|
|
762
|
-
|
|
763
|
-
Convert the given argument to an instance of Date.
|
|
764
|
-
|
|
765
|
-
If the argument is an instance of Date, the function returns its clone.
|
|
766
|
-
|
|
767
|
-
If the argument is a number, it is treated as a timestamp.
|
|
768
|
-
|
|
769
|
-
If the argument is none of the above, the function returns Invalid Date.
|
|
770
|
-
|
|
771
|
-
**Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
772
|
-
|
|
773
|
-
**`Example`**
|
|
774
|
-
|
|
775
|
-
```ts
|
|
776
|
-
// Clone the date:
|
|
777
|
-
const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
778
|
-
//=> Tue Feb 11 2014 11:30:30
|
|
779
|
-
```
|
|
780
|
-
|
|
781
|
-
**`Example`**
|
|
782
|
-
|
|
783
|
-
```ts
|
|
784
|
-
// Convert the timestamp to date:
|
|
785
|
-
const result = toDate(1392098430000)
|
|
786
|
-
//=> Tue Feb 11 2014 11:30:30
|
|
787
|
-
```
|
|
788
|
-
|
|
789
|
-
#### Defined in
|
|
790
|
-
|
|
791
|
-
node_modules/.pnpm/date-fns@3.6.0/node_modules/date-fns/toDate.d.ts:33
|
|
792
|
-
|
|
793
|
-
## Other
|
|
794
|
-
|
|
795
|
-
### AIChatContentPart
|
|
796
|
-
|
|
797
|
-
Ƭ **AIChatContentPart**: [`AIChatContentPartText`](interfaces/AIChatContentPartText.md) \| [`AIChatContentPartImage`](interfaces/AIChatContentPartImage.md)
|
|
798
|
-
|
|
799
|
-
#### Defined in
|
|
800
|
-
|
|
801
|
-
[packages/ai-tool/src/utils/chat.ts:74](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/chat.ts#L74)
|
|
802
|
-
|
|
803
|
-
___
|
|
804
|
-
|
|
805
|
-
### AIChatMessageParam
|
|
806
|
-
|
|
807
|
-
Ƭ **AIChatMessageParam**: [`AIChatSystemMessageParam`](interfaces/AIChatSystemMessageParam.md) \| [`AIChatUserMessageParam`](interfaces/AIChatUserMessageParam.md) \| [`AIChatAssistantMessageParam`](interfaces/AIChatAssistantMessageParam.md) \| [`AIChatToolMessageParam`](interfaces/AIChatToolMessageParam.md)
|
|
808
|
-
|
|
809
|
-
#### Defined in
|
|
810
|
-
|
|
811
|
-
[packages/ai-tool/src/utils/chat.ts:44](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/chat.ts#L44)
|
|
812
|
-
|
|
813
|
-
___
|
|
814
|
-
|
|
815
|
-
### AIChatRole
|
|
816
|
-
|
|
817
|
-
Ƭ **AIChatRole**: typeof [`AIChatRoles`](modules.md#aichatroles)[`number`] & `string`
|
|
818
|
-
|
|
819
|
-
#### Defined in
|
|
820
|
-
|
|
821
|
-
[packages/ai-tool/src/utils/chat.ts:42](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/chat.ts#L42)
|
|
822
|
-
|
|
823
|
-
___
|
|
824
|
-
|
|
825
|
-
### AIMessageType
|
|
826
|
-
|
|
827
|
-
Ƭ **AIMessageType**: typeof [`AIMessageTypes`](modules.md#aimessagetypes)[`number`]
|
|
828
|
-
|
|
829
|
-
#### Defined in
|
|
830
|
-
|
|
831
|
-
[packages/ai-tool/src/utils/chat.ts:36](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/chat.ts#L36)
|
|
832
|
-
|
|
833
|
-
___
|
|
834
|
-
|
|
835
|
-
### AIModelNameRule
|
|
836
|
-
|
|
837
|
-
Ƭ **AIModelNameRule**: `string` \| `RegExp` \| [`AIModelNameRuleFn`](modules.md#aimodelnamerulefn)
|
|
838
|
-
|
|
839
|
-
#### Defined in
|
|
840
|
-
|
|
841
|
-
[packages/ai-tool/src/utils/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/consts.ts#L10)
|
|
842
|
-
|
|
843
|
-
___
|
|
844
|
-
|
|
845
|
-
### AIModelNameRuleFn
|
|
846
|
-
|
|
847
|
-
Ƭ **AIModelNameRuleFn**: (`name`: `string`) => `string` \| `RegExpExecArray` \| `undefined`
|
|
848
|
-
|
|
849
|
-
#### Type declaration
|
|
850
|
-
|
|
851
|
-
▸ (`name`): `string` \| `RegExpExecArray` \| `undefined`
|
|
852
|
-
|
|
853
|
-
##### Parameters
|
|
854
|
-
|
|
855
|
-
| Name | Type |
|
|
856
|
-
| :------ | :------ |
|
|
857
|
-
| `name` | `string` |
|
|
858
|
-
|
|
859
|
-
##### Returns
|
|
860
|
-
|
|
861
|
-
`string` \| `RegExpExecArray` \| `undefined`
|
|
862
|
-
|
|
863
|
-
#### Defined in
|
|
864
|
-
|
|
865
|
-
[packages/ai-tool/src/utils/consts.ts:8](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/consts.ts#L8)
|
|
866
|
-
|
|
867
|
-
___
|
|
868
|
-
|
|
869
|
-
### AIModelNameRules
|
|
870
|
-
|
|
871
|
-
Ƭ **AIModelNameRules**: [`AIModelNameRule`](modules.md#aimodelnamerule) \| [`AIModelNameRule`](modules.md#aimodelnamerule)[]
|
|
872
|
-
|
|
873
|
-
#### Defined in
|
|
874
|
-
|
|
875
|
-
[packages/ai-tool/src/utils/consts.ts:11](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/consts.ts#L11)
|
|
876
|
-
|
|
877
|
-
___
|
|
878
|
-
|
|
879
|
-
### AITextGenerationFinishReason
|
|
880
|
-
|
|
881
|
-
Ƭ **AITextGenerationFinishReason**: typeof [`AITextGenerationFinishReasons`](modules.md#aitextgenerationfinishreasons)[`number`]
|
|
882
|
-
|
|
883
|
-
#### Defined in
|
|
884
|
-
|
|
885
|
-
[packages/ai-tool/src/utils/chat.ts:13](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/chat.ts#L13)
|
|
886
|
-
|
|
887
|
-
___
|
|
888
|
-
|
|
889
|
-
### ActionName
|
|
890
|
-
|
|
891
|
-
Ƭ **ActionName**: typeof [`ActionNames`](modules.md#actionnames)[`number`]
|
|
892
|
-
|
|
893
|
-
#### Defined in
|
|
894
|
-
|
|
895
|
-
[packages/ai-tool/src/utils/consts.ts:6](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/consts.ts#L6)
|
|
896
|
-
|
|
897
|
-
___
|
|
898
|
-
|
|
899
|
-
### AsyncTaskId
|
|
900
|
-
|
|
901
|
-
Ƭ **AsyncTaskId**: `string` \| `number`
|
|
902
|
-
|
|
903
|
-
#### Defined in
|
|
904
|
-
|
|
905
|
-
[packages/ai-tool/src/utils/cancelable-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/cancelable-ability.ts#L8)
|
|
906
|
-
|
|
907
|
-
___
|
|
908
|
-
|
|
909
|
-
### EventErrorListenerFn
|
|
910
|
-
|
|
911
|
-
Ƭ **EventErrorListenerFn**: (`this`: `Event`, `err`: `Error`, `name`: `string`, ...`args`: `any`) => `any`
|
|
912
|
-
|
|
913
|
-
#### Type declaration
|
|
914
|
-
|
|
915
|
-
▸ (`this`, `err`, `name`, `...args`): `any`
|
|
916
|
-
|
|
917
|
-
##### Parameters
|
|
918
|
-
|
|
919
|
-
| Name | Type |
|
|
920
|
-
| :------ | :------ |
|
|
921
|
-
| `this` | `Event` |
|
|
922
|
-
| `err` | `Error` |
|
|
923
|
-
| `name` | `string` |
|
|
924
|
-
| `...args` | `any` |
|
|
925
|
-
|
|
926
|
-
##### Returns
|
|
927
|
-
|
|
928
|
-
`any`
|
|
929
|
-
|
|
930
|
-
#### Defined in
|
|
931
|
-
|
|
932
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:9](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/event/event-ability.ts#L9)
|
|
933
|
-
|
|
934
|
-
___
|
|
935
|
-
|
|
936
|
-
### EventListenerFn
|
|
937
|
-
|
|
938
|
-
Ƭ **EventListenerFn**: (`this`: `Event`, `name`: `string`, ...`args`: `any`) => `any`
|
|
939
|
-
|
|
940
|
-
#### Type declaration
|
|
941
|
-
|
|
942
|
-
▸ (`this`, `name`, `...args`): `any`
|
|
943
|
-
|
|
944
|
-
##### Parameters
|
|
945
|
-
|
|
946
|
-
| Name | Type |
|
|
947
|
-
| :------ | :------ |
|
|
948
|
-
| `this` | `Event` |
|
|
949
|
-
| `name` | `string` |
|
|
950
|
-
| `...args` | `any` |
|
|
951
|
-
|
|
952
|
-
##### Returns
|
|
953
|
-
|
|
954
|
-
`any`
|
|
955
|
-
|
|
956
|
-
#### Defined in
|
|
957
|
-
|
|
958
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/event/event-ability.ts#L8)
|
|
959
|
-
|
|
960
|
-
___
|
|
961
|
-
|
|
962
|
-
### FStringPromptTemplateNode
|
|
963
|
-
|
|
964
|
-
Ƭ **FStringPromptTemplateNode**: \{ `text`: `string` ; `type`: ``"literal"`` } \| \{ `name`: `string` ; `type`: ``"variable"`` }
|
|
965
|
-
|
|
966
|
-
Type that represents a node in a parsed format string. It can be either
|
|
967
|
-
a literal text or a variable name.
|
|
968
|
-
|
|
969
|
-
#### Defined in
|
|
970
|
-
|
|
971
|
-
[packages/ai-tool/src/utils/prompt/template/python.ts:6](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/template/python.ts#L6)
|
|
972
|
-
|
|
973
|
-
___
|
|
974
|
-
|
|
975
|
-
### FuncParamType
|
|
976
|
-
|
|
977
|
-
Ƭ **FuncParamType**: `string`
|
|
978
|
-
|
|
979
|
-
#### Defined in
|
|
980
|
-
|
|
981
|
-
[packages/ai-tool/src/tool-func.ts:24](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/tool-func.ts#L24)
|
|
982
|
-
|
|
983
|
-
___
|
|
984
|
-
|
|
985
|
-
### PromptExamples
|
|
986
|
-
|
|
987
|
-
Ƭ **PromptExamples**\<`T`\>: `Iterable`\<`PromiseLike`\<`T`\> \| `T`\> \| `AsyncIterable`\<`T`\>
|
|
988
|
-
|
|
989
|
-
#### Type parameters
|
|
990
|
-
|
|
991
|
-
| Name | Type |
|
|
992
|
-
| :------ | :------ |
|
|
993
|
-
| `T` | `any` |
|
|
994
|
-
|
|
995
|
-
#### Defined in
|
|
996
|
-
|
|
997
|
-
[packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:3](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/prompt-example-selector.ts#L3)
|
|
998
|
-
|
|
999
|
-
___
|
|
1000
|
-
|
|
1001
|
-
### PromptTemplateType
|
|
1002
|
-
|
|
1003
|
-
Ƭ **PromptTemplateType**: typeof [`PromptTemplateTypes`](modules.md#prompttemplatetypes)[`number`]
|
|
1004
|
-
|
|
1005
|
-
#### Defined in
|
|
1006
|
-
|
|
1007
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:17](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/consts.ts#L17)
|
|
1008
|
-
|
|
1009
|
-
___
|
|
1010
|
-
|
|
1011
|
-
### PromptType
|
|
1012
|
-
|
|
1013
|
-
Ƭ **PromptType**: typeof [`PromptTypes`](modules.md#prompttypes)[`number`]
|
|
1014
|
-
|
|
1015
|
-
#### Defined in
|
|
1016
|
-
|
|
1017
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/consts.ts#L10)
|
|
1018
|
-
|
|
1019
|
-
___
|
|
1020
|
-
|
|
1021
|
-
### TFunc
|
|
1022
|
-
|
|
1023
|
-
Ƭ **TFunc**: (`this`: [`ToolFunc`](classes/ToolFunc.md), ...`params`: `any`[]) => `any`
|
|
1024
|
-
|
|
1025
|
-
#### Type declaration
|
|
1026
|
-
|
|
1027
|
-
▸ (`this`, `...params`): `any`
|
|
1028
|
-
|
|
1029
|
-
##### Parameters
|
|
1030
|
-
|
|
1031
|
-
| Name | Type |
|
|
1032
|
-
| :------ | :------ |
|
|
1033
|
-
| `this` | [`ToolFunc`](classes/ToolFunc.md) |
|
|
1034
|
-
| `...params` | `any`[] |
|
|
1035
|
-
|
|
1036
|
-
##### Returns
|
|
1037
|
-
|
|
1038
|
-
`any`
|
|
1039
|
-
|
|
1040
|
-
#### Defined in
|
|
1041
|
-
|
|
1042
|
-
[packages/ai-tool/src/tool-func.ts:38](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/tool-func.ts#L38)
|
|
1043
|
-
|
|
1044
|
-
___
|
|
1045
|
-
|
|
1046
|
-
### AIChatRoles
|
|
1047
|
-
|
|
1048
|
-
• `Const` **AIChatRoles**: readonly [``"user"``, ``"assistant"``, ``"system"``, ``"tool"``, ``"tool_calls"``]
|
|
1049
|
-
|
|
1050
|
-
#### Defined in
|
|
1051
|
-
|
|
1052
|
-
[packages/ai-tool/src/utils/chat.ts:41](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/chat.ts#L41)
|
|
1053
|
-
|
|
1054
|
-
___
|
|
1055
|
-
|
|
1056
|
-
### AIMessageTypes
|
|
1057
|
-
|
|
1058
|
-
• `Const` **AIMessageTypes**: readonly [``"human"``, ``"ai"``, ``"generic"``, ``"system"``, ``"tool"``]
|
|
1059
|
-
|
|
1060
|
-
#### Defined in
|
|
1061
|
-
|
|
1062
|
-
[packages/ai-tool/src/utils/chat.ts:35](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/chat.ts#L35)
|
|
1063
|
-
|
|
1064
|
-
___
|
|
1065
|
-
|
|
1066
|
-
### AITextGenerationFinishReasons
|
|
1067
|
-
|
|
1068
|
-
• `Const` **AITextGenerationFinishReasons**: readonly [``"stop"``, ``"length"``, ``"content-filter"``, ``"tool-calls"``, ``"abort"``, ``"error"``, ``"other"``, ``null``]
|
|
1069
|
-
|
|
1070
|
-
#### Defined in
|
|
1071
|
-
|
|
1072
|
-
[packages/ai-tool/src/utils/chat.ts:4](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/chat.ts#L4)
|
|
1073
|
-
|
|
1074
|
-
___
|
|
1075
|
-
|
|
1076
|
-
### AbortErrorCode
|
|
1077
|
-
|
|
1078
|
-
• `Const` **AbortErrorCode**: [`Aborted`](enums/ErrorCode.md#aborted) = `ErrorCode.Aborted`
|
|
1079
|
-
|
|
1080
|
-
#### Defined in
|
|
1081
|
-
|
|
1082
|
-
node_modules/.pnpm/@isdk+common-error@0.1.1/node_modules/@isdk/common-error/dist/index.d.ts:31
|
|
1083
|
-
|
|
1084
|
-
___
|
|
1085
|
-
|
|
1086
|
-
### ActionNames
|
|
1087
|
-
|
|
1088
|
-
• `Const` **ActionNames**: readonly [``"get"``, ``"post"``, ``"put"``, ``"delete"``, ``"patch"``, ``"list"``, ``"res"``]
|
|
1089
|
-
|
|
1090
|
-
#### Defined in
|
|
1091
|
-
|
|
1092
|
-
[packages/ai-tool/src/utils/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/consts.ts#L5)
|
|
1093
|
-
|
|
1094
|
-
___
|
|
1095
|
-
|
|
1096
|
-
### AlreadyExistsErrorCode
|
|
1097
|
-
|
|
1098
|
-
• `Const` **AlreadyExistsErrorCode**: [`Conflict`](enums/ErrorCode.md#conflict) = `ErrorCode.Conflict`
|
|
1099
|
-
|
|
1100
|
-
#### Defined in
|
|
1101
|
-
|
|
1102
|
-
node_modules/.pnpm/@isdk+common-error@0.1.1/node_modules/@isdk/common-error/dist/index.d.ts:30
|
|
1103
|
-
|
|
1104
|
-
___
|
|
1105
|
-
|
|
1106
|
-
### ClientToolFuncSchema
|
|
1107
|
-
|
|
1108
|
-
• `Const` **ClientToolFuncSchema**: `Object`
|
|
1109
|
-
|
|
1110
|
-
#### Type declaration
|
|
1111
|
-
|
|
1112
|
-
| Name | Type |
|
|
1113
|
-
| :------ | :------ |
|
|
1114
|
-
| `action` | \{ `type`: `string` = 'string'; `assign`: (`value`: ``"get"`` \| ``"post"`` \| ``"put"`` \| ``"delete"`` \| ``"patch"`` \| ``"list"`` \| ``"res"``, `dest`: `any`, `src?`: `any`, `name?`: `string`, `options?`: `any`) => ``"get"`` \| ``"post"`` \| ``"put"`` \| ``"delete"`` \| ``"patch"`` \| ``"list"`` \| ``"res"`` } |
|
|
1115
|
-
| `action.type` | `string` |
|
|
1116
|
-
| `action.assign` | [object Object] |
|
|
1117
|
-
| `allowExportFunc` | \{ `type`: `string` = 'boolean' } |
|
|
1118
|
-
| `allowExportFunc.type` | `string` |
|
|
1119
|
-
| `apiRoot` | \{ `type`: `string` = 'string'; `get`: (`this`: `any`) => `any` ; `set`: (`this`: `any`, `value`: `string`) => `void` } |
|
|
1120
|
-
| `apiRoot.type` | `string` |
|
|
1121
|
-
| `apiRoot.get` | [object Object] |
|
|
1122
|
-
| `apiRoot.set` | [object Object] |
|
|
1123
|
-
| `fetchOptions` | \{ `type`: `string` = 'object' } |
|
|
1124
|
-
| `fetchOptions.type` | `string` |
|
|
1125
|
-
|
|
1126
|
-
#### Defined in
|
|
1127
|
-
|
|
1128
|
-
[packages/ai-tool/src/client-tools.ts:153](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/client-tools.ts#L153)
|
|
1129
|
-
|
|
1130
|
-
___
|
|
1131
|
-
|
|
1132
|
-
### DefaultAsyncSemaphoreCapacity
|
|
1133
|
-
|
|
1134
|
-
• `Const` **DefaultAsyncSemaphoreCapacity**: ``32``
|
|
1135
|
-
|
|
1136
|
-
#### Defined in
|
|
1137
|
-
|
|
1138
|
-
[packages/ai-tool/src/utils/async-semaphore.ts:6](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/async-semaphore.ts#L6)
|
|
1139
|
-
|
|
1140
|
-
___
|
|
1141
|
-
|
|
1142
|
-
### EventBusName
|
|
1143
|
-
|
|
1144
|
-
• `Const` **EventBusName**: ``"event-bus"``
|
|
1145
|
-
|
|
1146
|
-
#### Defined in
|
|
1147
|
-
|
|
1148
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:7](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/event/event-ability.ts#L7)
|
|
1149
|
-
|
|
1150
|
-
___
|
|
1151
|
-
|
|
1152
|
-
### EventName
|
|
1153
|
-
|
|
1154
|
-
• `Const` **EventName**: ``"event"``
|
|
1155
|
-
|
|
1156
|
-
#### Defined in
|
|
1157
|
-
|
|
1158
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:6](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/event/event-ability.ts#L6)
|
|
1159
|
-
|
|
1160
|
-
___
|
|
1161
|
-
|
|
1162
|
-
### FilenameReservedRegex
|
|
1163
|
-
|
|
1164
|
-
• `Const` **FilenameReservedRegex**: `RegExp`
|
|
1165
|
-
|
|
1166
|
-
Regular expression pattern for reserved characters in a filename.
|
|
1167
|
-
do not use /g global option here: when the regex is executed multiple times, it will always begin where it left off last time.
|
|
1168
|
-
|
|
1169
|
-
#### Defined in
|
|
1170
|
-
|
|
1171
|
-
[packages/ai-tool/src/utils/filename.ts:8](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/filename.ts#L8)
|
|
1172
|
-
|
|
1173
|
-
___
|
|
1174
|
-
|
|
1175
|
-
### HFBuiltins
|
|
1176
|
-
|
|
1177
|
-
• `Const` **HFBuiltins**: `Object`
|
|
1178
|
-
|
|
1179
|
-
#### Type declaration
|
|
1180
|
-
|
|
1181
|
-
| Name | Type |
|
|
1182
|
-
| :------ | :------ |
|
|
1183
|
-
| `randomInt` | (`to`: `number`, `from`: `number`) => `number` |
|
|
1184
|
-
| `select` | (`obj`: `any`, `index?`: `string` \| `number`) => `any` |
|
|
1185
|
-
| `tojson` | (`value`: `any`, `indent?`: `number` \| \{ `depth?`: `number` ; `indent?`: `number` }, `depth?`: `number`) => `string` |
|
|
1186
|
-
|
|
1187
|
-
#### Defined in
|
|
1188
|
-
|
|
1189
|
-
[packages/ai-tool/src/utils/prompt/template/jinja/src/builtins.ts:61](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/template/jinja/src/builtins.ts#L61)
|
|
1190
|
-
|
|
1191
|
-
___
|
|
1192
|
-
|
|
1193
|
-
### InternalErrorCode
|
|
1194
|
-
|
|
1195
|
-
• `Const` **InternalErrorCode**: [`InternalError`](enums/ErrorCode.md#internalerror) = `ErrorCode.InternalError`
|
|
1196
|
-
|
|
1197
|
-
#### Defined in
|
|
1198
|
-
|
|
1199
|
-
node_modules/.pnpm/@isdk+common-error@0.1.1/node_modules/@isdk/common-error/dist/index.d.ts:27
|
|
1200
|
-
|
|
1201
|
-
___
|
|
1202
|
-
|
|
1203
|
-
### NotFoundErrorCode
|
|
1204
|
-
|
|
1205
|
-
• `Const` **NotFoundErrorCode**: [`NotFound`](enums/ErrorCode.md#notfound) = `ErrorCode.NotFound`
|
|
1206
|
-
|
|
1207
|
-
#### Defined in
|
|
1208
|
-
|
|
1209
|
-
node_modules/.pnpm/@isdk+common-error@0.1.1/node_modules/@isdk/common-error/dist/index.d.ts:29
|
|
1210
|
-
|
|
1211
|
-
___
|
|
1212
|
-
|
|
1213
|
-
### NotImplementedErrorCode
|
|
1214
|
-
|
|
1215
|
-
• `Const` **NotImplementedErrorCode**: [`NotImplemented`](enums/ErrorCode.md#notimplemented) = `ErrorCode.NotImplemented`
|
|
1216
|
-
|
|
1217
|
-
#### Defined in
|
|
1218
|
-
|
|
1219
|
-
node_modules/.pnpm/@isdk+common-error@0.1.1/node_modules/@isdk/common-error/dist/index.d.ts:28
|
|
1220
|
-
|
|
1221
|
-
___
|
|
1222
|
-
|
|
1223
|
-
### PASSING\_SCORE
|
|
1224
|
-
|
|
1225
|
-
• `Const` **PASSING\_SCORE**: ``0.618``
|
|
1226
|
-
|
|
1227
|
-
#### Defined in
|
|
1228
|
-
|
|
1229
|
-
[packages/ai-tool/src/utils/consts.ts:3](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/consts.ts#L3)
|
|
1230
|
-
|
|
1231
|
-
___
|
|
1232
|
-
|
|
1233
|
-
### PromptTemplateTypes
|
|
1234
|
-
|
|
1235
|
-
• `Const` **PromptTemplateTypes**: readonly [``"internal"``, ``"hf"``, ``"fill"``]
|
|
1236
|
-
|
|
1237
|
-
#### Defined in
|
|
1238
|
-
|
|
1239
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:12](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/consts.ts#L12)
|
|
1240
|
-
|
|
1241
|
-
___
|
|
1242
|
-
|
|
1243
|
-
### PromptTypes
|
|
1244
|
-
|
|
1245
|
-
• `Const` **PromptTypes**: readonly [``"chat"``, ``"char"``, ``"plan"``]
|
|
1246
|
-
|
|
1247
|
-
Prompt Type
|
|
1248
|
-
defaults to `chat`
|
|
1249
|
-
|
|
1250
|
-
#### Defined in
|
|
1251
|
-
|
|
1252
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/consts.ts#L5)
|
|
1253
|
-
|
|
1254
|
-
___
|
|
1255
|
-
|
|
1256
|
-
### RStreamErrCode
|
|
1257
|
-
|
|
1258
|
-
• `Const` **RStreamErrCode**: ``600``
|
|
1259
|
-
|
|
1260
|
-
#### Defined in
|
|
1261
|
-
|
|
1262
|
-
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:3](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/stream/error-readable-stream.ts#L3)
|
|
1263
|
-
|
|
1264
|
-
___
|
|
1265
|
-
|
|
1266
|
-
### RemoteToolFuncSchema
|
|
1267
|
-
|
|
1268
|
-
• `Const` **RemoteToolFuncSchema**: `Object`
|
|
1269
|
-
|
|
1270
|
-
#### Type declaration
|
|
1271
|
-
|
|
1272
|
-
| Name | Type |
|
|
1273
|
-
| :------ | :------ |
|
|
1274
|
-
| `action` | \{ `type`: `string` = 'string'; `assign`: (`value`: ``"get"`` \| ``"post"`` \| ``"put"`` \| ``"delete"`` \| ``"patch"`` \| ``"list"`` \| ``"res"``, `dest`: `any`, `src?`: `any`, `name?`: `string`, `options?`: `any`) => ``"get"`` \| ``"post"`` \| ``"put"`` \| ``"delete"`` \| ``"patch"`` \| ``"list"`` \| ``"res"`` } |
|
|
1275
|
-
| `action.type` | `string` |
|
|
1276
|
-
| `action.assign` | [object Object] |
|
|
1277
|
-
| `allowExportFunc` | \{ `type`: `string` = 'boolean' } |
|
|
1278
|
-
| `allowExportFunc.type` | `string` |
|
|
1279
|
-
| `apiRoot` | \{ `type`: `string` = 'string'; `get`: (`this`: `any`) => `any` ; `set`: (`this`: `any`, `value`: `string`) => `void` } |
|
|
1280
|
-
| `apiRoot.type` | `string` |
|
|
1281
|
-
| `apiRoot.get` | [object Object] |
|
|
1282
|
-
| `apiRoot.set` | [object Object] |
|
|
1283
|
-
| `fetchOptions` | \{ `type`: `string` = 'object' } |
|
|
1284
|
-
| `fetchOptions.type` | `string` |
|
|
1285
|
-
|
|
1286
|
-
#### Defined in
|
|
1287
|
-
|
|
1288
|
-
[packages/ai-tool/src/utils/consts.ts:13](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/consts.ts#L13)
|
|
1289
|
-
|
|
1290
|
-
___
|
|
1291
|
-
|
|
1292
|
-
### ResponseRStreamErrCode
|
|
1293
|
-
|
|
1294
|
-
• `Const` **ResponseRStreamErrCode**: ``601``
|
|
1295
|
-
|
|
1296
|
-
#### Defined in
|
|
1297
|
-
|
|
1298
|
-
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:4](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/stream/error-readable-stream.ts#L4)
|
|
1299
|
-
|
|
1300
|
-
___
|
|
1301
|
-
|
|
1302
|
-
### SSEChannelAlreadyClosedErrCode
|
|
1303
|
-
|
|
1304
|
-
• `Const` **SSEChannelAlreadyClosedErrCode**: ``498``
|
|
1305
|
-
|
|
1306
|
-
#### Defined in
|
|
1307
|
-
|
|
1308
|
-
[packages/ai-tool/src/utils/event/sse-channel.ts:17](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/event/sse-channel.ts#L17)
|
|
1309
|
-
|
|
1310
|
-
___
|
|
1311
|
-
|
|
1312
|
-
### ServerToolFuncSchema
|
|
1313
|
-
|
|
1314
|
-
• `Const` **ServerToolFuncSchema**: `Object`
|
|
1315
|
-
|
|
1316
|
-
#### Type declaration
|
|
1317
|
-
|
|
1318
|
-
| Name | Type |
|
|
1319
|
-
| :------ | :------ |
|
|
1320
|
-
| `action` | \{ `type`: `string` = 'string'; `assign`: (`value`: ``"get"`` \| ``"post"`` \| ``"put"`` \| ``"delete"`` \| ``"patch"`` \| ``"list"`` \| ``"res"``, `dest`: `any`, `src?`: `any`, `name?`: `string`, `options?`: `any`) => ``"get"`` \| ``"post"`` \| ``"put"`` \| ``"delete"`` \| ``"patch"`` \| ``"list"`` \| ``"res"`` } |
|
|
1321
|
-
| `action.type` | `string` |
|
|
1322
|
-
| `action.assign` | [object Object] |
|
|
1323
|
-
| `allowExportFunc` | \{ `type`: `string` = 'boolean' } |
|
|
1324
|
-
| `allowExportFunc.type` | `string` |
|
|
1325
|
-
| `apiRoot` | \{ `type`: `string` = 'string'; `get`: (`this`: `any`) => `any` ; `set`: (`this`: `any`, `value`: `string`) => `void` } |
|
|
1326
|
-
| `apiRoot.type` | `string` |
|
|
1327
|
-
| `apiRoot.get` | [object Object] |
|
|
1328
|
-
| `apiRoot.set` | [object Object] |
|
|
1329
|
-
| `fetchOptions` | \{ `type`: `string` = 'object' } |
|
|
1330
|
-
| `fetchOptions.type` | `string` |
|
|
1331
|
-
|
|
1332
|
-
#### Defined in
|
|
1333
|
-
|
|
1334
|
-
[packages/ai-tool/src/server-tools.ts:62](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/server-tools.ts#L62)
|
|
1335
|
-
|
|
1336
|
-
___
|
|
1337
|
-
|
|
1338
|
-
### ToolAsyncCancelableBit
|
|
1339
|
-
|
|
1340
|
-
• `Const` **ToolAsyncCancelableBit**: ``1``
|
|
1341
|
-
|
|
1342
|
-
#### Defined in
|
|
1343
|
-
|
|
1344
|
-
[packages/ai-tool/src/tool-func.ts:8](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/tool-func.ts#L8)
|
|
1345
|
-
|
|
1346
|
-
___
|
|
1347
|
-
|
|
1348
|
-
### ToolAsyncMultiTaskBit
|
|
1349
|
-
|
|
1350
|
-
• `Const` **ToolAsyncMultiTaskBit**: ``0``
|
|
1351
|
-
|
|
1352
|
-
#### Defined in
|
|
1353
|
-
|
|
1354
|
-
[packages/ai-tool/src/tool-func.ts:7](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/tool-func.ts#L7)
|
|
1355
|
-
|
|
1356
|
-
___
|
|
1357
|
-
|
|
1358
|
-
### ToolAsyncPriorityBit
|
|
1359
|
-
|
|
1360
|
-
• `Const` **ToolAsyncPriorityBit**: ``2``
|
|
1361
|
-
|
|
1362
|
-
#### Defined in
|
|
1363
|
-
|
|
1364
|
-
[packages/ai-tool/src/tool-func.ts:9](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/tool-func.ts#L9)
|
|
1365
|
-
|
|
1366
|
-
___
|
|
1367
|
-
|
|
1368
|
-
### ToolFuncSchema
|
|
1369
|
-
|
|
1370
|
-
• `Const` **ToolFuncSchema**: `Object`
|
|
1371
|
-
|
|
1372
|
-
#### Type declaration
|
|
1373
|
-
|
|
1374
|
-
| Name | Type |
|
|
1375
|
-
| :------ | :------ |
|
|
1376
|
-
| `asyncFeatures` | \{ `type`: `string` = 'number' } |
|
|
1377
|
-
| `asyncFeatures.type` | `string` |
|
|
1378
|
-
| `depends` | \{ `exported`: `boolean` = false; `type`: `string` = 'object' } |
|
|
1379
|
-
| `depends.exported` | `boolean` |
|
|
1380
|
-
| `depends.type` | `string` |
|
|
1381
|
-
| `description` | \{ `type`: `string` = 'string' } |
|
|
1382
|
-
| `description.type` | `string` |
|
|
1383
|
-
| `func` | \{ `type`: `string` = 'function'; `assign`: (`value`: `string` \| `Function`, `dest`: [`ToolFunc`](classes/ToolFunc.md), `src?`: [`ToolFunc`](classes/ToolFunc.md), `name?`: `string`, `options?`: `any`) => `string` \| `Function` } |
|
|
1384
|
-
| `func.type` | `string` |
|
|
1385
|
-
| `func.assign` | [object Object] |
|
|
1386
|
-
| `isApi` | \{ `type`: `string` = 'boolean' } |
|
|
1387
|
-
| `isApi.type` | `string` |
|
|
1388
|
-
| `name` | \{ `type`: `string` = 'string' } |
|
|
1389
|
-
| `name.type` | `string` |
|
|
1390
|
-
| `params` | \{ `type`: `string` = 'object' } |
|
|
1391
|
-
| `params.type` | `string` |
|
|
1392
|
-
| `result` | \{ `type`: `string` = 'any' } |
|
|
1393
|
-
| `result.type` | `string` |
|
|
1394
|
-
| `setup` | \{ `type`: `string` = 'function' } |
|
|
1395
|
-
| `setup.type` | `string` |
|
|
1396
|
-
| `stream` | \{ `type`: `string` = 'boolean' } |
|
|
1397
|
-
| `stream.type` | `string` |
|
|
1398
|
-
| `tags` | \{ `type`: `string`[] } |
|
|
1399
|
-
| `tags.type` | `string`[] |
|
|
1400
|
-
|
|
1401
|
-
#### Defined in
|
|
1402
|
-
|
|
1403
|
-
[packages/ai-tool/src/tool-func.ts:348](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/tool-func.ts#L348)
|
|
1404
|
-
|
|
1405
|
-
___
|
|
1406
|
-
|
|
1407
|
-
### WindowsReservedNameRegex
|
|
1408
|
-
|
|
1409
|
-
• `Const` **WindowsReservedNameRegex**: `RegExp`
|
|
1410
|
-
|
|
1411
|
-
Regular expression pattern for reserved names on Windows systems.
|
|
1412
|
-
|
|
1413
|
-
#### Defined in
|
|
1414
|
-
|
|
1415
|
-
[packages/ai-tool/src/utils/filename.ts:13](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/filename.ts#L13)
|
|
1416
|
-
|
|
1417
|
-
___
|
|
1418
|
-
|
|
1419
|
-
### base32768
|
|
1420
|
-
|
|
1421
|
-
• `Const` **base32768**: `__module` = `_base32768`
|
|
1422
|
-
|
|
1423
|
-
#### Defined in
|
|
1424
|
-
|
|
1425
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:5](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/hash/xxhash.ts#L5)
|
|
1426
|
-
|
|
1427
|
-
___
|
|
1428
|
-
|
|
1429
|
-
### defaultTemplateFormat
|
|
1430
|
-
|
|
1431
|
-
• `Const` **defaultTemplateFormat**: ``"default"``
|
|
1432
|
-
|
|
1433
|
-
#### Defined in
|
|
1434
|
-
|
|
1435
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:8](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/prompt-template.ts#L8)
|
|
1436
|
-
|
|
1437
|
-
___
|
|
1438
|
-
|
|
1439
|
-
### event
|
|
1440
|
-
|
|
1441
|
-
• `Const` **event**: [`EventToolFunc`](classes/EventToolFunc.md)
|
|
1442
|
-
|
|
1443
|
-
#### Defined in
|
|
1444
|
-
|
|
1445
|
-
[packages/ai-tool/src/funcs/event.ts:22](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/funcs/event.ts#L22)
|
|
1446
|
-
|
|
1447
|
-
___
|
|
1448
|
-
|
|
1449
|
-
### eventClient
|
|
1450
|
-
|
|
1451
|
-
• `Const` **eventClient**: [`EventClient`](classes/EventClient.md)
|
|
1452
|
-
|
|
1453
|
-
#### Defined in
|
|
1454
|
-
|
|
1455
|
-
[packages/ai-tool/src/funcs/event-client.ts:180](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/funcs/event-client.ts#L180)
|
|
1456
|
-
|
|
1457
|
-
___
|
|
1458
|
-
|
|
1459
|
-
### eventServer
|
|
1460
|
-
|
|
1461
|
-
• `Const` **eventServer**: [`EventServer`](classes/EventServer.md)
|
|
1462
|
-
|
|
1463
|
-
#### Defined in
|
|
1464
|
-
|
|
1465
|
-
[packages/ai-tool/src/funcs/event-server.ts:133](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/funcs/event-server.ts#L133)
|
|
1466
|
-
|
|
1467
|
-
___
|
|
1468
|
-
|
|
1469
|
-
### lrucache
|
|
1470
|
-
|
|
1471
|
-
• `Const` **lrucache**: [`ToolFunc`](classes/ToolFunc.md)
|
|
1472
|
-
|
|
1473
|
-
#### Defined in
|
|
1474
|
-
|
|
1475
|
-
[packages/ai-tool/src/funcs/lrucache.ts:40](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/funcs/lrucache.ts#L40)
|
|
1476
|
-
|
|
1477
|
-
___
|
|
1478
|
-
|
|
1479
|
-
### mimeType
|
|
1480
|
-
|
|
1481
|
-
• `Const` **mimeType**: `MimeType`
|
|
1482
|
-
|
|
1483
|
-
#### Defined in
|
|
1484
|
-
|
|
1485
|
-
node_modules/.pnpm/mime-type@5.0.0/node_modules/mime-type/src/with-db.d.ts:3
|
|
1486
|
-
|
|
1487
|
-
___
|
|
1488
|
-
|
|
1489
|
-
### uuidNIL
|
|
1490
|
-
|
|
1491
|
-
• `Const` **uuidNIL**: `NIL`
|
|
1492
|
-
|
|
1493
|
-
#### Defined in
|
|
1494
|
-
|
|
1495
|
-
node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:78
|
|
1496
|
-
|
|
1497
|
-
___
|
|
1498
|
-
|
|
1499
|
-
### AIArgProcessor
|
|
1500
|
-
|
|
1501
|
-
▸ **AIArgProcessor**(`argInfo`, `ix`, `scope?`, `options?`): `Promise`\<`undefined` \| `string`\>
|
|
1502
|
-
|
|
1503
|
-
#### Parameters
|
|
1504
|
-
|
|
1505
|
-
| Name | Type |
|
|
1506
|
-
| :------ | :------ |
|
|
1507
|
-
| `argInfo` | `ArgInfo` |
|
|
1508
|
-
| `ix` | `number` |
|
|
1509
|
-
| `scope?` | `Record`\<`string`, `any`\> |
|
|
1510
|
-
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) |
|
|
1511
|
-
|
|
1512
|
-
#### Returns
|
|
1513
|
-
|
|
1514
|
-
`Promise`\<`undefined` \| `string`\>
|
|
1515
|
-
|
|
1516
|
-
#### Defined in
|
|
1517
|
-
|
|
1518
|
-
[packages/ai-tool/src/utils/parse-command.ts:137](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/parse-command.ts#L137)
|
|
1519
|
-
|
|
1520
|
-
___
|
|
1521
|
-
|
|
1522
|
-
### AIStream
|
|
1523
|
-
|
|
1524
|
-
▸ **AIStream**\<`T`, `TOptions`\>(`response`, `customParser?`): `ReadableStream`\<[`AIResult`](interfaces/AIResult.md)\<`T`, `TOptions`\>\>
|
|
1525
|
-
|
|
1526
|
-
Returns a ReadableStream created from the response, parsed and handled with custom logic.
|
|
1527
|
-
The stream goes through two transformation stages, first parsing the events and then
|
|
1528
|
-
invoking the provided callbacks.
|
|
1529
|
-
|
|
1530
|
-
For 2xx HTTP responses:
|
|
1531
|
-
- The function continues with standard stream processing.
|
|
1532
|
-
|
|
1533
|
-
For non-2xx HTTP responses:
|
|
1534
|
-
- If the response body is defined, it asynchronously extracts and decodes the response body.
|
|
1535
|
-
- It then creates a custom ReadableStream to propagate a detailed error message.
|
|
1536
|
-
|
|
1537
|
-
#### Type parameters
|
|
1538
|
-
|
|
1539
|
-
| Name | Type |
|
|
1540
|
-
| :------ | :------ |
|
|
1541
|
-
| `T` | `any` |
|
|
1542
|
-
| `TOptions` | `any` |
|
|
1543
|
-
|
|
1544
|
-
#### Parameters
|
|
1545
|
-
|
|
1546
|
-
| Name | Type | Description |
|
|
1547
|
-
| :------ | :------ | :------ |
|
|
1548
|
-
| `response` | `Response` | The response. |
|
|
1549
|
-
| `customParser?` | [`AIStreamParser`](interfaces/AIStreamParser.md)\<`T`, `TOptions`\> | The custom parser function. |
|
|
1550
|
-
|
|
1551
|
-
#### Returns
|
|
1552
|
-
|
|
1553
|
-
`ReadableStream`\<[`AIResult`](interfaces/AIResult.md)\<`T`, `TOptions`\>\>
|
|
1554
|
-
|
|
1555
|
-
The AIStream.
|
|
1556
|
-
|
|
1557
|
-
**`Throws`**
|
|
1558
|
-
|
|
1559
|
-
Will throw an error if the response is not OK.
|
|
1560
|
-
|
|
1561
|
-
#### Defined in
|
|
1562
|
-
|
|
1563
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:122](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/stream/ai-stream.ts#L122)
|
|
1564
|
-
|
|
1565
|
-
___
|
|
1566
|
-
|
|
1567
|
-
### ChoiceArgProcessor
|
|
1568
|
-
|
|
1569
|
-
▸ **ChoiceArgProcessor**(`argInfo`, `_ix`, `scope?`, `options?`): `undefined` \| `string`
|
|
1570
|
-
|
|
1571
|
-
#### Parameters
|
|
1572
|
-
|
|
1573
|
-
| Name | Type |
|
|
1574
|
-
| :------ | :------ |
|
|
1575
|
-
| `argInfo` | `ArgInfo` |
|
|
1576
|
-
| `_ix` | `number` |
|
|
1577
|
-
| `scope?` | `Record`\<`string`, `any`\> |
|
|
1578
|
-
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) |
|
|
1579
|
-
|
|
1580
|
-
#### Returns
|
|
1581
|
-
|
|
1582
|
-
`undefined` \| `string`
|
|
1583
|
-
|
|
1584
|
-
#### Defined in
|
|
1585
|
-
|
|
1586
|
-
[packages/ai-tool/src/utils/parse-command.ts:105](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/parse-command.ts#L105)
|
|
1587
|
-
|
|
1588
|
-
___
|
|
1589
|
-
|
|
1590
|
-
### RateLimit
|
|
1591
|
-
|
|
1592
|
-
▸ **RateLimit**(`rps`, `«destructured»?`): () => `Promise`\<`void`\>
|
|
1593
|
-
|
|
1594
|
-
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.
|
|
1595
|
-
|
|
1596
|
-
#### Parameters
|
|
1597
|
-
|
|
1598
|
-
| Name | Type | Default value |
|
|
1599
|
-
| :------ | :------ | :------ |
|
|
1600
|
-
| `rps` | `number` | `undefined` |
|
|
1601
|
-
| `«destructured»` | `Object` | `{}` |
|
|
1602
|
-
| › `timeUnit?` | `number` | `1000` |
|
|
1603
|
-
| › `uniformDistribution?` | `boolean` | `false` |
|
|
1604
|
-
|
|
1605
|
-
#### Returns
|
|
1606
|
-
|
|
1607
|
-
`fn`
|
|
1608
|
-
|
|
1609
|
-
▸ (): `Promise`\<`void`\>
|
|
1610
|
-
|
|
1611
|
-
##### Returns
|
|
1612
|
-
|
|
1613
|
-
`Promise`\<`void`\>
|
|
1614
|
-
|
|
1615
|
-
#### Defined in
|
|
1616
|
-
|
|
1617
|
-
[packages/ai-tool/src/utils/async-semaphore.ts:347](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/async-semaphore.ts#L347)
|
|
1618
|
-
|
|
1619
|
-
___
|
|
1620
|
-
|
|
1621
|
-
### TemplateArgProcessor
|
|
1622
|
-
|
|
1623
|
-
▸ **TemplateArgProcessor**(`«destructured»`, `ix`, `scope?`, `options?`): `Promise`\<`undefined` \| `string`\>
|
|
1624
|
-
|
|
1625
|
-
#### Parameters
|
|
1626
|
-
|
|
1627
|
-
| Name | Type |
|
|
1628
|
-
| :------ | :------ |
|
|
1629
|
-
| `«destructured»` | `ArgInfo` |
|
|
1630
|
-
| `ix` | `number` |
|
|
1631
|
-
| `scope?` | `Record`\<`string`, `any`\> |
|
|
1632
|
-
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) |
|
|
1633
|
-
|
|
1634
|
-
#### Returns
|
|
1635
|
-
|
|
1636
|
-
`Promise`\<`undefined` \| `string`\>
|
|
1637
|
-
|
|
1638
|
-
#### Defined in
|
|
1639
|
-
|
|
1640
|
-
[packages/ai-tool/src/utils/parse-command.ts:112](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/parse-command.ts#L112)
|
|
1641
|
-
|
|
1642
|
-
___
|
|
1643
|
-
|
|
1644
|
-
### \_lrucache
|
|
1645
|
-
|
|
1646
|
-
▸ **_lrucache**(`this`, `«destructured»?`): `_Cache`
|
|
1647
|
-
|
|
1648
|
-
#### Parameters
|
|
1649
|
-
|
|
1650
|
-
| Name | Type |
|
|
1651
|
-
| :------ | :------ |
|
|
1652
|
-
| `this` | [`ToolFunc`](classes/ToolFunc.md) |
|
|
1653
|
-
| `«destructured»` | `Object` |
|
|
1654
|
-
| › `key?` | `string` |
|
|
1655
|
-
| › `options?` | `number` \| `ICacheOptions` |
|
|
1656
|
-
| › `value?` | `any` |
|
|
1657
|
-
|
|
1658
|
-
#### Returns
|
|
1659
|
-
|
|
1660
|
-
`_Cache`
|
|
1661
|
-
|
|
1662
|
-
#### Defined in
|
|
1663
|
-
|
|
1664
|
-
[packages/ai-tool/src/funcs/lrucache.ts:6](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/funcs/lrucache.ts#L6)
|
|
1665
|
-
|
|
1666
|
-
___
|
|
1667
|
-
|
|
1668
|
-
### backendEventable
|
|
1669
|
-
|
|
1670
|
-
▸ **backendEventable**(`targetClass?`, `options?`): `Function`
|
|
1671
|
-
|
|
1672
|
-
#### Parameters
|
|
1673
|
-
|
|
1674
|
-
| Name | Type |
|
|
1675
|
-
| :------ | :------ |
|
|
1676
|
-
| `targetClass?` | `Function` |
|
|
1677
|
-
| `options?` | `AbilityOptions` |
|
|
1678
|
-
|
|
1679
|
-
#### Returns
|
|
1680
|
-
|
|
1681
|
-
`Function`
|
|
1682
|
-
|
|
1683
|
-
#### Defined in
|
|
1684
|
-
|
|
1685
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:80](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/event/event-ability.ts#L80)
|
|
1686
|
-
|
|
1687
|
-
___
|
|
1688
|
-
|
|
1689
|
-
### canonicalize
|
|
1690
|
-
|
|
1691
|
-
▸ **canonicalize**(`obj`): `string`
|
|
1692
|
-
|
|
1693
|
-
#### Parameters
|
|
1694
|
-
|
|
1695
|
-
| Name | Type |
|
|
1696
|
-
| :------ | :------ |
|
|
1697
|
-
| `obj` | `any` |
|
|
1698
|
-
|
|
1699
|
-
#### Returns
|
|
1700
|
-
|
|
1701
|
-
`string`
|
|
1702
|
-
|
|
1703
|
-
#### Defined in
|
|
1704
|
-
|
|
1705
|
-
node_modules/.pnpm/json-canonicalize@1.0.6/node_modules/json-canonicalize/types/canonicalize.d.ts:1
|
|
1706
|
-
|
|
1707
|
-
___
|
|
1708
|
-
|
|
1709
|
-
### countRegexMatches
|
|
1710
|
-
|
|
1711
|
-
▸ **countRegexMatches**(`content`, `regex`): `number`
|
|
1712
|
-
|
|
1713
|
-
Counts the number of matches for a given regular expression in a specified string.
|
|
1714
|
-
This function ensures that the regular expression is used globally by adding the 'g' flag,
|
|
1715
|
-
if it is not already present.
|
|
1716
|
-
|
|
1717
|
-
#### Parameters
|
|
1718
|
-
|
|
1719
|
-
| Name | Type | Description |
|
|
1720
|
-
| :------ | :------ | :------ |
|
|
1721
|
-
| `content` | `string` | The string to search within. |
|
|
1722
|
-
| `regex` | `RegExp` | The regular expression to use for matching. |
|
|
1723
|
-
|
|
1724
|
-
#### Returns
|
|
1725
|
-
|
|
1726
|
-
`number`
|
|
1727
|
-
|
|
1728
|
-
The total number of matches found.
|
|
1729
|
-
|
|
1730
|
-
#### Defined in
|
|
1731
|
-
|
|
1732
|
-
[packages/ai-tool/src/utils/count-regex-matches.ts:10](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/count-regex-matches.ts#L10)
|
|
1733
|
-
|
|
1734
|
-
___
|
|
1735
|
-
|
|
1736
|
-
### createAbilityInjector
|
|
1737
|
-
|
|
1738
|
-
▸ **createAbilityInjector**(`abilityClass`, `isGetClassFunc?`, `injectorOpts?`): `AbilityFn`
|
|
1739
|
-
|
|
1740
|
-
#### Parameters
|
|
1741
|
-
|
|
1742
|
-
| Name | Type |
|
|
1743
|
-
| :------ | :------ |
|
|
1744
|
-
| `abilityClass` | `Function` |
|
|
1745
|
-
| `isGetClassFunc?` | `boolean` |
|
|
1746
|
-
| `injectorOpts?` | `AbilityInjectorOptions` |
|
|
1747
|
-
|
|
1748
|
-
#### Returns
|
|
1749
|
-
|
|
1750
|
-
`AbilityFn`
|
|
1751
|
-
|
|
1752
|
-
#### Defined in
|
|
1753
|
-
|
|
1754
|
-
node_modules/.pnpm/custom-ability@2.0.0/node_modules/custom-ability/lib/custom-ability.d.ts:29
|
|
1755
|
-
|
|
1756
|
-
▸ **createAbilityInjector**(`abilityClass`, `aCoreMethod?`, `isGetClassFunc?`, `injectorOpts?`): `AbilityFn`
|
|
1757
|
-
|
|
1758
|
-
#### Parameters
|
|
1759
|
-
|
|
1760
|
-
| Name | Type |
|
|
1761
|
-
| :------ | :------ |
|
|
1762
|
-
| `abilityClass` | `Function` |
|
|
1763
|
-
| `aCoreMethod?` | `string` \| `string`[] |
|
|
1764
|
-
| `isGetClassFunc?` | `boolean` |
|
|
1765
|
-
| `injectorOpts?` | `AbilityInjectorOptions` |
|
|
1766
|
-
|
|
1767
|
-
#### Returns
|
|
1768
|
-
|
|
1769
|
-
`AbilityFn`
|
|
1770
|
-
|
|
1771
|
-
#### Defined in
|
|
1772
|
-
|
|
1773
|
-
node_modules/.pnpm/custom-ability@2.0.0/node_modules/custom-ability/lib/custom-ability.d.ts:30
|
|
1774
|
-
|
|
1775
|
-
▸ **createAbilityInjector**(`abilityClass`, `aCoreMethod?`, `injectorOpts?`): `AbilityFn`
|
|
1776
|
-
|
|
1777
|
-
#### Parameters
|
|
1778
|
-
|
|
1779
|
-
| Name | Type |
|
|
1780
|
-
| :------ | :------ |
|
|
1781
|
-
| `abilityClass` | `Function` |
|
|
1782
|
-
| `aCoreMethod?` | `string` \| `string`[] |
|
|
1783
|
-
| `injectorOpts?` | `AbilityInjectorOptions` |
|
|
1784
|
-
|
|
1785
|
-
#### Returns
|
|
1786
|
-
|
|
1787
|
-
`AbilityFn`
|
|
1788
|
-
|
|
1789
|
-
#### Defined in
|
|
1790
|
-
|
|
1791
|
-
node_modules/.pnpm/custom-ability@2.0.0/node_modules/custom-ability/lib/custom-ability.d.ts:31
|
|
1792
|
-
|
|
1793
|
-
▸ **createAbilityInjector**(`abilityClass`, `injectorOpts?`): `AbilityFn`
|
|
1794
|
-
|
|
1795
|
-
#### Parameters
|
|
1796
|
-
|
|
1797
|
-
| Name | Type |
|
|
1798
|
-
| :------ | :------ |
|
|
1799
|
-
| `abilityClass` | `Function` |
|
|
1800
|
-
| `injectorOpts?` | `AbilityInjectorOptions` |
|
|
1801
|
-
|
|
1802
|
-
#### Returns
|
|
1803
|
-
|
|
1804
|
-
`AbilityFn`
|
|
1805
|
-
|
|
1806
|
-
#### Defined in
|
|
1807
|
-
|
|
1808
|
-
node_modules/.pnpm/custom-ability@2.0.0/node_modules/custom-ability/lib/custom-ability.d.ts:32
|
|
1809
|
-
|
|
1810
|
-
___
|
|
1811
|
-
|
|
1812
|
-
### createCallbacksTransformer
|
|
1813
|
-
|
|
1814
|
-
▸ **createCallbacksTransformer**\<`I`, `O`\>(`cb`): `TransformStream`\<`I`, `O`\>
|
|
1815
|
-
|
|
1816
|
-
Creates a transform stream that invokes optional callback functions.
|
|
1817
|
-
The transform stream uses the provided callbacks to execute custom logic at different stages of the stream's lifecycle.
|
|
1818
|
-
- `onStart`: Called once when the stream is initialized.
|
|
1819
|
-
- `onTransform`: Called for each tokenized message.
|
|
1820
|
-
- `onCompletion`: Called every time an AIStream completion message is received. This can occur multiple times when using e.g. OpenAI functions
|
|
1821
|
-
- `onFinal`: Called once when the stream is closed with the final completion message.
|
|
1822
|
-
|
|
1823
|
-
This function is useful when you want to process a stream of messages and perform specific actions during the stream's lifecycle.
|
|
1824
|
-
|
|
1825
|
-
#### Type parameters
|
|
1826
|
-
|
|
1827
|
-
| Name | Type |
|
|
1828
|
-
| :------ | :------ |
|
|
1829
|
-
| `I` | `any` |
|
|
1830
|
-
| `O` | `any` |
|
|
1831
|
-
|
|
1832
|
-
#### Parameters
|
|
1833
|
-
|
|
1834
|
-
| Name | Type |
|
|
1835
|
-
| :------ | :------ |
|
|
1836
|
-
| `cb` | `undefined` \| [`StreamCallbacksAndOptions`](interfaces/StreamCallbacksAndOptions.md)\<`I`, `O`\> |
|
|
1837
|
-
|
|
1838
|
-
#### Returns
|
|
1839
|
-
|
|
1840
|
-
`TransformStream`\<`I`, `O`\>
|
|
1841
|
-
|
|
1842
|
-
A transform stream that encodes input messages as Uint8Array and allows the execution of custom logic through callbacks.
|
|
1843
|
-
|
|
1844
|
-
**`Example`**
|
|
1845
|
-
|
|
1846
|
-
```ts
|
|
1847
|
-
const callbacks = {
|
|
1848
|
-
onStart: async () => console.log('Stream started'),
|
|
1849
|
-
onTransform: async (chunk) => console.log('Token:',chunk),
|
|
1850
|
-
onFinal: async () => data.close()
|
|
1851
|
-
};
|
|
1852
|
-
const transformer = createCallbacksTransformer(callbacks);
|
|
1853
|
-
```
|
|
1854
|
-
|
|
1855
|
-
#### Defined in
|
|
1856
|
-
|
|
1857
|
-
[packages/ai-tool/src/utils/stream/create-callbacks-stream.ts:36](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/stream/create-callbacks-stream.ts#L36)
|
|
1858
|
-
|
|
1859
|
-
___
|
|
1860
|
-
|
|
1861
|
-
### createEmptyReadableStream
|
|
1862
|
-
|
|
1863
|
-
▸ **createEmptyReadableStream**(): `ReadableStream`
|
|
1864
|
-
|
|
1865
|
-
Creates an empty ReadableStream that immediately closes upon creation.
|
|
1866
|
-
This function is used as a fallback for creating a ReadableStream when the response body is null or undefined,
|
|
1867
|
-
ensuring that the subsequent pipeline processing doesn't fail due to a lack of a stream.
|
|
1868
|
-
|
|
1869
|
-
#### Returns
|
|
1870
|
-
|
|
1871
|
-
`ReadableStream`
|
|
1872
|
-
|
|
1873
|
-
An empty and closed ReadableStream instance.
|
|
1874
|
-
|
|
1875
|
-
#### Defined in
|
|
1876
|
-
|
|
1877
|
-
[packages/ai-tool/src/utils/stream/create-empty-stream.ts:8](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/stream/create-empty-stream.ts#L8)
|
|
1878
|
-
|
|
1879
|
-
___
|
|
1880
|
-
|
|
1881
|
-
### createEndWithRepetitionDetector
|
|
1882
|
-
|
|
1883
|
-
▸ **createEndWithRepetitionDetector**(`repetitionThreshold`): (`value`: `string`) => ``null`` \| `RegExpExecArray`
|
|
1884
|
-
|
|
1885
|
-
#### Parameters
|
|
1886
|
-
|
|
1887
|
-
| Name | Type |
|
|
1888
|
-
| :------ | :------ |
|
|
1889
|
-
| `repetitionThreshold` | `number` |
|
|
1890
|
-
|
|
1891
|
-
#### Returns
|
|
1892
|
-
|
|
1893
|
-
`fn`
|
|
1894
|
-
|
|
1895
|
-
▸ (`value`): ``null`` \| `RegExpExecArray`
|
|
1896
|
-
|
|
1897
|
-
##### Parameters
|
|
1898
|
-
|
|
1899
|
-
| Name | Type |
|
|
1900
|
-
| :------ | :------ |
|
|
1901
|
-
| `value` | `string` |
|
|
1902
|
-
|
|
1903
|
-
##### Returns
|
|
1904
|
-
|
|
1905
|
-
``null`` \| `RegExpExecArray`
|
|
1906
|
-
|
|
1907
|
-
#### Defined in
|
|
1908
|
-
|
|
1909
|
-
[packages/ai-tool/src/utils/end-with-repeated-sequence.ts:3](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/end-with-repeated-sequence.ts#L3)
|
|
1910
|
-
|
|
1911
|
-
___
|
|
1912
|
-
|
|
1913
|
-
### createError
|
|
1914
|
-
|
|
1915
|
-
▸ **createError**(`message`, `name?`, `status?`): [`CommonError`](classes/CommonError.md)
|
|
1916
|
-
|
|
1917
|
-
Create an error object
|
|
1918
|
-
|
|
1919
|
-
#### Parameters
|
|
1920
|
-
|
|
1921
|
-
| Name | Type | Description |
|
|
1922
|
-
| :------ | :------ | :------ |
|
|
1923
|
-
| `message` | `string` | Error message |
|
|
1924
|
-
| `name?` | `string` \| `Record`\<`string`, `any`\> | Error name, optional |
|
|
1925
|
-
| `status?` | `string` \| `number` | Error status code, default to 500 |
|
|
1926
|
-
|
|
1927
|
-
#### Returns
|
|
1928
|
-
|
|
1929
|
-
[`CommonError`](classes/CommonError.md)
|
|
1930
|
-
|
|
1931
|
-
Error object
|
|
1932
|
-
|
|
1933
|
-
#### Defined in
|
|
1934
|
-
|
|
1935
|
-
node_modules/.pnpm/@isdk+common-error@0.1.1/node_modules/@isdk/common-error/dist/index.d.ts:141
|
|
1936
|
-
|
|
1937
|
-
___
|
|
1938
|
-
|
|
1939
|
-
### createEventStreamTransformer
|
|
1940
|
-
|
|
1941
|
-
▸ **createEventStreamTransformer**\<`TValue`, `TOptions`\>(`customParser?`): `TransformStream`\<`Uint8Array`, [`AIResult`](interfaces/AIResult.md)\<`TValue`, `TOptions`\>\>
|
|
1942
|
-
|
|
1943
|
-
Creates a TransformStream that parses events from an EventSource stream using a custom parser.
|
|
1944
|
-
|
|
1945
|
-
#### Type parameters
|
|
1946
|
-
|
|
1947
|
-
| Name | Type |
|
|
1948
|
-
| :------ | :------ |
|
|
1949
|
-
| `TValue` | `any` |
|
|
1950
|
-
| `TOptions` | `any` |
|
|
1951
|
-
|
|
1952
|
-
#### Parameters
|
|
1953
|
-
|
|
1954
|
-
| Name | Type | Description |
|
|
1955
|
-
| :------ | :------ | :------ |
|
|
1956
|
-
| `customParser?` | [`AIStreamParser`](interfaces/AIStreamParser.md)\<`any`, `any`\> | Function to handle event data. |
|
|
1957
|
-
|
|
1958
|
-
#### Returns
|
|
1959
|
-
|
|
1960
|
-
`TransformStream`\<`Uint8Array`, [`AIResult`](interfaces/AIResult.md)\<`TValue`, `TOptions`\>\>
|
|
1961
|
-
|
|
1962
|
-
TransformStream parsing events.
|
|
1963
|
-
|
|
1964
|
-
#### Defined in
|
|
1965
|
-
|
|
1966
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:37](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/stream/ai-stream.ts#L37)
|
|
1967
|
-
|
|
1968
|
-
___
|
|
1969
|
-
|
|
1970
|
-
### createHfValueFunc
|
|
1971
|
-
|
|
1972
|
-
▸ **createHfValueFunc**(`fn`): (`_data`: `any`) => `Function`
|
|
1973
|
-
|
|
1974
|
-
#### Parameters
|
|
1975
|
-
|
|
1976
|
-
| Name | Type |
|
|
1977
|
-
| :------ | :------ |
|
|
1978
|
-
| `fn` | `Function` |
|
|
1979
|
-
|
|
1980
|
-
#### Returns
|
|
1981
|
-
|
|
1982
|
-
`fn`
|
|
1983
|
-
|
|
1984
|
-
▸ (`_data`): `Function`
|
|
1985
|
-
|
|
1986
|
-
##### Parameters
|
|
1987
|
-
|
|
1988
|
-
| Name | Type |
|
|
1989
|
-
| :------ | :------ |
|
|
1990
|
-
| `_data` | `any` |
|
|
1991
|
-
|
|
1992
|
-
##### Returns
|
|
1993
|
-
|
|
1994
|
-
`Function`
|
|
1995
|
-
|
|
1996
|
-
#### Defined in
|
|
1997
|
-
|
|
1998
|
-
[packages/ai-tool/src/utils/prompt/hf-prompt-template.ts:140](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/hf-prompt-template.ts#L140)
|
|
1999
|
-
|
|
2000
|
-
___
|
|
2001
|
-
|
|
2002
|
-
### createLRUCache
|
|
2003
|
-
|
|
2004
|
-
▸ **createLRUCache**(`name`, `options?`): [`ToolFunc`](classes/ToolFunc.md)
|
|
2005
|
-
|
|
2006
|
-
#### Parameters
|
|
2007
|
-
|
|
2008
|
-
| Name | Type |
|
|
2009
|
-
| :------ | :------ |
|
|
2010
|
-
| `name` | `string` |
|
|
2011
|
-
| `options?` | `number` \| `ICacheOptions` |
|
|
2012
|
-
|
|
2013
|
-
#### Returns
|
|
2014
|
-
|
|
2015
|
-
[`ToolFunc`](classes/ToolFunc.md)
|
|
2016
|
-
|
|
2017
|
-
#### Defined in
|
|
2018
|
-
|
|
2019
|
-
[packages/ai-tool/src/funcs/lrucache.ts:22](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/funcs/lrucache.ts#L22)
|
|
2020
|
-
|
|
2021
|
-
___
|
|
2022
|
-
|
|
2023
|
-
### dateToText
|
|
2024
|
-
|
|
2025
|
-
▸ **dateToText**(`date`, `format?`): `string`
|
|
2026
|
-
|
|
2027
|
-
#### Parameters
|
|
2028
|
-
|
|
2029
|
-
| Name | Type | Default value |
|
|
2030
|
-
| :------ | :------ | :------ |
|
|
2031
|
-
| `date` | `Date` | `undefined` |
|
|
2032
|
-
| `format` | `string` | `FormatDateStr` |
|
|
2033
|
-
|
|
2034
|
-
#### Returns
|
|
2035
|
-
|
|
2036
|
-
`string`
|
|
2037
|
-
|
|
2038
|
-
#### Defined in
|
|
2039
|
-
|
|
2040
|
-
[packages/ai-tool/src/utils/to-datetime.ts:29](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/to-datetime.ts#L29)
|
|
2041
|
-
|
|
2042
|
-
___
|
|
2043
|
-
|
|
2044
|
-
### expandEnv
|
|
2045
|
-
|
|
2046
|
-
▸ **expandEnv**(`options`): [`DotenvExpandOptions`](interfaces/DotenvExpandOptions.md)
|
|
2047
|
-
|
|
2048
|
-
Expand environment variables in the parsed object
|
|
2049
|
-
|
|
2050
|
-
#### Parameters
|
|
2051
|
-
|
|
2052
|
-
| Name | Type |
|
|
2053
|
-
| :------ | :------ |
|
|
2054
|
-
| `options` | [`DotenvExpandOptions`](interfaces/DotenvExpandOptions.md) |
|
|
2055
|
-
|
|
2056
|
-
#### Returns
|
|
2057
|
-
|
|
2058
|
-
[`DotenvExpandOptions`](interfaces/DotenvExpandOptions.md)
|
|
2059
|
-
|
|
2060
|
-
**`Example`**
|
|
2061
|
-
|
|
2062
|
-
```ts
|
|
2063
|
-
const myEnv = {}
|
|
2064
|
-
const env = {
|
|
2065
|
-
processEnv: myEnv,
|
|
2066
|
-
parsed: {
|
|
2067
|
-
WORD: 'World',
|
|
2068
|
-
HELLO: 'Hello ${WORD}'
|
|
2069
|
-
}
|
|
2070
|
-
}
|
|
2071
|
-
expandEnv.expand(env)
|
|
2072
|
-
|
|
2073
|
-
console.log(myEnv.HELLO) // Hello World
|
|
2074
|
-
console.log(process.env.HELLO) // undefined
|
|
2075
|
-
```
|
|
2076
|
-
|
|
2077
|
-
#### Defined in
|
|
2078
|
-
|
|
2079
|
-
[packages/ai-tool/src/utils/prompt/template/env.ts:82](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/template/env.ts#L82)
|
|
2080
|
-
|
|
2081
|
-
___
|
|
2082
|
-
|
|
2083
|
-
### expandObjEnv
|
|
2084
|
-
|
|
2085
|
-
▸ **expandObjEnv**(`obj`, `options?`, `parsedObjs?`): `any`
|
|
2086
|
-
|
|
2087
|
-
Expands environment variables in an object/array or string.
|
|
2088
|
-
|
|
2089
|
-
This function replaces placeholders like `${VAR}` in strings and recursively
|
|
2090
|
-
processes objects and arrays with environment variable references.
|
|
2091
|
-
|
|
2092
|
-
#### Parameters
|
|
2093
|
-
|
|
2094
|
-
| Name | Type | Description |
|
|
2095
|
-
| :------ | :------ | :------ |
|
|
2096
|
-
| `obj` | `any` | The object/array or string to be processed. Can be any value, but primarily designed for objects, array and strings. |
|
|
2097
|
-
| `options` | [`DotenvExpandOptions`](interfaces/DotenvExpandOptions.md) | Configuration options: - processEnv: - An object to source environment variables from, defaults to `process.env`. - parsed: - Specify an object to provide the value of environment variables. |
|
|
2098
|
-
| `parsedObjs?` | `WeakSet`\<`any`\> | - |
|
|
2099
|
-
|
|
2100
|
-
#### Returns
|
|
2101
|
-
|
|
2102
|
-
`any`
|
|
2103
|
-
|
|
2104
|
-
- Returns the expanded object or string.
|
|
2105
|
-
|
|
2106
|
-
**`Example`**
|
|
2107
|
-
|
|
2108
|
-
```ts
|
|
2109
|
-
const obj = {
|
|
2110
|
-
name: 'MyApp',
|
|
2111
|
-
envVar: '${ENV_VAR_NAME}',
|
|
2112
|
-
config: {
|
|
2113
|
-
url: 'http://${HOST}:${PORT}'
|
|
2114
|
-
},
|
|
2115
|
-
list: ['item1', '${ITEM2}']
|
|
2116
|
-
};
|
|
2117
|
-
// the expandedObj will have the actual values instead of placeholders.
|
|
2118
|
-
const expandedObj = expandObjEnv(obj, { processEnv: myCustomEnv }); // Assuming 'ENV_VAR_NAME' is defined as 'Production' and 'HOST', 'PORT', 'ITEM2' are set,
|
|
2119
|
-
```
|
|
2120
|
-
|
|
2121
|
-
#### Defined in
|
|
2122
|
-
|
|
2123
|
-
[packages/ai-tool/src/utils/prompt/template/env.ts:142](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/template/env.ts#L142)
|
|
2124
|
-
|
|
2125
|
-
___
|
|
2126
|
-
|
|
2127
|
-
### extNameLevel
|
|
2128
|
-
|
|
2129
|
-
▸ **extNameLevel**(`extName`): `number`
|
|
2130
|
-
|
|
2131
|
-
Calculates the level of an extension name.
|
|
2132
|
-
|
|
2133
|
-
The level represents the number of dots ('.') in the extension name, excluding the first dot which separates
|
|
2134
|
-
the base filename from the extension. For example, the level of ".txt" is 1, and the level of ".tar.gz" is 2.
|
|
2135
|
-
|
|
2136
|
-
#### Parameters
|
|
2137
|
-
|
|
2138
|
-
| Name | Type | Description |
|
|
2139
|
-
| :------ | :------ | :------ |
|
|
2140
|
-
| `extName` | `string` | The extension name to analyze. It should start with a dot ('.'). |
|
|
2141
|
-
|
|
2142
|
-
#### Returns
|
|
2143
|
-
|
|
2144
|
-
`number`
|
|
2145
|
-
|
|
2146
|
-
The level of the extension name, which is the count of dots minus one.
|
|
2147
|
-
|
|
2148
|
-
**`Example`**
|
|
2149
|
-
|
|
2150
|
-
```typescript
|
|
2151
|
-
// Returns 0
|
|
2152
|
-
extNameLevel("no-file-ext");
|
|
2153
|
-
|
|
2154
|
-
// Returns 2
|
|
2155
|
-
extNameLevel(".tar.gz");
|
|
2156
|
-
|
|
2157
|
-
// Returns 1
|
|
2158
|
-
extNameLevel(".json5");
|
|
2159
|
-
```
|
|
2160
|
-
|
|
2161
|
-
#### Defined in
|
|
2162
|
-
|
|
2163
|
-
[packages/ai-tool/src/utils/filename.ts:209](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/filename.ts#L209)
|
|
2164
|
-
|
|
2165
|
-
___
|
|
2166
|
-
|
|
2167
|
-
### fileIsExists
|
|
2168
|
-
|
|
2169
|
-
▸ **fileIsExists**(`filepath`): `undefined` \| `boolean`
|
|
2170
|
-
|
|
2171
|
-
Checks if a file (not a directory) exists at the specified path.
|
|
2172
|
-
|
|
2173
|
-
#### Parameters
|
|
2174
|
-
|
|
2175
|
-
| Name | Type | Description |
|
|
2176
|
-
| :------ | :------ | :------ |
|
|
2177
|
-
| `filepath` | `string` | The path to the file to check. |
|
|
2178
|
-
|
|
2179
|
-
#### Returns
|
|
2180
|
-
|
|
2181
|
-
`undefined` \| `boolean`
|
|
2182
|
-
|
|
2183
|
-
true if the file exists and is not a directory; otherwise, false.
|
|
2184
|
-
|
|
2185
|
-
**`Example`**
|
|
2186
|
-
|
|
2187
|
-
```typescript
|
|
2188
|
-
const exists = fileIsExists('path/to/file.txt');
|
|
2189
|
-
console.log(exists); // Outputs: true or false
|
|
2190
|
-
```
|
|
2191
|
-
|
|
2192
|
-
#### Defined in
|
|
2193
|
-
|
|
2194
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:18](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/load-file-from-paths.ts#L18)
|
|
2195
|
-
|
|
2196
|
-
___
|
|
2197
|
-
|
|
2198
|
-
### filenameReservedRegex
|
|
2199
|
-
|
|
2200
|
-
▸ **filenameReservedRegex**(): `RegExp`
|
|
2201
|
-
|
|
2202
|
-
Returns a new regular expression instance for reserved filename characters with the 'g' flag.
|
|
2203
|
-
use this to reset the with global option
|
|
2204
|
-
|
|
2205
|
-
#### Returns
|
|
2206
|
-
|
|
2207
|
-
`RegExp`
|
|
2208
|
-
|
|
2209
|
-
A compiled regular expression for reserved filename characters.
|
|
2210
|
-
|
|
2211
|
-
#### Defined in
|
|
2212
|
-
|
|
2213
|
-
[packages/ai-tool/src/utils/filename.ts:42](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/filename.ts#L42)
|
|
2214
|
-
|
|
2215
|
-
___
|
|
2216
|
-
|
|
2217
|
-
### filterValidFnScope
|
|
2218
|
-
|
|
2219
|
-
▸ **filterValidFnScope**(`scope?`): `undefined` \| `Record`\<`string`, `any`\>
|
|
2220
|
-
|
|
2221
|
-
#### Parameters
|
|
2222
|
-
|
|
2223
|
-
| Name | Type |
|
|
2224
|
-
| :------ | :------ |
|
|
2225
|
-
| `scope?` | `Record`\<`string`, `any`\> |
|
|
2226
|
-
|
|
2227
|
-
#### Returns
|
|
2228
|
-
|
|
2229
|
-
`undefined` \| `Record`\<`string`, `any`\>
|
|
2230
|
-
|
|
2231
|
-
#### Defined in
|
|
2232
|
-
|
|
2233
|
-
[packages/ai-tool/src/utils/parse-js-json.ts:33](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/parse-js-json.ts#L33)
|
|
2234
|
-
|
|
2235
|
-
___
|
|
2236
|
-
|
|
2237
|
-
### findPort
|
|
2238
|
-
|
|
2239
|
-
▸ **findPort**(`port`, `portRetryCount?`): `Promise`\<`number`\>
|
|
2240
|
-
|
|
2241
|
-
#### Parameters
|
|
2242
|
-
|
|
2243
|
-
| Name | Type | Default value |
|
|
2244
|
-
| :------ | :------ | :------ |
|
|
2245
|
-
| `port` | `string` \| `number` | `undefined` |
|
|
2246
|
-
| `portRetryCount` | `number` | `10` |
|
|
2247
|
-
|
|
2248
|
-
#### Returns
|
|
2249
|
-
|
|
2250
|
-
`Promise`\<`number`\>
|
|
2251
|
-
|
|
2252
|
-
#### Defined in
|
|
2253
|
-
|
|
2254
|
-
[packages/ai-tool/src/utils/find-port.ts:3](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/find-port.ts#L3)
|
|
2255
|
-
|
|
2256
|
-
___
|
|
2257
|
-
|
|
2258
|
-
### getAllEnumKeys
|
|
2259
|
-
|
|
2260
|
-
▸ **getAllEnumKeys**\<`T`\>(`enumType`): keyof typeof `enumType`[]
|
|
2261
|
-
|
|
2262
|
-
Retrieves all string keys from the given enumeration(number).
|
|
2263
|
-
|
|
2264
|
-
#### Type parameters
|
|
2265
|
-
|
|
2266
|
-
| Name | Type |
|
|
2267
|
-
| :------ | :------ |
|
|
2268
|
-
| `T` | extends `object` |
|
|
2269
|
-
|
|
2270
|
-
#### Parameters
|
|
2271
|
-
|
|
2272
|
-
| Name | Type | Description |
|
|
2273
|
-
| :------ | :------ | :------ |
|
|
2274
|
-
| `enumType` | `T` | The enumeration type with numeric values for which to retrieve keys. |
|
|
2275
|
-
|
|
2276
|
-
#### Returns
|
|
2277
|
-
|
|
2278
|
-
keyof typeof `enumType`[]
|
|
2279
|
-
|
|
2280
|
-
An array containing all string keys of the specified enumeration.
|
|
2281
|
-
|
|
2282
|
-
#### Defined in
|
|
2283
|
-
|
|
2284
|
-
[packages/ai-tool/src/utils/get-all-enum-keys.ts:7](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/get-all-enum-keys.ts#L7)
|
|
2285
|
-
|
|
2286
|
-
___
|
|
2287
|
-
|
|
2288
|
-
### getConfigFileNames
|
|
2289
|
-
|
|
2290
|
-
▸ **getConfigFileNames**(`directoryPath`, `filter?`): `string`[]
|
|
2291
|
-
|
|
2292
|
-
#### Parameters
|
|
2293
|
-
|
|
2294
|
-
| Name | Type |
|
|
2295
|
-
| :------ | :------ |
|
|
2296
|
-
| `directoryPath` | `string` |
|
|
2297
|
-
| `filter?` | `ConfigFilesFilter` |
|
|
2298
|
-
|
|
2299
|
-
#### Returns
|
|
2300
|
-
|
|
2301
|
-
`string`[]
|
|
2302
|
-
|
|
2303
|
-
#### Defined in
|
|
2304
|
-
|
|
2305
|
-
[packages/ai-tool/src/utils/config.ts:56](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/config.ts#L56)
|
|
2306
|
-
|
|
2307
|
-
___
|
|
2308
|
-
|
|
2309
|
-
### getConfigs
|
|
2310
|
-
|
|
2311
|
-
▸ **getConfigs**(`directoryPath`, `filter?`): `any`[]
|
|
2312
|
-
|
|
2313
|
-
#### Parameters
|
|
2314
|
-
|
|
2315
|
-
| Name | Type |
|
|
2316
|
-
| :------ | :------ |
|
|
2317
|
-
| `directoryPath` | `string` |
|
|
2318
|
-
| `filter?` | `ConfigFilesFilter` |
|
|
2319
|
-
|
|
2320
|
-
#### Returns
|
|
2321
|
-
|
|
2322
|
-
`any`[]
|
|
2323
|
-
|
|
2324
|
-
#### Defined in
|
|
2325
|
-
|
|
2326
|
-
[packages/ai-tool/src/utils/config.ts:80](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/config.ts#L80)
|
|
2327
|
-
|
|
2328
|
-
___
|
|
2329
|
-
|
|
2330
|
-
### getKeysPath
|
|
2331
|
-
|
|
2332
|
-
▸ **getKeysPath**\<`TValue`\>(`value`): `string`[]
|
|
2333
|
-
|
|
2334
|
-
Retrieves an array of all key paths as strings for a nested object or array.
|
|
2335
|
-
|
|
2336
|
-
#### Type parameters
|
|
2337
|
-
|
|
2338
|
-
| Name | Type |
|
|
2339
|
-
| :------ | :------ |
|
|
2340
|
-
| `TValue` | extends `object` |
|
|
2341
|
-
|
|
2342
|
-
#### Parameters
|
|
2343
|
-
|
|
2344
|
-
| Name | Type | Description |
|
|
2345
|
-
| :------ | :------ | :------ |
|
|
2346
|
-
| `value` | `TValue` | The object or array to extract the paths from. |
|
|
2347
|
-
|
|
2348
|
-
#### Returns
|
|
2349
|
-
|
|
2350
|
-
`string`[]
|
|
2351
|
-
|
|
2352
|
-
- An array of strings containing all the key paths.
|
|
2353
|
-
|
|
2354
|
-
**`Example`**
|
|
2355
|
-
|
|
2356
|
-
```
|
|
2357
|
-
const obj = { a: { b: { c: 1 } }, d: [0, { e: 2 }] };
|
|
2358
|
-
console.log(getKeysPath(obj)); // Output: ['a.b.c', 'd[0]', 'd[1].e']
|
|
2359
|
-
```
|
|
2360
|
-
|
|
2361
|
-
#### Defined in
|
|
2362
|
-
|
|
2363
|
-
[packages/ai-tool/src/utils/get-keys-path.ts:16](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/get-keys-path.ts#L16)
|
|
2364
|
-
|
|
2365
|
-
___
|
|
2366
|
-
|
|
2367
|
-
### getMultiLevelExtname
|
|
2368
|
-
|
|
2369
|
-
▸ **getMultiLevelExtname**(`filename`, `level?`): `string`
|
|
2370
|
-
|
|
2371
|
-
Retrieves multi-level file extension
|
|
2372
|
-
|
|
2373
|
-
#### Parameters
|
|
2374
|
-
|
|
2375
|
-
| Name | Type | Default value | Description |
|
|
2376
|
-
| :------ | :------ | :------ | :------ |
|
|
2377
|
-
| `filename` | `string` | `undefined` | The file name |
|
|
2378
|
-
| `level` | `number` | `1` | The level, default is 1, indicating the number of extension levels to retrieve |
|
|
2379
|
-
|
|
2380
|
-
#### Returns
|
|
2381
|
-
|
|
2382
|
-
`string`
|
|
2383
|
-
|
|
2384
|
-
Returns a concatenated string of multiple extensions, or an empty string if no extension is found
|
|
2385
|
-
|
|
2386
|
-
#### Defined in
|
|
2387
|
-
|
|
2388
|
-
[packages/ai-tool/src/utils/filename.ts:174](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/filename.ts#L174)
|
|
2389
|
-
|
|
2390
|
-
___
|
|
2391
|
-
|
|
2392
|
-
### getPackageDir
|
|
2393
|
-
|
|
2394
|
-
▸ **getPackageDir**(`cwd`): `string`
|
|
2395
|
-
|
|
2396
|
-
Retrieves the package directory from the current working directory.
|
|
2397
|
-
|
|
2398
|
-
#### Parameters
|
|
2399
|
-
|
|
2400
|
-
| Name | Type | Description |
|
|
2401
|
-
| :------ | :------ | :------ |
|
|
2402
|
-
| `cwd` | `string` | The current working directory. Notes: - The project root directory must contain either the `src` (source files directory) or `dist` (compiled files directory) as a fallback. - If `packageDirectorySync` fails to find the package directory, it falls back to checking for `src` or `dist` directories. - If none of these directories are found, an error is thrown. * |
|
|
2403
|
-
|
|
2404
|
-
#### Returns
|
|
2405
|
-
|
|
2406
|
-
`string`
|
|
2407
|
-
|
|
2408
|
-
**`Example`**
|
|
2409
|
-
|
|
2410
|
-
```ts
|
|
2411
|
-
// Example usage
|
|
2412
|
-
const packageDir = getPackageDir(__dirname);
|
|
2413
|
-
console.log(packageDir); // Output: '/path/to/project'
|
|
2414
|
-
```
|
|
2415
|
-
|
|
2416
|
-
#### Defined in
|
|
2417
|
-
|
|
2418
|
-
[packages/ai-tool/src/utils/get-package-dir.ts:18](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/get-package-dir.ts#L18)
|
|
2419
|
-
|
|
2420
|
-
___
|
|
2421
|
-
|
|
2422
|
-
### getRealFilepath
|
|
2423
|
-
|
|
2424
|
-
▸ **getRealFilepath**(`filepath`): `string`
|
|
2425
|
-
|
|
2426
|
-
Resolves the real file path, handling symbolic links.
|
|
2427
|
-
|
|
2428
|
-
#### Parameters
|
|
2429
|
-
|
|
2430
|
-
| Name | Type | Description |
|
|
2431
|
-
| :------ | :------ | :------ |
|
|
2432
|
-
| `filepath` | `string` | The file path to resolve. |
|
|
2433
|
-
|
|
2434
|
-
#### Returns
|
|
2435
|
-
|
|
2436
|
-
`string`
|
|
2437
|
-
|
|
2438
|
-
The real file path.
|
|
2439
|
-
|
|
2440
|
-
**`Example`**
|
|
2441
|
-
|
|
2442
|
-
```typescript
|
|
2443
|
-
const realPath = getRealFilepath('/path/to/symbolic/link');
|
|
2444
|
-
console.log(realPath); // Outputs the resolved path.
|
|
2445
|
-
```
|
|
2446
|
-
|
|
2447
|
-
#### Defined in
|
|
2448
|
-
|
|
2449
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:172](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/load-file-from-paths.ts#L172)
|
|
2450
|
-
|
|
2451
|
-
___
|
|
2452
|
-
|
|
2453
|
-
### getResponseErrorReadableStream
|
|
2454
|
-
|
|
2455
|
-
▸ **getResponseErrorReadableStream**(`body?`): `ReadableStream`\<`any`\>
|
|
2456
|
-
|
|
2457
|
-
#### Parameters
|
|
2458
|
-
|
|
2459
|
-
| Name | Type |
|
|
2460
|
-
| :------ | :------ |
|
|
2461
|
-
| `body?` | ``null`` \| `ReadableStream`\<`Uint8Array`\> |
|
|
2462
|
-
|
|
2463
|
-
#### Returns
|
|
2464
|
-
|
|
2465
|
-
`ReadableStream`\<`any`\>
|
|
2466
|
-
|
|
2467
|
-
#### Defined in
|
|
2468
|
-
|
|
2469
|
-
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:12](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/stream/error-readable-stream.ts#L12)
|
|
2470
|
-
|
|
2471
|
-
___
|
|
2472
|
-
|
|
2473
|
-
### hfParse
|
|
2474
|
-
|
|
2475
|
-
▸ **hfParse**(`tokens`): `Program`
|
|
2476
|
-
|
|
2477
|
-
Generate the Abstract Syntax Tree (AST) from a list of tokens.
|
|
2478
|
-
Operator precedence can be found here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence#table
|
|
2479
|
-
|
|
2480
|
-
#### Parameters
|
|
2481
|
-
|
|
2482
|
-
| Name | Type |
|
|
2483
|
-
| :------ | :------ |
|
|
2484
|
-
| `tokens` | `Token`[] |
|
|
2485
|
-
|
|
2486
|
-
#### Returns
|
|
2487
|
-
|
|
2488
|
-
`Program`
|
|
2489
|
-
|
|
2490
|
-
#### Defined in
|
|
2491
|
-
|
|
2492
|
-
[packages/ai-tool/src/utils/prompt/template/jinja/src/parser.ts:32](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/template/jinja/src/parser.ts#L32)
|
|
2493
|
-
|
|
2494
|
-
___
|
|
2495
|
-
|
|
2496
|
-
### hfTokenize
|
|
2497
|
-
|
|
2498
|
-
▸ **hfTokenize**(`source`, `options?`): `Token`[]
|
|
2499
|
-
|
|
2500
|
-
Generate a list of tokens from a source string.
|
|
2501
|
-
|
|
2502
|
-
#### Parameters
|
|
2503
|
-
|
|
2504
|
-
| Name | Type |
|
|
2505
|
-
| :------ | :------ |
|
|
2506
|
-
| `source` | `string` |
|
|
2507
|
-
| `options` | `PreprocessOptions` |
|
|
2508
|
-
|
|
2509
|
-
#### Returns
|
|
2510
|
-
|
|
2511
|
-
`Token`[]
|
|
2512
|
-
|
|
2513
|
-
#### Defined in
|
|
2514
|
-
|
|
2515
|
-
[packages/ai-tool/src/utils/prompt/template/jinja/src/lexer.ts:200](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/template/jinja/src/lexer.ts#L200)
|
|
2516
|
-
|
|
2517
|
-
___
|
|
2518
|
-
|
|
2519
|
-
### interpolateEnv
|
|
2520
|
-
|
|
2521
|
-
▸ **interpolateEnv**(`value`, `processEnv`, `parsed`): `any`
|
|
2522
|
-
|
|
2523
|
-
#### Parameters
|
|
2524
|
-
|
|
2525
|
-
| Name | Type |
|
|
2526
|
-
| :------ | :------ |
|
|
2527
|
-
| `value` | `string` |
|
|
2528
|
-
| `processEnv` | `any` |
|
|
2529
|
-
| `parsed` | `any` |
|
|
2530
|
-
|
|
2531
|
-
#### Returns
|
|
2532
|
-
|
|
2533
|
-
`any`
|
|
2534
|
-
|
|
2535
|
-
#### Defined in
|
|
2536
|
-
|
|
2537
|
-
[packages/ai-tool/src/utils/prompt/template/env.ts:17](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/template/env.ts#L17)
|
|
2538
|
-
|
|
2539
|
-
___
|
|
2540
|
-
|
|
2541
|
-
### interpolateFString
|
|
2542
|
-
|
|
2543
|
-
▸ **interpolateFString**(`nodes`, `values`): `string`
|
|
2544
|
-
|
|
2545
|
-
Type that represents a function that takes a template string and a set
|
|
2546
|
-
of input values, and returns a string where all variables in the
|
|
2547
|
-
template have been replaced with their corresponding values.
|
|
2548
|
-
|
|
2549
|
-
#### Parameters
|
|
2550
|
-
|
|
2551
|
-
| Name | Type |
|
|
2552
|
-
| :------ | :------ |
|
|
2553
|
-
| `nodes` | [`FStringPromptTemplateNode`](modules.md#fstringprompttemplatenode)[] |
|
|
2554
|
-
| `values` | `Record`\<`string`, `any`\> |
|
|
2555
|
-
|
|
2556
|
-
#### Returns
|
|
2557
|
-
|
|
2558
|
-
`string`
|
|
2559
|
-
|
|
2560
|
-
#### Defined in
|
|
2561
|
-
|
|
2562
|
-
[packages/ai-tool/src/utils/prompt/template/python.ts:71](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/template/python.ts#L71)
|
|
2563
|
-
|
|
2564
|
-
___
|
|
2565
|
-
|
|
2566
|
-
### interpolateGolangTemplate
|
|
2567
|
-
|
|
2568
|
-
▸ **interpolateGolangTemplate**(`str`, `variables`, `initVars?`): `string`
|
|
2569
|
-
|
|
2570
|
-
Parse and interpolate template
|
|
2571
|
-
|
|
2572
|
-
#### Parameters
|
|
2573
|
-
|
|
2574
|
-
| Name | Type | Description |
|
|
2575
|
-
| :------ | :------ | :------ |
|
|
2576
|
-
| `str` | `string` | golang style template |
|
|
2577
|
-
| `variables` | `Record`\<`string`, `any`\> | object of variables to insert |
|
|
2578
|
-
| `initVars?` | `boolean` | - |
|
|
2579
|
-
|
|
2580
|
-
#### Returns
|
|
2581
|
-
|
|
2582
|
-
`string`
|
|
2583
|
-
|
|
2584
|
-
#### Defined in
|
|
2585
|
-
|
|
2586
|
-
[packages/ai-tool/src/utils/prompt/template/golang.ts:269](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/template/golang.ts#L269)
|
|
2587
|
-
|
|
2588
|
-
___
|
|
2589
|
-
|
|
2590
|
-
### isModelNameMatched
|
|
2591
|
-
|
|
2592
|
-
▸ **isModelNameMatched**(`modelName`, `rule?`): `undefined` \| `string` \| `RegExpExecArray`
|
|
2593
|
-
|
|
2594
|
-
Checks if the provided model name matches the given rule.
|
|
2595
|
-
|
|
2596
|
-
#### Parameters
|
|
2597
|
-
|
|
2598
|
-
| Name | Type | Description |
|
|
2599
|
-
| :------ | :------ | :------ |
|
|
2600
|
-
| `modelName` | `string` | The name of the model to check. |
|
|
2601
|
-
| `rule?` | [`AIModelNameRules`](modules.md#aimodelnamerules) | An optional rule that can be a string, an array of strings, a regular expression, or a function. |
|
|
2602
|
-
|
|
2603
|
-
#### Returns
|
|
2604
|
-
|
|
2605
|
-
`undefined` \| `string` \| `RegExpExecArray`
|
|
2606
|
-
|
|
2607
|
-
matched result if the model name matches the rule, undefined otherwise.
|
|
2608
|
-
|
|
2609
|
-
**`Example`**
|
|
2610
|
-
|
|
2611
|
-
```ts
|
|
2612
|
-
IsModelNameMatched("gpt-3", "gpt-3") // returns true
|
|
2613
|
-
IsModelNameMatched("GPT-3", "gpt-3") // returns true
|
|
2614
|
-
IsModelNameMatched("GPT-3", ["gpt-3", "gpt-4"]) // returns true
|
|
2615
|
-
IsModelNameMatched("gpt-3", /^gpt-\d+$/) // returns true
|
|
2616
|
-
IsModelNameMatched("gpt-3", (modelName) => modelName.startsWith("gpt-")) // returns true
|
|
2617
|
-
IsModelNameMatched("gpt-2", "gpt-3") // returns false
|
|
2618
|
-
IsModelNameMatched("gpt-2", ["gpt-3", "gpt-4"]) // returns false
|
|
2619
|
-
IsModelNameMatched("gpt-2", /^gpt-\d+$/) // returns false
|
|
2620
|
-
IsModelNameMatched("gpt-2", (modelName) => modelName.startsWith("gpt-")) // returns false
|
|
2621
|
-
```
|
|
2622
|
-
|
|
2623
|
-
#### Defined in
|
|
2624
|
-
|
|
2625
|
-
[packages/ai-tool/src/utils/is-model-name-matched.ts:21](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/is-model-name-matched.ts#L21)
|
|
2626
|
-
|
|
2627
|
-
___
|
|
2628
|
-
|
|
2629
|
-
### isValidFilename
|
|
2630
|
-
|
|
2631
|
-
▸ **isValidFilename**(`filename`): `boolean` \| ``""``
|
|
2632
|
-
|
|
2633
|
-
Validates if a given string is a valid filename.
|
|
2634
|
-
|
|
2635
|
-
#### Parameters
|
|
2636
|
-
|
|
2637
|
-
| Name | Type | Description |
|
|
2638
|
-
| :------ | :------ | :------ |
|
|
2639
|
-
| `filename` | `string` | The filename to be validated. |
|
|
2640
|
-
|
|
2641
|
-
#### Returns
|
|
2642
|
-
|
|
2643
|
-
`boolean` \| ``""``
|
|
2644
|
-
|
|
2645
|
-
True if the filename is valid, false otherwise.
|
|
2646
|
-
|
|
2647
|
-
**`Throws`**
|
|
2648
|
-
|
|
2649
|
-
If the input is not a string.
|
|
2650
|
-
|
|
2651
|
-
**`Example`**
|
|
2652
|
-
|
|
2653
|
-
```ts
|
|
2654
|
-
isValidFilename('myFile.txt'); // Returns true
|
|
2655
|
-
isValidFilename('my<file.txt'); // Returns false
|
|
2656
|
-
```
|
|
2657
|
-
|
|
2658
|
-
#### Defined in
|
|
2659
|
-
|
|
2660
|
-
[packages/ai-tool/src/utils/filename.ts:63](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/filename.ts#L63)
|
|
2661
|
-
|
|
2662
|
-
___
|
|
2663
|
-
|
|
2664
|
-
### isValidFilepath
|
|
2665
|
-
|
|
2666
|
-
▸ **isValidFilepath**(`filepath`): `boolean`
|
|
2667
|
-
|
|
2668
|
-
Validates whether the given filepath is valid.
|
|
2669
|
-
|
|
2670
|
-
#### Parameters
|
|
2671
|
-
|
|
2672
|
-
| Name | Type | Description |
|
|
2673
|
-
| :------ | :------ | :------ |
|
|
2674
|
-
| `filepath` | `string` | The filepath to be checked, represented as a string. |
|
|
2675
|
-
|
|
2676
|
-
#### Returns
|
|
2677
|
-
|
|
2678
|
-
`boolean`
|
|
2679
|
-
|
|
2680
|
-
A boolean indicating whether the filepath is valid. Returns true if valid; false otherwise.
|
|
2681
|
-
|
|
2682
|
-
#### Defined in
|
|
2683
|
-
|
|
2684
|
-
[packages/ai-tool/src/utils/filename.ts:72](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/filename.ts#L72)
|
|
2685
|
-
|
|
2686
|
-
___
|
|
2687
|
-
|
|
2688
|
-
### isWebStream
|
|
2689
|
-
|
|
2690
|
-
▸ **isWebStream**(`val`): `boolean`
|
|
2691
|
-
|
|
2692
|
-
#### Parameters
|
|
2693
|
-
|
|
2694
|
-
| Name | Type |
|
|
2695
|
-
| :------ | :------ |
|
|
2696
|
-
| `val` | `any` |
|
|
2697
|
-
|
|
2698
|
-
#### Returns
|
|
2699
|
-
|
|
2700
|
-
`boolean`
|
|
2701
|
-
|
|
2702
|
-
#### Defined in
|
|
2703
|
-
|
|
2704
|
-
[packages/ai-tool/src/utils/stream/is-web-stream.ts:1](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/stream/is-web-stream.ts#L1)
|
|
2705
|
-
|
|
2706
|
-
___
|
|
2707
|
-
|
|
2708
|
-
### jsonFilterToWhere
|
|
2709
|
-
|
|
2710
|
-
▸ **jsonFilterToWhere**(`filter`, `wrapKey?`): `string`
|
|
2711
|
-
|
|
2712
|
-
Converts a filter object to a SQLite WHERE clause.
|
|
2713
|
-
|
|
2714
|
-
#### Parameters
|
|
2715
|
-
|
|
2716
|
-
| Name | Type | Description |
|
|
2717
|
-
| :------ | :------ | :------ |
|
|
2718
|
-
| `filter` | [`JsonFilter`](interfaces/JsonFilter.md) \| [`JsonFilter`](interfaces/JsonFilter.md)[] | The filter object to convert. |
|
|
2719
|
-
| `wrapKey?` | (`k`: `string`) => `string` | - |
|
|
2720
|
-
|
|
2721
|
-
#### Returns
|
|
2722
|
-
|
|
2723
|
-
`string`
|
|
2724
|
-
|
|
2725
|
-
The generated WHERE clause.
|
|
2726
|
-
|
|
2727
|
-
**`Example`**
|
|
2728
|
-
|
|
2729
|
-
```ts
|
|
2730
|
-
const jsonFilter: Filter = {
|
|
2731
|
-
$and: [
|
|
2732
|
-
{ age: { $gt: 18, $lt: 30 } },
|
|
2733
|
-
{ name: { $like: 'John%', $nlike: 'Doe%' } },
|
|
2734
|
-
{ hobbies: { $in: ['reading', 'writing'] } },
|
|
2735
|
-
{ $or: [{ gender: 'male' }, { country: 'USA' }] },
|
|
2736
|
-
{ $and: [{ status: 'active' }, { registered: new Date('2020-01-01') }] },
|
|
2737
|
-
],
|
|
2738
|
-
};
|
|
2739
|
-
|
|
2740
|
-
console.log(jsonFilterToWhere(jsonFilter)); // Outputs a WHERE clause based on the given filter
|
|
2741
|
-
```
|
|
2742
|
-
|
|
2743
|
-
#### Defined in
|
|
2744
|
-
|
|
2745
|
-
[packages/ai-tool/src/utils/json-filter.ts:123](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/json-filter.ts#L123)
|
|
2746
|
-
|
|
2747
|
-
___
|
|
2748
|
-
|
|
2749
|
-
### jsonToMarkdownStr
|
|
2750
|
-
|
|
2751
|
-
▸ **jsonToMarkdownStr**(`mem`, `options?`): `string`
|
|
2752
|
-
|
|
2753
|
-
#### Parameters
|
|
2754
|
-
|
|
2755
|
-
| Name | Type |
|
|
2756
|
-
| :------ | :------ |
|
|
2757
|
-
| `mem` | `any` |
|
|
2758
|
-
| `options?` | `Object` |
|
|
2759
|
-
| `options.arrayTag?` | `string` |
|
|
2760
|
-
| `options.level?` | `number` |
|
|
2761
|
-
| `options.objectTag?` | `string` |
|
|
2762
|
-
| `options.visiting?` | `Set`\<`any`\> |
|
|
2763
|
-
|
|
2764
|
-
#### Returns
|
|
2765
|
-
|
|
2766
|
-
`string`
|
|
2767
|
-
|
|
2768
|
-
#### Defined in
|
|
2769
|
-
|
|
2770
|
-
[packages/ai-tool/src/utils/json-to-markdown-str.ts:2](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/json-to-markdown-str.ts#L2)
|
|
2771
|
-
|
|
2772
|
-
___
|
|
2773
|
-
|
|
2774
|
-
### loadFileFromPaths
|
|
2775
|
-
|
|
2776
|
-
▸ **loadFileFromPaths**(`filename`, `searchPaths?`, `extNames?`, `options?`): `Buffer`
|
|
2777
|
-
|
|
2778
|
-
Loads a file from given paths, optionally searching for specific extensions.
|
|
2779
|
-
|
|
2780
|
-
#### Parameters
|
|
2781
|
-
|
|
2782
|
-
| Name | Type | Description |
|
|
2783
|
-
| :------ | :------ | :------ |
|
|
2784
|
-
| `filename` | `string` | The base filename to search for, without any file extension. |
|
|
2785
|
-
| `searchPaths?` | `string`[] | An array of directories to search for the file. Defaults to the current directory (`"."`) if not provided. |
|
|
2786
|
-
| `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. |
|
|
2787
|
-
| `options?` | `Object` | - |
|
|
2788
|
-
| `options.exclude?` | `string` \| `string`[] | - |
|
|
2789
|
-
| `options.filepath?` | `string` | - |
|
|
2790
|
-
| `options.signal?` | `AbortSignal` | - |
|
|
2791
|
-
|
|
2792
|
-
#### Returns
|
|
2793
|
-
|
|
2794
|
-
`Buffer`
|
|
2795
|
-
|
|
2796
|
-
The contents of the found file as a Buffer.
|
|
2797
|
-
|
|
2798
|
-
**`Throws`**
|
|
2799
|
-
|
|
2800
|
-
If the file is not found in any of the search paths.
|
|
2801
|
-
|
|
2802
|
-
**`Example`**
|
|
2803
|
-
|
|
2804
|
-
```typescript
|
|
2805
|
-
const content = loadFileFromPaths('config', ['/etc', '/usr/local/etc'], ['.json', '.yaml']);
|
|
2806
|
-
```
|
|
2807
|
-
|
|
2808
|
-
#### Defined in
|
|
2809
|
-
|
|
2810
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:39](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/load-file-from-paths.ts#L39)
|
|
2811
|
-
|
|
2812
|
-
___
|
|
2813
|
-
|
|
2814
|
-
### loadTextFromPaths
|
|
2815
|
-
|
|
2816
|
-
▸ **loadTextFromPaths**(`filename`, `searchPaths?`, `extNames?`, `options?`, `exclude?`): `string`
|
|
2817
|
-
|
|
2818
|
-
#### Parameters
|
|
2819
|
-
|
|
2820
|
-
| Name | Type |
|
|
2821
|
-
| :------ | :------ |
|
|
2822
|
-
| `filename` | `string` |
|
|
2823
|
-
| `searchPaths?` | `string`[] |
|
|
2824
|
-
| `extNames?` | `string`[] |
|
|
2825
|
-
| `options?` | `BufferEncoding` \| \{ `encoding?`: BufferEncoding \| undefined ; `filepath?`: `string` ; `signal?`: `AbortSignal` } |
|
|
2826
|
-
| `exclude?` | `string` \| `string`[] |
|
|
2827
|
-
|
|
2828
|
-
#### Returns
|
|
2829
|
-
|
|
2830
|
-
`string`
|
|
2831
|
-
|
|
2832
|
-
#### Defined in
|
|
2833
|
-
|
|
2834
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:96](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/load-file-from-paths.ts#L96)
|
|
2835
|
-
|
|
2836
|
-
___
|
|
2837
|
-
|
|
2838
|
-
### makeToolFuncCancelable
|
|
2839
|
-
|
|
2840
|
-
▸ **makeToolFuncCancelable**(`Tool`, `options?`): typeof [`ToolFunc`](classes/ToolFunc.md)
|
|
2841
|
-
|
|
2842
|
-
#### Parameters
|
|
2843
|
-
|
|
2844
|
-
| Name | Type |
|
|
2845
|
-
| :------ | :------ |
|
|
2846
|
-
| `Tool` | typeof [`ToolFunc`](classes/ToolFunc.md) |
|
|
2847
|
-
| `options?` | [`CancelableAbilityOptions`](interfaces/CancelableAbilityOptions.md) |
|
|
2848
|
-
|
|
2849
|
-
#### Returns
|
|
2850
|
-
|
|
2851
|
-
typeof [`ToolFunc`](classes/ToolFunc.md)
|
|
2852
|
-
|
|
2853
|
-
#### Defined in
|
|
2854
|
-
|
|
2855
|
-
[packages/ai-tool/src/utils/cancelable-ability.ts:340](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/cancelable-ability.ts#L340)
|
|
2856
|
-
|
|
2857
|
-
___
|
|
2858
|
-
|
|
2859
|
-
### matchUrlProtocol
|
|
2860
|
-
|
|
2861
|
-
▸ **matchUrlProtocol**(`name`): `undefined` \| `string`
|
|
2862
|
-
|
|
2863
|
-
Extracts the protocol part from a URL-like string.
|
|
2864
|
-
|
|
2865
|
-
This function checks a given string to find the protocol section of a URL.
|
|
2866
|
-
If the string contains the sequence '://', it returns the substring from the start of the string
|
|
2867
|
-
up to the '//' characters. If the sequence is not found, the function returns undefined.
|
|
2868
|
-
|
|
2869
|
-
#### Parameters
|
|
2870
|
-
|
|
2871
|
-
| Name | Type | Description |
|
|
2872
|
-
| :------ | :------ | :------ |
|
|
2873
|
-
| `name` | `string` | The string to inspect, expected to contain a URL. |
|
|
2874
|
-
|
|
2875
|
-
#### Returns
|
|
2876
|
-
|
|
2877
|
-
`undefined` \| `string`
|
|
2878
|
-
|
|
2879
|
-
- The protocol part if '://' is found; otherwise, undefined.
|
|
2880
|
-
|
|
2881
|
-
**`Example`**
|
|
2882
|
-
|
|
2883
|
-
```ts
|
|
2884
|
-
// Returns "http"
|
|
2885
|
-
matchUrlProtocol("http://example.com");
|
|
2886
|
-
```
|
|
2887
|
-
|
|
2888
|
-
**`Example`**
|
|
2889
|
-
|
|
2890
|
-
```ts
|
|
2891
|
-
// Returns "ftp"
|
|
2892
|
-
matchUrlProtocol("ftp://myftpserver.com");
|
|
2893
|
-
```
|
|
2894
|
-
|
|
2895
|
-
**`Example`**
|
|
2896
|
-
|
|
2897
|
-
```ts
|
|
2898
|
-
// Returns undefined
|
|
2899
|
-
matchUrlProtocol("noProtocolHere");
|
|
2900
|
-
```
|
|
2901
|
-
|
|
2902
|
-
#### Defined in
|
|
2903
|
-
|
|
2904
|
-
[packages/ai-tool/src/utils/match-url-protocol.ts:23](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/match-url-protocol.ts#L23)
|
|
2905
|
-
|
|
2906
|
-
___
|
|
2907
|
-
|
|
2908
|
-
### memoize
|
|
2909
|
-
|
|
2910
|
-
▸ **memoize**\<`F`\>(`fn`, `options?`): `F` & `Memoized`\<`F`\>
|
|
2911
|
-
|
|
2912
|
-
#### Type parameters
|
|
2913
|
-
|
|
2914
|
-
| Name | Type |
|
|
2915
|
-
| :------ | :------ |
|
|
2916
|
-
| `F` | extends (...`args`: `any`[]) => `any` |
|
|
2917
|
-
|
|
2918
|
-
#### Parameters
|
|
2919
|
-
|
|
2920
|
-
| Name | Type |
|
|
2921
|
-
| :------ | :------ |
|
|
2922
|
-
| `fn` | `any` |
|
|
2923
|
-
| `options?` | `Options`\<`F`\> |
|
|
2924
|
-
|
|
2925
|
-
#### Returns
|
|
2926
|
-
|
|
2927
|
-
`F` & `Memoized`\<`F`\>
|
|
2928
|
-
|
|
2929
|
-
#### Defined in
|
|
2930
|
-
|
|
2931
|
-
[packages/ai-tool/src/utils/memoize.ts:14](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/memoize.ts#L14)
|
|
2932
|
-
|
|
2933
|
-
___
|
|
2934
|
-
|
|
2935
|
-
### messagesToText
|
|
2936
|
-
|
|
2937
|
-
▸ **messagesToText**(`messages`): `string`
|
|
2938
|
-
|
|
2939
|
-
#### Parameters
|
|
2940
|
-
|
|
2941
|
-
| Name | Type |
|
|
2942
|
-
| :------ | :------ |
|
|
2943
|
-
| `messages` | [`AIChatMessageParamBase`](interfaces/AIChatMessageParamBase.md)[] |
|
|
2944
|
-
|
|
2945
|
-
#### Returns
|
|
2946
|
-
|
|
2947
|
-
`string`
|
|
2948
|
-
|
|
2949
|
-
#### Defined in
|
|
2950
|
-
|
|
2951
|
-
[packages/ai-tool/src/utils/chat.ts:116](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/chat.ts#L116)
|
|
2952
|
-
|
|
2953
|
-
___
|
|
2954
|
-
|
|
2955
|
-
### paramsSizeToScaleStr
|
|
2956
|
-
|
|
2957
|
-
▸ **paramsSizeToScaleStr**(`paramsSize`, `fractionDigits?`): `string`
|
|
2958
|
-
|
|
2959
|
-
Formats a parameter size in bytes into a string with an appropriate scale (T, B, M, or K),
|
|
2960
|
-
optionally specifying the number of fractional digits to display.
|
|
2961
|
-
|
|
2962
|
-
#### Parameters
|
|
2963
|
-
|
|
2964
|
-
| Name | Type | Default value | Description |
|
|
2965
|
-
| :------ | :------ | :------ | :------ |
|
|
2966
|
-
| `paramsSize` | `number` | `undefined` | The parameter size in bytes. |
|
|
2967
|
-
| `fractionDigits` | `number` | `0` | The number of fractional digits to include in the formatted output. Default is 0 (no fractional digits). |
|
|
2968
|
-
|
|
2969
|
-
#### Returns
|
|
2970
|
-
|
|
2971
|
-
`string`
|
|
2972
|
-
|
|
2973
|
-
A string representing the formatted parameter size with the appropriate scale unit and the specified number of fractional digits.
|
|
2974
|
-
|
|
2975
|
-
#### Defined in
|
|
2976
|
-
|
|
2977
|
-
[packages/ai-tool/src/utils/convert-params-size.ts:11](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/convert-params-size.ts#L11)
|
|
2978
|
-
|
|
2979
|
-
___
|
|
2980
|
-
|
|
2981
|
-
### parseCommand
|
|
2982
|
-
|
|
2983
|
-
▸ **parseCommand**(`commandStr`, `scope?`, `options?`): `Promise`\<\{ `args?`: `Record`\<`string`, `any`\> ; `command`: `string` }\>
|
|
2984
|
-
|
|
2985
|
-
#### Parameters
|
|
2986
|
-
|
|
2987
|
-
| Name | Type |
|
|
2988
|
-
| :------ | :------ |
|
|
2989
|
-
| `commandStr` | `string` |
|
|
2990
|
-
| `scope?` | `Record`\<`string`, `any`\> |
|
|
2991
|
-
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) |
|
|
2992
|
-
|
|
2993
|
-
#### Returns
|
|
2994
|
-
|
|
2995
|
-
`Promise`\<\{ `args?`: `Record`\<`string`, `any`\> ; `command`: `string` }\>
|
|
2996
|
-
|
|
2997
|
-
#### Defined in
|
|
2998
|
-
|
|
2999
|
-
[packages/ai-tool/src/utils/parse-command.ts:377](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/parse-command.ts#L377)
|
|
3000
|
-
|
|
3001
|
-
___
|
|
3002
|
-
|
|
3003
|
-
### parseFString
|
|
3004
|
-
|
|
3005
|
-
▸ **parseFString**(`template`): [`FStringPromptTemplateNode`](modules.md#fstringprompttemplatenode)[]
|
|
3006
|
-
|
|
3007
|
-
Type that represents a function that takes a template string and
|
|
3008
|
-
returns an array of `ParsedFStringNode`.
|
|
3009
|
-
|
|
3010
|
-
extract from langchain.js/langchain-core/src/prompts/template.ts
|
|
3011
|
-
|
|
3012
|
-
#### Parameters
|
|
3013
|
-
|
|
3014
|
-
| Name | Type |
|
|
3015
|
-
| :------ | :------ |
|
|
3016
|
-
| `template` | `string` |
|
|
3017
|
-
|
|
3018
|
-
#### Returns
|
|
3019
|
-
|
|
3020
|
-
[`FStringPromptTemplateNode`](modules.md#fstringprompttemplatenode)[]
|
|
3021
|
-
|
|
3022
|
-
#### Defined in
|
|
3023
|
-
|
|
3024
|
-
[packages/ai-tool/src/utils/prompt/template/python.ts:16](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/template/python.ts#L16)
|
|
3025
|
-
|
|
3026
|
-
___
|
|
3027
|
-
|
|
3028
|
-
### parseJsJson
|
|
3029
|
-
|
|
3030
|
-
▸ **parseJsJson**(`input`, `scope?`): `any`
|
|
3031
|
-
|
|
3032
|
-
Parses a JavaScript string into a JSON object.
|
|
3033
|
-
|
|
3034
|
-
#### Parameters
|
|
3035
|
-
|
|
3036
|
-
| Name | Type | Description |
|
|
3037
|
-
| :------ | :------ | :------ |
|
|
3038
|
-
| `input` | `string` | The string to be parsed into JSON. |
|
|
3039
|
-
| `scope?` | `Record`\<`string`, `any`\> | - |
|
|
3040
|
-
|
|
3041
|
-
#### Returns
|
|
3042
|
-
|
|
3043
|
-
`any`
|
|
3044
|
-
|
|
3045
|
-
The parsed JSON object. If parsing fails, undefined is returned.
|
|
3046
|
-
|
|
3047
|
-
**`Example`**
|
|
3048
|
-
|
|
3049
|
-
```ts
|
|
3050
|
-
// This will return a JSON object with key 'name' and value 'John'.
|
|
3051
|
-
const jsonString = '({name: "John"})';
|
|
3052
|
-
const json = parseJsJson(jsonString);
|
|
3053
|
-
console.log(json); // { name: 'John' }
|
|
3054
|
-
```
|
|
3055
|
-
|
|
3056
|
-
#### Defined in
|
|
3057
|
-
|
|
3058
|
-
[packages/ai-tool/src/utils/parse-js-json.ts:15](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/parse-js-json.ts#L15)
|
|
3059
|
-
|
|
3060
|
-
___
|
|
3061
|
-
|
|
3062
|
-
### parseObjectArgInfo
|
|
3063
|
-
|
|
3064
|
-
▸ **parseObjectArgInfo**(`argInfo`, `ix`, `scope?`, `options?`): `Promise`\<`string`\>
|
|
3065
|
-
|
|
3066
|
-
#### Parameters
|
|
3067
|
-
|
|
3068
|
-
| Name | Type |
|
|
3069
|
-
| :------ | :------ |
|
|
3070
|
-
| `argInfo` | `ArgInfo` |
|
|
3071
|
-
| `ix` | `number` |
|
|
3072
|
-
| `scope?` | `Record`\<`string`, `any`\> |
|
|
3073
|
-
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) |
|
|
3074
|
-
|
|
3075
|
-
#### Returns
|
|
3076
|
-
|
|
3077
|
-
`Promise`\<`string`\>
|
|
3078
|
-
|
|
3079
|
-
#### Defined in
|
|
3080
|
-
|
|
3081
|
-
[packages/ai-tool/src/utils/parse-command.ts:226](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/parse-command.ts#L226)
|
|
3082
|
-
|
|
3083
|
-
___
|
|
3084
|
-
|
|
3085
|
-
### parseObjectArgumentInfos
|
|
3086
|
-
|
|
3087
|
-
▸ **parseObjectArgumentInfos**(`args`, `scope?`, `options?`): `Promise`\<`any`\>
|
|
3088
|
-
|
|
3089
|
-
#### Parameters
|
|
3090
|
-
|
|
3091
|
-
| Name | Type |
|
|
3092
|
-
| :------ | :------ |
|
|
3093
|
-
| `args` | `ArgInfo`[] |
|
|
3094
|
-
| `scope?` | `Record`\<`string`, `any`\> |
|
|
3095
|
-
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) |
|
|
3096
|
-
|
|
3097
|
-
#### Returns
|
|
3098
|
-
|
|
3099
|
-
`Promise`\<`any`\>
|
|
3100
|
-
|
|
3101
|
-
#### Defined in
|
|
3102
|
-
|
|
3103
|
-
[packages/ai-tool/src/utils/parse-command.ts:88](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/parse-command.ts#L88)
|
|
3104
|
-
|
|
3105
|
-
___
|
|
3106
|
-
|
|
3107
|
-
### parseObjectArguments
|
|
3108
|
-
|
|
3109
|
-
▸ **parseObjectArguments**(`argsStr`, `scope?`, `options?`): `Promise`\<`any`\>
|
|
3110
|
-
|
|
3111
|
-
Asynchronously parses a string of object arguments into an actual object.
|
|
3112
|
-
|
|
3113
|
-
#### Parameters
|
|
3114
|
-
|
|
3115
|
-
| Name | Type | Description |
|
|
3116
|
-
| :------ | :------ | :------ |
|
|
3117
|
-
| `argsStr` | `string` | The string of arguments to be parsed. |
|
|
3118
|
-
| `scope?` | `Record`\<`string`, `any`\> | An optional scope object that provides values for variables during parsing. |
|
|
3119
|
-
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) | An optional configuration object containing the delimiter and argument processor. |
|
|
3120
|
-
|
|
3121
|
-
#### Returns
|
|
3122
|
-
|
|
3123
|
-
`Promise`\<`any`\>
|
|
3124
|
-
|
|
3125
|
-
The parsed object or undefined.
|
|
3126
|
-
|
|
3127
|
-
This function first parses the argument string into an object string and then converts it
|
|
3128
|
-
into a proper JavaScript/JSON object based on the parsing results and configuration options.
|
|
3129
|
-
It handles the conversion of single objects, arrays, and key-value pairs. The default delimiter
|
|
3130
|
-
between parameters is a comma (`,`), but this can be customized using the `options.delimiter`.
|
|
3131
|
-
Parameter assignment always uses an equal sign (`=`) and cannot be modified.
|
|
3132
|
-
|
|
3133
|
-
The function returns:
|
|
3134
|
-
- An object if the input string represents a set of key-value pairs.
|
|
3135
|
-
- An array if the input string represents a sequence of elements, where each element can be
|
|
3136
|
-
parsed as a number (indices are used as keys).
|
|
3137
|
-
- A single value if the input string represents a single value or a single key-value pair.
|
|
3138
|
-
- `undefined` if the input string is empty or cannot be parsed into a valid object.
|
|
3139
|
-
|
|
3140
|
-
**`Example`**
|
|
3141
|
-
|
|
3142
|
-
```typescript
|
|
3143
|
-
// Example call with default delimiter
|
|
3144
|
-
const result = await parseObjectArguments("name=John,age=30");
|
|
3145
|
-
console.log(result); // Output: { name: 'John', age: '30' }
|
|
3146
|
-
|
|
3147
|
-
// Example call with custom delimiter
|
|
3148
|
-
const resultCustomDelimiter = await parseObjectArguments("name=John|age=30", undefined, { delimiter: '|' });
|
|
3149
|
-
console.log(resultCustomDelimiter); // Output: { name: 'John', age: '30' }
|
|
3150
|
-
|
|
3151
|
-
// Example with a single value
|
|
3152
|
-
const singleValue = await parseObjectArguments("42");
|
|
3153
|
-
console.log(singleValue); // Output: 42
|
|
3154
|
-
|
|
3155
|
-
// Example with an array
|
|
3156
|
-
const arrayResult = await parseObjectArguments("1,2,3");
|
|
3157
|
-
console.log(arrayResult); // Output: [1, 2, 3]
|
|
3158
|
-
```
|
|
3159
|
-
|
|
3160
|
-
#### Defined in
|
|
3161
|
-
|
|
3162
|
-
[packages/ai-tool/src/utils/parse-command.ts:66](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/parse-command.ts#L66)
|
|
3163
|
-
|
|
3164
|
-
___
|
|
3165
|
-
|
|
3166
|
-
### parseObjectArgumentsAsArgInfos
|
|
3167
|
-
|
|
3168
|
-
▸ **parseObjectArgumentsAsArgInfos**(`argsStr`, `scope?`, `options?`): `ArgInfo`[]
|
|
3169
|
-
|
|
3170
|
-
Parses an object arguments string into an array of ArgInfo.
|
|
3171
|
-
|
|
3172
|
-
This function processes a parameter string and parses it according to specific rules, allowing for custom delimiters.
|
|
3173
|
-
It can handle quotes, escape characters, and expressions within brackets. The parsing is designed to interpret
|
|
3174
|
-
object literal strings from dynamic languages, such as JSON objects or similar custom formats.
|
|
3175
|
-
|
|
3176
|
-
#### Parameters
|
|
3177
|
-
|
|
3178
|
-
| Name | Type | Description |
|
|
3179
|
-
| :------ | :------ | :------ |
|
|
3180
|
-
| `argsStr` | `string` | The string containing the arguments to be parsed. |
|
|
3181
|
-
| `scope?` | `Record`\<`string`, `any`\> | An optional scope object used for further processing of the parsed arguments. Default is undefined. |
|
|
3182
|
-
| `options?` | [`ParseObjectArgumentOptions`](interfaces/ParseObjectArgumentOptions.md) | Parsing options, including: - delimiter: The character used to separate arguments. Default is ','. - argProcessor: An optional instance of ArgProcessor used for further processing of the parsed arguments. |
|
|
3183
|
-
|
|
3184
|
-
#### Returns
|
|
3185
|
-
|
|
3186
|
-
`ArgInfo`[]
|
|
3187
|
-
|
|
3188
|
-
An array of parsed argument information, where each item contains a boolean indicating whether the argument is named,
|
|
3189
|
-
and the string representation of the argument.
|
|
3190
|
-
|
|
3191
|
-
#### Defined in
|
|
3192
|
-
|
|
3193
|
-
[packages/ai-tool/src/utils/parse-command.ts:285](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/parse-command.ts#L285)
|
|
3194
|
-
|
|
3195
|
-
___
|
|
3196
|
-
|
|
3197
|
-
### parseYaml
|
|
3198
|
-
|
|
3199
|
-
▸ **parseYaml**(`content`): `any`
|
|
3200
|
-
|
|
3201
|
-
#### Parameters
|
|
3202
|
-
|
|
3203
|
-
| Name | Type |
|
|
3204
|
-
| :------ | :------ |
|
|
3205
|
-
| `content` | `string` |
|
|
3206
|
-
|
|
3207
|
-
#### Returns
|
|
3208
|
-
|
|
3209
|
-
`any`
|
|
3210
|
-
|
|
3211
|
-
#### Defined in
|
|
3212
|
-
|
|
3213
|
-
[packages/ai-tool/src/utils/config.ts:25](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/config.ts#L25)
|
|
3214
|
-
|
|
3215
|
-
___
|
|
3216
|
-
|
|
3217
|
-
### quoteStr
|
|
3218
|
-
|
|
3219
|
-
▸ **quoteStr**(`str`): `string`
|
|
3220
|
-
|
|
3221
|
-
#### Parameters
|
|
3222
|
-
|
|
3223
|
-
| Name | Type |
|
|
3224
|
-
| :------ | :------ |
|
|
3225
|
-
| `str` | `string` |
|
|
3226
|
-
|
|
3227
|
-
#### Returns
|
|
3228
|
-
|
|
3229
|
-
`string`
|
|
3230
|
-
|
|
3231
|
-
#### Defined in
|
|
3232
|
-
|
|
3233
|
-
[packages/ai-tool/src/utils/parse-command.ts:200](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/parse-command.ts#L200)
|
|
3234
|
-
|
|
3235
|
-
___
|
|
3236
|
-
|
|
3237
|
-
### reControlCharsRegex
|
|
3238
|
-
|
|
3239
|
-
▸ **reControlCharsRegex**(): `RegExp`
|
|
3240
|
-
|
|
3241
|
-
Returns a new regular expression instance for control characters in a filename with the 'g' flag.
|
|
3242
|
-
|
|
3243
|
-
#### Returns
|
|
3244
|
-
|
|
3245
|
-
`RegExp`
|
|
3246
|
-
|
|
3247
|
-
A compiled regular expression for control characters in a filename.
|
|
3248
|
-
|
|
3249
|
-
#### Defined in
|
|
3250
|
-
|
|
3251
|
-
[packages/ai-tool/src/utils/filename.ts:50](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/filename.ts#L50)
|
|
3252
|
-
|
|
3253
|
-
___
|
|
3254
|
-
|
|
3255
|
-
### readFilenamesRecursiveSync
|
|
3256
|
-
|
|
3257
|
-
▸ **readFilenamesRecursiveSync**(`dir`, `options?`): `string`[]
|
|
3258
|
-
|
|
3259
|
-
Recursively reads all filenames in the given directory or directories.
|
|
3260
|
-
Optionally filters the results using a file matching callback.
|
|
3261
|
-
|
|
3262
|
-
#### Parameters
|
|
3263
|
-
|
|
3264
|
-
| Name | Type | Description |
|
|
3265
|
-
| :------ | :------ | :------ |
|
|
3266
|
-
| `dir` | `string` \| `string`[] | A single directory path or an array of directory paths to start the search from. |
|
|
3267
|
-
| `options?` | `Object` | - |
|
|
3268
|
-
| `options.isFileMatched?` | (`filepath`: `string`) => `boolean` | An optional callback that determines whether a file should be included in the result. |
|
|
3269
|
-
| `options.level?` | `number` | - |
|
|
3270
|
-
| `options.signal?` | `AbortSignal` | An optional signal to abort the operation. |
|
|
3271
|
-
|
|
3272
|
-
#### Returns
|
|
3273
|
-
|
|
3274
|
-
`string`[]
|
|
3275
|
-
|
|
3276
|
-
An array of file paths that match the criteria.
|
|
3277
|
-
|
|
3278
|
-
**`Example`**
|
|
3279
|
-
|
|
3280
|
-
```typescript
|
|
3281
|
-
const files = readFilenamesRecursiveSync('/path/to/directory', {isFileMatched: (filepath) => filepath.endsWith('.js')});
|
|
3282
|
-
console.log(files); // Outputs an array of JavaScript file paths.
|
|
3283
|
-
```
|
|
3284
|
-
|
|
3285
|
-
#### Defined in
|
|
3286
|
-
|
|
3287
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:123](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/load-file-from-paths.ts#L123)
|
|
3288
|
-
|
|
3289
|
-
___
|
|
3290
|
-
|
|
3291
|
-
### readableFromAsyncIterable
|
|
3292
|
-
|
|
3293
|
-
▸ **readableFromAsyncIterable**\<`T`\>(`iterable`): `ReadableStream`\<`T`\>
|
|
3294
|
-
|
|
3295
|
-
Implements ReadableStream.from(asyncIterable), which isn't documented in MDN and isn't implemented in node.
|
|
3296
|
-
https://github.com/whatwg/streams/commit/8d7a0bf26eb2cc23e884ddbaac7c1da4b91cf2bc
|
|
3297
|
-
|
|
3298
|
-
#### Type parameters
|
|
3299
|
-
|
|
3300
|
-
| Name |
|
|
3301
|
-
| :------ |
|
|
3302
|
-
| `T` |
|
|
3303
|
-
|
|
3304
|
-
#### Parameters
|
|
3305
|
-
|
|
3306
|
-
| Name | Type |
|
|
3307
|
-
| :------ | :------ |
|
|
3308
|
-
| `iterable` | `AsyncIterable`\<`T`\> |
|
|
3309
|
-
|
|
3310
|
-
#### Returns
|
|
3311
|
-
|
|
3312
|
-
`ReadableStream`\<`T`\>
|
|
3313
|
-
|
|
3314
|
-
#### Defined in
|
|
3315
|
-
|
|
3316
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:166](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/stream/ai-stream.ts#L166)
|
|
3317
|
-
|
|
3318
|
-
___
|
|
3319
|
-
|
|
3320
|
-
### registerCoreTools
|
|
3321
|
-
|
|
3322
|
-
▸ **registerCoreTools**(): `void`
|
|
3323
|
-
|
|
3324
|
-
#### Returns
|
|
3325
|
-
|
|
3326
|
-
`void`
|
|
3327
|
-
|
|
3328
|
-
#### Defined in
|
|
3329
|
-
|
|
3330
|
-
[packages/ai-tool/src/funcs/index.ts:9](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/funcs/index.ts#L9)
|
|
3331
|
-
|
|
3332
|
-
___
|
|
3333
|
-
|
|
3334
|
-
### registerYamlTag
|
|
3335
|
-
|
|
3336
|
-
▸ **registerYamlTag**(`tags`): `void`
|
|
3337
|
-
|
|
3338
|
-
#### Parameters
|
|
3339
|
-
|
|
3340
|
-
| Name | Type |
|
|
3341
|
-
| :------ | :------ |
|
|
3342
|
-
| `tags` | `any` |
|
|
3343
|
-
|
|
3344
|
-
#### Returns
|
|
3345
|
-
|
|
3346
|
-
`void`
|
|
3347
|
-
|
|
3348
|
-
#### Defined in
|
|
3349
|
-
|
|
3350
|
-
[packages/ai-tool/src/utils/config.ts:15](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/config.ts#L15)
|
|
3351
|
-
|
|
3352
|
-
___
|
|
3353
|
-
|
|
3354
|
-
### sanitizeFilename
|
|
3355
|
-
|
|
3356
|
-
▸ **sanitizeFilename**(`filename`, `options?`): `string`
|
|
3357
|
-
|
|
3358
|
-
Sanitizes a given filename by replacing invalid characters with a specified replacement character or a default.
|
|
3359
|
-
|
|
3360
|
-
#### Parameters
|
|
3361
|
-
|
|
3362
|
-
| Name | Type | Description |
|
|
3363
|
-
| :------ | :------ | :------ |
|
|
3364
|
-
| `filename` | `string` | The filename to sanitize, represented as a string. |
|
|
3365
|
-
| `options` | [`SanitizeFilenameOptions`](interfaces/SanitizeFilenameOptions.md) | An optional object containing configuration options: - `replacement` {string} - The character to replace invalid characters with. Default is '!'. Cannot contain reserved filename characters. - `maxLength` {number} - The maximum length of the sanitized filename. Default is `MAX_FILENAME_LENGTH`. |
|
|
3366
|
-
|
|
3367
|
-
#### Returns
|
|
3368
|
-
|
|
3369
|
-
`string`
|
|
3370
|
-
|
|
3371
|
-
The sanitized filename.
|
|
3372
|
-
|
|
3373
|
-
**`Throws`**
|
|
3374
|
-
|
|
3375
|
-
- If the `replacement` contains reserved filename characters or control characters.
|
|
3376
|
-
|
|
3377
|
-
#### Defined in
|
|
3378
|
-
|
|
3379
|
-
[packages/ai-tool/src/utils/filename.ts:97](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/filename.ts#L97)
|
|
3380
|
-
|
|
3381
|
-
___
|
|
3382
|
-
|
|
3383
|
-
### sanitizeFilepath
|
|
3384
|
-
|
|
3385
|
-
▸ **sanitizeFilepath**(`filepath`, `options?`): `string`
|
|
3386
|
-
|
|
3387
|
-
Sanitizes each part of a file path and reassembles it, ensuring the path is valid according to provided options.
|
|
3388
|
-
|
|
3389
|
-
#### Parameters
|
|
3390
|
-
|
|
3391
|
-
| Name | Type | Description |
|
|
3392
|
-
| :------ | :------ | :------ |
|
|
3393
|
-
| `filepath` | `string` | The file path to sanitize, represented as a string. |
|
|
3394
|
-
| `options` | [`SanitizeFilenameOptions`](interfaces/SanitizeFilenameOptions.md) | Optional settings for sanitization, extending `SanitizeFilenameOptions`. Allows customization of replacement characters and maximum filename length. |
|
|
3395
|
-
|
|
3396
|
-
#### Returns
|
|
3397
|
-
|
|
3398
|
-
`string`
|
|
3399
|
-
|
|
3400
|
-
The sanitized file path as a string.
|
|
3401
|
-
|
|
3402
|
-
#### Defined in
|
|
3403
|
-
|
|
3404
|
-
[packages/ai-tool/src/utils/filename.ts:149](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/filename.ts#L149)
|
|
3405
|
-
|
|
3406
|
-
___
|
|
3407
|
-
|
|
3408
|
-
### saveConfigFile
|
|
3409
|
-
|
|
3410
|
-
▸ **saveConfigFile**(`filename`, `config`, `extLevel?`): `string`
|
|
3411
|
-
|
|
3412
|
-
#### Parameters
|
|
3413
|
-
|
|
3414
|
-
| Name | Type | Default value |
|
|
3415
|
-
| :------ | :------ | :------ |
|
|
3416
|
-
| `filename` | `string` | `undefined` |
|
|
3417
|
-
| `config` | `any` | `undefined` |
|
|
3418
|
-
| `extLevel` | `number` | `1` |
|
|
3419
|
-
|
|
3420
|
-
#### Returns
|
|
3421
|
-
|
|
3422
|
-
`string`
|
|
3423
|
-
|
|
3424
|
-
#### Defined in
|
|
3425
|
-
|
|
3426
|
-
[packages/ai-tool/src/utils/config.ts:85](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/config.ts#L85)
|
|
3427
|
-
|
|
3428
|
-
___
|
|
3429
|
-
|
|
3430
|
-
### scaleStrToParamsSize
|
|
3431
|
-
|
|
3432
|
-
▸ **scaleStrToParamsSize**(`scale`): `number`
|
|
3433
|
-
|
|
3434
|
-
Converts a formatted parameters size string (with units T, B, M, or K) back to its byte value.
|
|
3435
|
-
|
|
3436
|
-
#### Parameters
|
|
3437
|
-
|
|
3438
|
-
| Name | Type | Description |
|
|
3439
|
-
| :------ | :------ | :------ |
|
|
3440
|
-
| `scale` | `string` | The formatted parameter size string (e.g., "1.23B", "456M", "789K", or "123"). |
|
|
3441
|
-
|
|
3442
|
-
#### Returns
|
|
3443
|
-
|
|
3444
|
-
`number`
|
|
3445
|
-
|
|
3446
|
-
The parameter size in bytes.
|
|
3447
|
-
|
|
3448
|
-
#### Defined in
|
|
3449
|
-
|
|
3450
|
-
[packages/ai-tool/src/utils/convert-params-size.ts:44](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/convert-params-size.ts#L44)
|
|
3451
|
-
|
|
3452
|
-
___
|
|
3453
|
-
|
|
3454
|
-
### simplifyObjectArguments
|
|
3455
|
-
|
|
3456
|
-
▸ **simplifyObjectArguments**(`args`): `any`
|
|
3457
|
-
|
|
3458
|
-
#### Parameters
|
|
3459
|
-
|
|
3460
|
-
| Name | Type |
|
|
3461
|
-
| :------ | :------ |
|
|
3462
|
-
| `args` | `any` |
|
|
3463
|
-
|
|
3464
|
-
#### Returns
|
|
3465
|
-
|
|
3466
|
-
`any`
|
|
3467
|
-
|
|
3468
|
-
#### Defined in
|
|
3469
|
-
|
|
3470
|
-
[packages/ai-tool/src/utils/parse-command.ts:71](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/parse-command.ts#L71)
|
|
3471
|
-
|
|
3472
|
-
___
|
|
3473
|
-
|
|
3474
|
-
### sortedValues
|
|
3475
|
-
|
|
3476
|
-
▸ **sortedValues**\<`T`\>(`values`): `T`[]
|
|
3477
|
-
|
|
3478
|
-
#### Type parameters
|
|
3479
|
-
|
|
3480
|
-
| Name |
|
|
3481
|
-
| :------ |
|
|
3482
|
-
| `T` |
|
|
3483
|
-
|
|
3484
|
-
#### Parameters
|
|
3485
|
-
|
|
3486
|
-
| Name | Type |
|
|
3487
|
-
| :------ | :------ |
|
|
3488
|
-
| `values` | `Record`\<`string`, `T`\> |
|
|
3489
|
-
|
|
3490
|
-
#### Returns
|
|
3491
|
-
|
|
3492
|
-
`T`[]
|
|
3493
|
-
|
|
3494
|
-
#### Defined in
|
|
3495
|
-
|
|
3496
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:4](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/prompt/few-shot-prompt-template.ts#L4)
|
|
3497
|
-
|
|
3498
|
-
___
|
|
3499
|
-
|
|
3500
|
-
### splitSentence
|
|
3501
|
-
|
|
3502
|
-
▸ **splitSentence**(`text`, `best?`): `string`[]
|
|
3503
|
-
|
|
3504
|
-
Splits a text into sentences.
|
|
3505
|
-
This function is used to split a text into separate sentences, based on punctuation marks such as '.', '?', or '!' and other rules.
|
|
3506
|
-
|
|
3507
|
-
#### Parameters
|
|
3508
|
-
|
|
3509
|
-
| Name | Type | Default value | Description |
|
|
3510
|
-
| :------ | :------ | :------ | :------ |
|
|
3511
|
-
| `text` | `string` | `undefined` | The input string that needs to be split into sentences. |
|
|
3512
|
-
| `best` | `boolean` | `true` | A boolean flag indicating if the function should use the best possible sentence splitting method (default is true). If set to false, it will not perform any additional processing and simply split on newline characters ('\n'). |
|
|
3513
|
-
|
|
3514
|
-
#### Returns
|
|
3515
|
-
|
|
3516
|
-
`string`[]
|
|
3517
|
-
|
|
3518
|
-
An array of strings where each string represents a sentence in the input text.
|
|
3519
|
-
|
|
3520
|
-
Example:
|
|
3521
|
-
const text = "Hello world! How are you today? I am fine.";
|
|
3522
|
-
console.log(splitSentence(text)); // returns ['Hello world!', 'How are you today?', 'I am fine.']
|
|
3523
|
-
|
|
3524
|
-
#### Defined in
|
|
3525
|
-
|
|
3526
|
-
[packages/ai-tool/src/utils/split-sentence.ts:29](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/split-sentence.ts#L29)
|
|
3527
|
-
|
|
3528
|
-
___
|
|
3529
|
-
|
|
3530
|
-
### stringifyYaml
|
|
3531
|
-
|
|
3532
|
-
▸ **stringifyYaml**(`value`, `options?`): `string`
|
|
3533
|
-
|
|
3534
|
-
Stringify a value as a YAML document.
|
|
3535
|
-
|
|
3536
|
-
#### Parameters
|
|
3537
|
-
|
|
3538
|
-
| Name | Type |
|
|
3539
|
-
| :------ | :------ |
|
|
3540
|
-
| `value` | `any` |
|
|
3541
|
-
| `options?` | `DocumentOptions` & `SchemaOptions` & `ParseOptions` & `CreateNodeOptions` & `ToStringOptions` |
|
|
3542
|
-
|
|
3543
|
-
#### Returns
|
|
3544
|
-
|
|
3545
|
-
`string`
|
|
3546
|
-
|
|
3547
|
-
Will always include `\n` as the last character, as is expected of YAML documents.
|
|
3548
|
-
|
|
3549
|
-
#### Defined in
|
|
3550
|
-
|
|
3551
|
-
node_modules/.pnpm/yaml@2.4.3/node_modules/yaml/dist/public-api.d.ts:42
|
|
3552
|
-
|
|
3553
|
-
▸ **stringifyYaml**(`value`, `replacer?`, `options?`): `string`
|
|
3554
|
-
|
|
3555
|
-
#### Parameters
|
|
3556
|
-
|
|
3557
|
-
| Name | Type |
|
|
3558
|
-
| :------ | :------ |
|
|
3559
|
-
| `value` | `any` |
|
|
3560
|
-
| `replacer?` | ``null`` \| `Replacer` |
|
|
3561
|
-
| `options?` | `string` \| `number` \| `DocumentOptions` & `SchemaOptions` & `ParseOptions` & `CreateNodeOptions` & `ToStringOptions` |
|
|
3562
|
-
|
|
3563
|
-
#### Returns
|
|
3564
|
-
|
|
3565
|
-
`string`
|
|
3566
|
-
|
|
3567
|
-
#### Defined in
|
|
3568
|
-
|
|
3569
|
-
node_modules/.pnpm/yaml@2.4.3/node_modules/yaml/dist/public-api.d.ts:43
|
|
3570
|
-
|
|
3571
|
-
___
|
|
3572
|
-
|
|
3573
|
-
### textToDate
|
|
3574
|
-
|
|
3575
|
-
▸ **textToDate**(`date`, `format?`): `Date`
|
|
3576
|
-
|
|
3577
|
-
#### Parameters
|
|
3578
|
-
|
|
3579
|
-
| Name | Type | Default value |
|
|
3580
|
-
| :------ | :------ | :------ |
|
|
3581
|
-
| `date` | `string` | `undefined` |
|
|
3582
|
-
| `format` | `string` | `FormatDateStr` |
|
|
3583
|
-
|
|
3584
|
-
#### Returns
|
|
3585
|
-
|
|
3586
|
-
`Date`
|
|
3587
|
-
|
|
3588
|
-
#### Defined in
|
|
3589
|
-
|
|
3590
|
-
[packages/ai-tool/src/utils/to-datetime.ts:25](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/to-datetime.ts#L25)
|
|
3591
|
-
|
|
3592
|
-
___
|
|
3593
|
-
|
|
3594
|
-
### throwError
|
|
3595
|
-
|
|
3596
|
-
▸ **throwError**(`message`, `name?`, `status?`): `void`
|
|
3597
|
-
|
|
3598
|
-
Throw an error
|
|
3599
|
-
|
|
3600
|
-
#### Parameters
|
|
3601
|
-
|
|
3602
|
-
| Name | Type | Description |
|
|
3603
|
-
| :------ | :------ | :------ |
|
|
3604
|
-
| `message` | `string` | Error message |
|
|
3605
|
-
| `name?` | `string` \| `Record`\<`string`, `any`\> | Error name, optional |
|
|
3606
|
-
| `status?` | `string` \| `number` | Error status code, default to 500 |
|
|
3607
|
-
|
|
3608
|
-
#### Returns
|
|
3609
|
-
|
|
3610
|
-
`void`
|
|
3611
|
-
|
|
3612
|
-
**`Throws`**
|
|
3613
|
-
|
|
3614
|
-
Throws a BaseError object
|
|
3615
|
-
|
|
3616
|
-
#### Defined in
|
|
3617
|
-
|
|
3618
|
-
node_modules/.pnpm/@isdk+common-error@0.1.1/node_modules/@isdk/common-error/dist/index.d.ts:149
|
|
3619
|
-
|
|
3620
|
-
___
|
|
3621
|
-
|
|
3622
|
-
### toDateTime
|
|
3623
|
-
|
|
3624
|
-
▸ **toDateTime**(`date`): `undefined` \| `Date`
|
|
3625
|
-
|
|
3626
|
-
#### Parameters
|
|
3627
|
-
|
|
3628
|
-
| Name | Type |
|
|
3629
|
-
| :------ | :------ |
|
|
3630
|
-
| `date` | `string` \| `number` \| `Date` |
|
|
3631
|
-
|
|
3632
|
-
#### Returns
|
|
3633
|
-
|
|
3634
|
-
`undefined` \| `Date`
|
|
3635
|
-
|
|
3636
|
-
#### Defined in
|
|
3637
|
-
|
|
3638
|
-
[packages/ai-tool/src/utils/to-datetime.ts:9](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/to-datetime.ts#L9)
|
|
3639
|
-
|
|
3640
|
-
___
|
|
3641
|
-
|
|
3642
|
-
### trimStartOfStreamHelper
|
|
3643
|
-
|
|
3644
|
-
▸ **trimStartOfStreamHelper**(): (`text`: `string`) => `string`
|
|
3645
|
-
|
|
3646
|
-
Returns a stateful function that, when invoked, trims leading whitespace
|
|
3647
|
-
from the input text. The trimming only occurs on the first invocation, ensuring that
|
|
3648
|
-
subsequent calls do not alter the input text. This is particularly useful in scenarios
|
|
3649
|
-
where a text stream is being processed and only the initial whitespace should be removed.
|
|
3650
|
-
|
|
3651
|
-
#### Returns
|
|
3652
|
-
|
|
3653
|
-
`fn`
|
|
3654
|
-
|
|
3655
|
-
A function that takes a string as input and returns a string
|
|
3656
|
-
with leading whitespace removed if it is the first invocation; otherwise, it returns the input unchanged.
|
|
3657
|
-
|
|
3658
|
-
▸ (`text`): `string`
|
|
3659
|
-
|
|
3660
|
-
##### Parameters
|
|
3661
|
-
|
|
3662
|
-
| Name | Type |
|
|
3663
|
-
| :------ | :------ |
|
|
3664
|
-
| `text` | `string` |
|
|
3665
|
-
|
|
3666
|
-
##### Returns
|
|
3667
|
-
|
|
3668
|
-
`string`
|
|
3669
|
-
|
|
3670
|
-
**`Example`**
|
|
3671
|
-
|
|
3672
|
-
```ts
|
|
3673
|
-
const trimStart = trimStartOfStreamHelper();
|
|
3674
|
-
const output1 = trimStart(" text"); // "text"
|
|
3675
|
-
const output2 = trimStart(" text"); // " text"
|
|
3676
|
-
```
|
|
3677
|
-
|
|
3678
|
-
#### Defined in
|
|
3679
|
-
|
|
3680
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:92](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/stream/ai-stream.ts#L92)
|
|
3681
|
-
|
|
3682
|
-
___
|
|
3683
|
-
|
|
3684
|
-
### truncTo
|
|
3685
|
-
|
|
3686
|
-
▸ **truncTo**(`n`, `dec?`, `up?`): `number`
|
|
3687
|
-
|
|
3688
|
-
Truncates(Round) a number to a specified number of decimal places.
|
|
3689
|
-
|
|
3690
|
-
#### Parameters
|
|
3691
|
-
|
|
3692
|
-
| Name | Type | Default value | Description |
|
|
3693
|
-
| :------ | :------ | :------ | :------ |
|
|
3694
|
-
| `n` | `number` | `undefined` | The number to truncate. |
|
|
3695
|
-
| `dec` | `number` | `2` | The number of decimal places to truncate to (default is 2). |
|
|
3696
|
-
| `up` | `number` | `0.5` | The amount to round up by before truncating (default is 0.5). |
|
|
3697
|
-
|
|
3698
|
-
#### Returns
|
|
3699
|
-
|
|
3700
|
-
`number`
|
|
3701
|
-
|
|
3702
|
-
The truncated number.
|
|
3703
|
-
|
|
3704
|
-
**`Example`**
|
|
3705
|
-
|
|
3706
|
-
```ts
|
|
3707
|
-
// returns 1.235
|
|
3708
|
-
truncTo(1.2345, 3)
|
|
3709
|
-
```
|
|
3710
|
-
|
|
3711
|
-
**`Example`**
|
|
3712
|
-
|
|
3713
|
-
```ts
|
|
3714
|
-
// returns 1.24
|
|
3715
|
-
truncTo(1.2345, 2, 0.6)
|
|
3716
|
-
```
|
|
3717
|
-
|
|
3718
|
-
#### Defined in
|
|
3719
|
-
|
|
3720
|
-
[packages/ai-tool/src/utils/trunc-to.ts:19](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/trunc-to.ts#L19)
|
|
3721
|
-
|
|
3722
|
-
___
|
|
3723
|
-
|
|
3724
|
-
### uuid
|
|
3725
|
-
|
|
3726
|
-
▸ **uuid**(`ver?`, `encode?`): `string`
|
|
3727
|
-
|
|
3728
|
-
#### Parameters
|
|
3729
|
-
|
|
3730
|
-
| Name | Type | Default value |
|
|
3731
|
-
| :------ | :------ | :------ |
|
|
3732
|
-
| `ver` | ``1`` \| ``4`` \| ``5`` | `1` |
|
|
3733
|
-
| `encode?` | `boolean` | `undefined` |
|
|
3734
|
-
|
|
3735
|
-
#### Returns
|
|
3736
|
-
|
|
3737
|
-
`string`
|
|
3738
|
-
|
|
3739
|
-
#### Defined in
|
|
3740
|
-
|
|
3741
|
-
[packages/ai-tool/src/utils/hash/uuid.ts:8](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/hash/uuid.ts#L8)
|
|
3742
|
-
|
|
3743
|
-
___
|
|
3744
|
-
|
|
3745
|
-
### uuidParse
|
|
3746
|
-
|
|
3747
|
-
▸ **uuidParse**(`uuid`): `Uint8Array`
|
|
3748
|
-
|
|
3749
|
-
#### Parameters
|
|
3750
|
-
|
|
3751
|
-
| Name | Type |
|
|
3752
|
-
| :------ | :------ |
|
|
3753
|
-
| `uuid` | `string` |
|
|
3754
|
-
|
|
3755
|
-
#### Returns
|
|
3756
|
-
|
|
3757
|
-
`Uint8Array`
|
|
3758
|
-
|
|
3759
|
-
#### Defined in
|
|
3760
|
-
|
|
3761
|
-
node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:79
|
|
3762
|
-
|
|
3763
|
-
___
|
|
3764
|
-
|
|
3765
|
-
### uuidStringify
|
|
3766
|
-
|
|
3767
|
-
▸ **uuidStringify**(`buffer`, `offset?`): `string`
|
|
3768
|
-
|
|
3769
|
-
#### Parameters
|
|
3770
|
-
|
|
3771
|
-
| Name | Type |
|
|
3772
|
-
| :------ | :------ |
|
|
3773
|
-
| `buffer` | `InputBuffer` |
|
|
3774
|
-
| `offset?` | `number` |
|
|
3775
|
-
|
|
3776
|
-
#### Returns
|
|
3777
|
-
|
|
3778
|
-
`string`
|
|
3779
|
-
|
|
3780
|
-
#### Defined in
|
|
3781
|
-
|
|
3782
|
-
node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:80
|
|
3783
|
-
|
|
3784
|
-
___
|
|
3785
|
-
|
|
3786
|
-
### uuidValidate
|
|
3787
|
-
|
|
3788
|
-
▸ **uuidValidate**(`uuid`): `boolean`
|
|
3789
|
-
|
|
3790
|
-
#### Parameters
|
|
3791
|
-
|
|
3792
|
-
| Name | Type |
|
|
3793
|
-
| :------ | :------ |
|
|
3794
|
-
| `uuid` | `string` |
|
|
3795
|
-
|
|
3796
|
-
#### Returns
|
|
3797
|
-
|
|
3798
|
-
`boolean`
|
|
3799
|
-
|
|
3800
|
-
#### Defined in
|
|
3801
|
-
|
|
3802
|
-
node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:85
|
|
3803
|
-
|
|
3804
|
-
___
|
|
3805
|
-
|
|
3806
|
-
### uuidVersion
|
|
3807
|
-
|
|
3808
|
-
▸ **uuidVersion**(`uuid`): `number`
|
|
3809
|
-
|
|
3810
|
-
#### Parameters
|
|
3811
|
-
|
|
3812
|
-
| Name | Type |
|
|
3813
|
-
| :------ | :------ |
|
|
3814
|
-
| `uuid` | `string` |
|
|
3815
|
-
|
|
3816
|
-
#### Returns
|
|
3817
|
-
|
|
3818
|
-
`number`
|
|
3819
|
-
|
|
3820
|
-
#### Defined in
|
|
3821
|
-
|
|
3822
|
-
node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:86
|
|
3823
|
-
|
|
3824
|
-
___
|
|
3825
|
-
|
|
3826
|
-
### uuidv1
|
|
3827
|
-
|
|
3828
|
-
▸ **uuidv1**\<`T`\>(`options`, `buffer`, `offset?`): `T`
|
|
3829
|
-
|
|
3830
|
-
#### Type parameters
|
|
3831
|
-
|
|
3832
|
-
| Name | Type |
|
|
3833
|
-
| :------ | :------ |
|
|
3834
|
-
| `T` | extends `OutputBuffer` |
|
|
3835
|
-
|
|
3836
|
-
#### Parameters
|
|
3837
|
-
|
|
3838
|
-
| Name | Type |
|
|
3839
|
-
| :------ | :------ |
|
|
3840
|
-
| `options` | `undefined` \| ``null`` \| `V1Options` |
|
|
3841
|
-
| `buffer` | `T` |
|
|
3842
|
-
| `offset?` | `number` |
|
|
3843
|
-
|
|
3844
|
-
#### Returns
|
|
3845
|
-
|
|
3846
|
-
`T`
|
|
3847
|
-
|
|
3848
|
-
#### Defined in
|
|
3849
|
-
|
|
3850
|
-
node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:81
|
|
3851
|
-
|
|
3852
|
-
▸ **uuidv1**(`options?`): `string`
|
|
3853
|
-
|
|
3854
|
-
#### Parameters
|
|
3855
|
-
|
|
3856
|
-
| Name | Type |
|
|
3857
|
-
| :------ | :------ |
|
|
3858
|
-
| `options?` | `V1Options` |
|
|
3859
|
-
|
|
3860
|
-
#### Returns
|
|
3861
|
-
|
|
3862
|
-
`string`
|
|
3863
|
-
|
|
3864
|
-
#### Defined in
|
|
3865
|
-
|
|
3866
|
-
node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:81
|
|
3867
|
-
|
|
3868
|
-
___
|
|
3869
|
-
|
|
3870
|
-
### uuidv4
|
|
3871
|
-
|
|
3872
|
-
▸ **uuidv4**\<`T`\>(`options`, `buffer`, `offset?`): `T`
|
|
3873
|
-
|
|
3874
|
-
#### Type parameters
|
|
3875
|
-
|
|
3876
|
-
| Name | Type |
|
|
3877
|
-
| :------ | :------ |
|
|
3878
|
-
| `T` | extends `OutputBuffer` |
|
|
3879
|
-
|
|
3880
|
-
#### Parameters
|
|
3881
|
-
|
|
3882
|
-
| Name | Type |
|
|
3883
|
-
| :------ | :------ |
|
|
3884
|
-
| `options` | `undefined` \| ``null`` \| `V4Options` |
|
|
3885
|
-
| `buffer` | `T` |
|
|
3886
|
-
| `offset?` | `number` |
|
|
3887
|
-
|
|
3888
|
-
#### Returns
|
|
3889
|
-
|
|
3890
|
-
`T`
|
|
3891
|
-
|
|
3892
|
-
#### Defined in
|
|
3893
|
-
|
|
3894
|
-
node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:83
|
|
3895
|
-
|
|
3896
|
-
▸ **uuidv4**(`options?`): `string`
|
|
3897
|
-
|
|
3898
|
-
#### Parameters
|
|
3899
|
-
|
|
3900
|
-
| Name | Type |
|
|
3901
|
-
| :------ | :------ |
|
|
3902
|
-
| `options?` | `V4Options` |
|
|
3903
|
-
|
|
3904
|
-
#### Returns
|
|
3905
|
-
|
|
3906
|
-
`string`
|
|
3907
|
-
|
|
3908
|
-
#### Defined in
|
|
3909
|
-
|
|
3910
|
-
node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:83
|
|
3911
|
-
|
|
3912
|
-
___
|
|
3913
|
-
|
|
3914
|
-
### uuidv5
|
|
3915
|
-
|
|
3916
|
-
▸ **uuidv5**\<`T`\>(`name`, `namespace`, `buffer`, `offset?`): `T`
|
|
3917
|
-
|
|
3918
|
-
#### Type parameters
|
|
3919
|
-
|
|
3920
|
-
| Name | Type |
|
|
3921
|
-
| :------ | :------ |
|
|
3922
|
-
| `T` | extends `OutputBuffer` |
|
|
3923
|
-
|
|
3924
|
-
#### Parameters
|
|
3925
|
-
|
|
3926
|
-
| Name | Type |
|
|
3927
|
-
| :------ | :------ |
|
|
3928
|
-
| `name` | `string` \| `InputBuffer` |
|
|
3929
|
-
| `namespace` | `string` \| `InputBuffer` |
|
|
3930
|
-
| `buffer` | `T` |
|
|
3931
|
-
| `offset?` | `number` |
|
|
3932
|
-
|
|
3933
|
-
#### Returns
|
|
3934
|
-
|
|
3935
|
-
`T`
|
|
3936
|
-
|
|
3937
|
-
#### Defined in
|
|
3938
|
-
|
|
3939
|
-
node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:84
|
|
3940
|
-
|
|
3941
|
-
▸ **uuidv5**(`name`, `namespace`): `string`
|
|
3942
|
-
|
|
3943
|
-
#### Parameters
|
|
3944
|
-
|
|
3945
|
-
| Name | Type |
|
|
3946
|
-
| :------ | :------ |
|
|
3947
|
-
| `name` | `string` \| `InputBuffer` |
|
|
3948
|
-
| `namespace` | `string` \| `InputBuffer` |
|
|
3949
|
-
|
|
3950
|
-
#### Returns
|
|
3951
|
-
|
|
3952
|
-
`string`
|
|
3953
|
-
|
|
3954
|
-
#### Defined in
|
|
3955
|
-
|
|
3956
|
-
node_modules/.pnpm/@types+uuid@9.0.8/node_modules/@types/uuid/index.d.ts:84
|
|
3957
|
-
|
|
3958
|
-
___
|
|
3959
|
-
|
|
3960
|
-
### wait
|
|
3961
|
-
|
|
3962
|
-
▸ **wait**(`ms`): `Promise`\<`void`\>
|
|
3963
|
-
|
|
3964
|
-
#### Parameters
|
|
3965
|
-
|
|
3966
|
-
| Name | Type |
|
|
3967
|
-
| :------ | :------ |
|
|
3968
|
-
| `ms` | `number` |
|
|
3969
|
-
|
|
3970
|
-
#### Returns
|
|
3971
|
-
|
|
3972
|
-
`Promise`\<`void`\>
|
|
3973
|
-
|
|
3974
|
-
#### Defined in
|
|
3975
|
-
|
|
3976
|
-
[packages/ai-tool/src/utils/wait.ts:1](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/wait.ts#L1)
|
|
3977
|
-
|
|
3978
|
-
___
|
|
3979
|
-
|
|
3980
|
-
### xxhash
|
|
3981
|
-
|
|
3982
|
-
▸ **xxhash**(`value`, `hashAlgo?`, `seed?`): `Uint8Array`
|
|
3983
|
-
|
|
3984
|
-
#### Parameters
|
|
3985
|
-
|
|
3986
|
-
| Name | Type | Default value |
|
|
3987
|
-
| :------ | :------ | :------ |
|
|
3988
|
-
| `value` | `HashValue` | `undefined` |
|
|
3989
|
-
| `hashAlgo` | [`XXHashAlgorithm`](enums/XXHashAlgorithm.md) | `XXHashAlgorithm.xxhash64` |
|
|
3990
|
-
| `seed` | `number` | `SEED` |
|
|
3991
|
-
|
|
3992
|
-
#### Returns
|
|
3993
|
-
|
|
3994
|
-
`Uint8Array`
|
|
3995
|
-
|
|
3996
|
-
#### Defined in
|
|
3997
|
-
|
|
3998
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:32](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/hash/xxhash.ts#L32)
|
|
3999
|
-
|
|
4000
|
-
___
|
|
4001
|
-
|
|
4002
|
-
### xxhash32
|
|
4003
|
-
|
|
4004
|
-
▸ **xxhash32**(`value`, `radix?`): `string`
|
|
4005
|
-
|
|
4006
|
-
#### Parameters
|
|
4007
|
-
|
|
4008
|
-
| Name | Type | Default value |
|
|
4009
|
-
| :------ | :------ | :------ |
|
|
4010
|
-
| `value` | `string` \| `object` | `undefined` |
|
|
4011
|
-
| `radix` | `number` | `16` |
|
|
4012
|
-
|
|
4013
|
-
#### Returns
|
|
4014
|
-
|
|
4015
|
-
`string`
|
|
4016
|
-
|
|
4017
|
-
#### Defined in
|
|
4018
|
-
|
|
4019
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:11](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/hash/xxhash.ts#L11)
|
|
4020
|
-
|
|
4021
|
-
___
|
|
4022
|
-
|
|
4023
|
-
### xxhash64
|
|
4024
|
-
|
|
4025
|
-
▸ **xxhash64**(`value`, `radix?`): `string`
|
|
4026
|
-
|
|
4027
|
-
#### Parameters
|
|
4028
|
-
|
|
4029
|
-
| Name | Type | Default value |
|
|
4030
|
-
| :------ | :------ | :------ |
|
|
4031
|
-
| `value` | `string` \| `object` | `undefined` |
|
|
4032
|
-
| `radix` | `number` | `16` |
|
|
4033
|
-
|
|
4034
|
-
#### Returns
|
|
4035
|
-
|
|
4036
|
-
`string`
|
|
4037
|
-
|
|
4038
|
-
#### Defined in
|
|
4039
|
-
|
|
4040
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:18](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/hash/xxhash.ts#L18)
|
|
4041
|
-
|
|
4042
|
-
___
|
|
4043
|
-
|
|
4044
|
-
### xxhashAsStr
|
|
4045
|
-
|
|
4046
|
-
▸ **xxhashAsStr**(`value`, `hashAlgo?`, `seed?`): `string`
|
|
4047
|
-
|
|
4048
|
-
#### Parameters
|
|
4049
|
-
|
|
4050
|
-
| Name | Type | Default value |
|
|
4051
|
-
| :------ | :------ | :------ |
|
|
4052
|
-
| `value` | `string` \| `Uint8Array` | `undefined` |
|
|
4053
|
-
| `hashAlgo` | [`XXHashAlgorithm`](enums/XXHashAlgorithm.md) | `XXHashAlgorithm.xxhash64` |
|
|
4054
|
-
| `seed` | `number` | `SEED` |
|
|
4055
|
-
|
|
4056
|
-
#### Returns
|
|
4057
|
-
|
|
4058
|
-
`string`
|
|
4059
|
-
|
|
4060
|
-
#### Defined in
|
|
4061
|
-
|
|
4062
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:48](https://github.com/isdk/ai-tool.js/blob/c5e620338f3b80d6ef09148577c5087098896d8b/src/utils/hash/xxhash.ts#L48)
|