@isdk/ai-tool 0.2.3 → 0.3.0
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-JHHFTTVE.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-DUEs7T8M.d.mts → index-BC3GQn6-.d.mts} +7 -0
- package/dist/{index-DUEs7T8M.d.ts → index-BC3GQn6-.d.ts} +7 -0
- package/dist/index.d.mts +411 -10
- package/dist/index.d.ts +411 -10
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/test/util.mjs +1 -1
- package/docs/classes/AbortError.md +45 -15
- package/docs/classes/AlreadyExistsError.md +45 -15
- package/docs/classes/BaseError.md +42 -16
- package/docs/classes/CancelableAbility.md +20 -20
- package/docs/classes/ClientTools.md +93 -93
- package/docs/classes/CommonError.md +45 -15
- package/docs/classes/EventClient.md +115 -115
- package/docs/classes/EventServer.md +117 -117
- package/docs/classes/EventToolFunc.md +85 -85
- package/docs/classes/FStringPromptTemplate.md +18 -18
- package/docs/classes/FewShotPromptTemplate.md +22 -22
- package/docs/classes/GolangPromptTemplate.md +18 -18
- package/docs/classes/HFEnvironment.md +9 -9
- package/docs/classes/HFInterpreter.md +4 -4
- package/docs/classes/HFTemplate.md +4 -4
- package/docs/classes/HfPromptTemplate.md +18 -18
- package/docs/classes/IntSet.md +11 -11
- package/docs/classes/NotFoundError.md +45 -15
- package/docs/classes/NotImplementationError.md +45 -15
- package/docs/classes/PromptExampleSelector.md +8 -8
- package/docs/classes/PromptTemplate.md +17 -17
- package/docs/classes/ReadableStreamError.md +45 -15
- package/docs/classes/ResClientTools.md +100 -100
- package/docs/classes/ResServerTools.md +101 -101
- package/docs/classes/SSEChannel.md +14 -14
- package/docs/classes/Semaphore.md +8 -8
- package/docs/classes/ServerTools.md +89 -89
- package/docs/classes/TaskAbortController.md +8 -8
- package/docs/classes/ToolFunc.md +82 -82
- package/docs/classes/YamlTypeBaseObject.md +29 -0
- package/docs/enumerations/AsyncFeatureBits.md +3 -3
- package/docs/enumerations/AsyncFeatures.md +3 -3
- package/docs/enumerations/ErrorCode.md +21 -21
- package/docs/enumerations/HashAlgorithm.md +117 -0
- package/docs/functions/AIArgProcessor.md +1 -1
- package/docs/functions/AIStream.md +1 -1
- package/docs/functions/ChoiceArgProcessor.md +1 -1
- package/docs/functions/RateLimit.md +1 -1
- package/docs/functions/TemplateArgProcessor.md +1 -1
- package/docs/functions/backendEventable.md +1 -1
- package/docs/functions/completeSentences.md +23 -0
- package/docs/functions/concatText.md +23 -0
- package/docs/functions/countLLMTokens.md +23 -0
- package/docs/functions/countRegexMatches.md +1 -1
- package/docs/functions/createCallbacksTransformer.md +1 -1
- package/docs/functions/createEmptyReadableStream.md +1 -1
- package/docs/functions/createEndWithRepetitionDetector.md +1 -1
- package/docs/functions/createError.md +1 -1
- package/docs/functions/createEventStreamTransformer.md +1 -1
- package/docs/functions/createHfValueFunc.md +1 -1
- package/docs/functions/createLRUCache.md +1 -1
- package/docs/functions/createYamlObjectTag.md +23 -0
- package/docs/functions/dateToText.md +1 -1
- package/docs/functions/decodeCharset.md +23 -0
- package/docs/functions/detectCharset.md +23 -0
- package/docs/functions/encodeLLMTokens.md +23 -0
- package/docs/functions/expandEnv.md +1 -1
- package/docs/functions/expandObjEnv.md +1 -1
- package/docs/functions/extNameLevel.md +1 -1
- package/docs/functions/fileIsExists.md +1 -1
- package/docs/functions/filenameReservedRegex.md +1 -1
- package/docs/functions/filterValidFnScope.md +1 -1
- package/docs/functions/findIndexNonEmptyFrom.md +23 -0
- package/docs/functions/findPort.md +1 -1
- package/docs/functions/formatTextWithSpace.md +59 -0
- package/docs/functions/getAllEnumKeys.md +1 -1
- package/docs/functions/getConfigFileNames.md +1 -1
- package/docs/functions/getConfigs.md +1 -1
- package/docs/functions/getFileMetaInfo.md +21 -0
- package/docs/functions/getHashAlgoBySize.md +21 -0
- package/docs/functions/getKeysPath.md +1 -1
- package/docs/functions/getLLMTokenizer.md +21 -0
- package/docs/functions/getMultiLevelExtname.md +1 -1
- package/docs/functions/getPackageDir.md +1 -1
- package/docs/functions/getRealFilepath.md +1 -1
- package/docs/functions/getResponseErrorReadableStream.md +1 -1
- package/docs/functions/hasDirectoryIn.md +1 -1
- package/docs/functions/hashFile.md +23 -0
- package/docs/functions/hashStream.md +23 -0
- package/docs/functions/hfParse.md +1 -1
- package/docs/functions/hfTokenize.md +1 -1
- package/docs/functions/interpolateEnv.md +1 -1
- package/docs/functions/interpolateFString.md +1 -1
- package/docs/functions/interpolateGolangTemplate.md +1 -1
- package/docs/functions/isLangUsingSpaces.md +21 -0
- package/docs/functions/isListItemString.md +21 -0
- package/docs/functions/isModelNameMatched.md +1 -1
- package/docs/functions/isPunctuationChar.md +36 -0
- package/docs/functions/isRegExp.md +1 -1
- package/docs/functions/isSectionString.md +23 -0
- package/docs/functions/isSentenceEnding.md +21 -0
- package/docs/functions/isSepLineString.md +21 -0
- package/docs/functions/isSubdirectory.md +1 -1
- package/docs/functions/isTitleString.md +23 -0
- package/docs/functions/isValidFilename.md +1 -1
- package/docs/functions/isValidFilepath.md +1 -1
- package/docs/functions/isWebStream.md +1 -1
- package/docs/functions/jsonFilterToWhere.md +1 -1
- package/docs/functions/jsonToMarkdownStr.md +1 -1
- package/docs/functions/loadFileFromPaths.md +1 -1
- package/docs/functions/loadTextFromPaths.md +1 -1
- package/docs/functions/lrucache.md +1 -1
- package/docs/functions/makeToolFuncCancelable.md +1 -1
- package/docs/functions/matchUrlProtocol.md +1 -1
- package/docs/functions/memoize.md +1 -1
- package/docs/functions/messagesToText.md +1 -1
- package/docs/functions/paramsSizeToScaleStr.md +1 -1
- package/docs/functions/parseCommand.md +1 -1
- package/docs/functions/parseFString.md +1 -1
- package/docs/functions/parseJsJson.md +3 -3
- package/docs/functions/parseJsJsonSimpleSync.md +23 -0
- package/docs/functions/parseObjectArgInfo.md +1 -1
- package/docs/functions/parseObjectArgumentInfos.md +1 -1
- package/docs/functions/parseObjectArguments.md +1 -1
- package/docs/functions/parseObjectArgumentsAsArgInfos.md +1 -1
- package/docs/functions/parseYaml.md +1 -1
- package/docs/functions/quoteStr.md +1 -1
- package/docs/functions/reControlCharsRegex.md +1 -1
- package/docs/functions/readFilenamesRecursiveSync.md +1 -1
- package/docs/functions/readTextFileChunks.md +51 -0
- package/docs/functions/readTextFileChunksEx.md +23 -0
- package/docs/functions/readableFromAsyncIterable.md +1 -1
- package/docs/functions/registerCoreTools.md +1 -1
- package/docs/functions/registerYamlTag.md +1 -1
- package/docs/functions/removeMarkdownBold.md +23 -0
- package/docs/functions/removeMarkdownBoldAndItalic.md +23 -0
- package/docs/functions/removeMarkdownItalic.md +23 -0
- package/docs/functions/replaceWithPlaceholder.md +41 -0
- package/docs/functions/restoreFromPlacehoders.md +45 -0
- package/docs/functions/sanitizeFilename.md +1 -1
- package/docs/functions/sanitizeFilepath.md +1 -1
- package/docs/functions/saveConfigFile.md +1 -1
- package/docs/functions/scaleStrToParamsSize.md +1 -1
- package/docs/functions/simplifyObjectArguments.md +1 -1
- package/docs/functions/sortedValues.md +1 -1
- package/docs/functions/splitChunks.md +23 -0
- package/docs/functions/splitParagraph.md +32 -0
- package/docs/functions/splitSentence.md +2 -2
- package/docs/functions/stringifyYaml.md +1 -1
- package/docs/functions/stripConsoleColor.md +21 -0
- package/docs/functions/textToDate.md +1 -1
- package/docs/functions/throwError.md +1 -1
- package/docs/functions/toDateTime.md +1 -1
- package/docs/functions/trimStartOfStreamHelper.md +1 -1
- package/docs/functions/truncTo.md +1 -1
- package/docs/functions/truncateByToken.md +23 -0
- package/docs/functions/truncateToTokenLimit.md +44 -0
- package/docs/functions/truncateToTokenLimitEx.md +23 -0
- package/docs/functions/uuid.md +1 -1
- package/docs/functions/wait.md +1 -1
- package/docs/functions/xxhash.md +2 -2
- package/docs/functions/xxhash32.md +1 -1
- package/docs/functions/xxhash64.md +1 -1
- package/docs/functions/xxhashAsStr.md +2 -2
- package/docs/globals.md +46 -1
- package/docs/interfaces/AIChatAssistantMessageParam.md +48 -6
- package/docs/interfaces/AIChatContentPartImage.md +2 -2
- package/docs/interfaces/AIChatContentPartText.md +2 -2
- package/docs/interfaces/AIChatMessageParamBase.md +31 -1
- package/docs/interfaces/AIChatMessageToolCall.md +3 -3
- package/docs/interfaces/AIChatSystemMessageParam.md +45 -3
- package/docs/interfaces/AIChatToolMessageParam.md +46 -4
- package/docs/interfaces/AIChatUserMessageParam.md +49 -7
- package/docs/interfaces/AIChoiceConfig.md +7 -7
- package/docs/interfaces/AIResult.md +5 -5
- package/docs/interfaces/AIStreamParser.md +1 -1
- package/docs/interfaces/AIStreamParserOptions.md +1 -1
- package/docs/interfaces/BaseFunc.md +9 -9
- package/docs/interfaces/BaseFuncItem.md +8 -8
- package/docs/interfaces/CancelableAbilityOptions.md +2 -2
- package/docs/interfaces/ClientFuncItem.md +11 -11
- package/docs/interfaces/DotenvExpandOptions.md +3 -3
- package/docs/interfaces/DotenvExpandOutput.md +2 -2
- package/docs/interfaces/EventClientFuncParams.md +4 -4
- package/docs/interfaces/EventServerFuncParams.md +5 -5
- package/docs/interfaces/FewShotPromptTemplateOptions.md +11 -11
- package/docs/interfaces/FuncItem.md +9 -9
- package/docs/interfaces/FuncParam.md +6 -6
- package/docs/interfaces/HashAlgoParams.md +37 -0
- package/docs/interfaces/IFileMetaInfo.md +77 -0
- package/docs/interfaces/IReadTextFileChunksOptions.md +157 -0
- package/docs/interfaces/ITruncateToTokenLimitOptions.md +111 -0
- package/docs/interfaces/ParseObjectArgumentOptions.md +45 -5
- package/docs/interfaces/PromptExampleSelectorOptions.md +2 -2
- package/docs/interfaces/PromptTemplateOptions.md +6 -6
- package/docs/interfaces/RemoteFuncItem.md +11 -11
- package/docs/interfaces/ReplacePlacehoderOptions.md +47 -0
- package/docs/interfaces/ResClientFuncParams.md +2 -2
- package/docs/interfaces/ResServerFuncParams.md +5 -5
- package/docs/interfaces/SanitizeFilenameOptions.md +2 -2
- package/docs/interfaces/SectionStringOptions.md +27 -0
- package/docs/interfaces/ServerFuncItem.md +12 -12
- package/docs/interfaces/ServerFuncParams.md +2 -2
- package/docs/interfaces/SplitSentenceOptions.md +47 -0
- package/docs/interfaces/StreamCallbacksAndOptions.md +4 -4
- package/docs/interfaces/TaskPromise.md +5 -5
- package/docs/interfaces/ToolFuncPackage.md +3 -3
- package/docs/type-aliases/AIChatContentPart.md +1 -1
- package/docs/type-aliases/AIChatMessageParam.md +1 -1
- package/docs/type-aliases/AIChatRole.md +1 -1
- package/docs/type-aliases/AIMessageType.md +1 -1
- package/docs/type-aliases/AIModelNameRule.md +1 -1
- package/docs/type-aliases/AIModelNameRuleFn.md +1 -1
- package/docs/type-aliases/AIModelNameRules.md +1 -1
- package/docs/type-aliases/AITextGenerationFinishReason.md +1 -1
- package/docs/type-aliases/ActionName.md +1 -1
- package/docs/type-aliases/AsyncTaskId.md +1 -1
- package/docs/type-aliases/EventErrorListenerFn.md +1 -1
- package/docs/type-aliases/EventListenerFn.md +1 -1
- package/docs/type-aliases/FStringPromptTemplateNode.md +1 -1
- package/docs/type-aliases/FuncParamType.md +1 -1
- package/docs/type-aliases/PromptExamples.md +1 -1
- package/docs/type-aliases/PromptTemplateType.md +1 -1
- package/docs/type-aliases/PromptType.md +1 -1
- package/docs/type-aliases/TFunc.md +1 -1
- package/docs/variables/AIChatRoles.md +1 -1
- package/docs/variables/AIMessageTypes.md +1 -1
- package/docs/variables/AITextGenerationFinishReasons.md +1 -1
- package/docs/variables/AbortErrorCode.md +1 -1
- package/docs/variables/ActionNames.md +1 -1
- package/docs/variables/AlreadyExistsErrorCode.md +1 -1
- package/docs/variables/ClientToolFuncSchema.md +1 -1
- package/docs/variables/DefaultAsyncSemaphoreCapacity.md +1 -1
- package/docs/variables/EventBusName.md +1 -1
- package/docs/variables/EventName.md +1 -1
- package/docs/variables/FilenameReservedRegex.md +1 -1
- package/docs/variables/HFBuiltins.md +1 -1
- package/docs/variables/InternalErrorCode.md +1 -1
- package/docs/variables/LLM_TOKENIZER_NAMES.md +83 -0
- package/docs/variables/LLM_TOKENIZER_NAMES_MAP.md +13 -0
- package/docs/variables/NotFoundErrorCode.md +1 -1
- package/docs/variables/NotImplementedErrorCode.md +1 -1
- package/docs/variables/PASSING_SCORE.md +1 -1
- package/docs/variables/PromptTemplateTypes.md +1 -1
- package/docs/variables/PromptTypes.md +1 -1
- package/docs/variables/RStreamErrCode.md +1 -1
- package/docs/variables/RemoteToolFuncSchema.md +1 -1
- package/docs/variables/ResponseRStreamErrCode.md +1 -1
- package/docs/variables/SSEChannelAlreadyClosedErrCode.md +1 -1
- package/docs/variables/ServerToolFuncSchema.md +1 -1
- package/docs/variables/ToolAsyncCancelableBit.md +1 -1
- package/docs/variables/ToolAsyncMultiTaskBit.md +1 -1
- package/docs/variables/ToolAsyncPriorityBit.md +1 -1
- package/docs/variables/ToolFuncSchema.md +1 -1
- package/docs/variables/WindowsReservedNameRegex.md +1 -1
- package/docs/variables/base32768.md +1 -1
- package/docs/variables/defaultTemplateFormat.md +1 -1
- package/docs/variables/event.md +1 -1
- package/docs/variables/eventClient.md +1 -1
- package/docs/variables/eventServer.md +1 -1
- package/docs/variables/lrucache.md +1 -1
- package/package.json +7 -3
- package/dist/chunk-FLVJ4R53.mjs +0 -1
- package/docs/enumerations/XXHashAlgorithm.md +0 -27
- /package/dist/{chunk-PXQPLL62.mjs → chunk-VIG2GB47.mjs} +0 -0
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
|
|
25
25
|
## Defined in
|
|
26
26
|
|
|
27
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
27
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:9](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/event/event-ability.ts#L9)
|
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
|
|
23
23
|
## Defined in
|
|
24
24
|
|
|
25
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
25
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:8](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/event/event-ability.ts#L8)
|
|
@@ -13,4 +13,4 @@ a literal text or a variable name.
|
|
|
13
13
|
|
|
14
14
|
## Defined in
|
|
15
15
|
|
|
16
|
-
[packages/ai-tool/src/utils/prompt/template/python.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
16
|
+
[packages/ai-tool/src/utils/prompt/template/python.ts:6](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/prompt/template/python.ts#L6)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/tool-func.ts:24](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/tool-func.ts:24](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/tool-func.ts#L24)
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
17
|
+
[packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:3](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/prompt/prompt-example-selector.ts#L3)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:17](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/prompt/consts.ts:17](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/prompt/consts.ts#L17)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/prompt/consts.ts:10](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/prompt/consts.ts#L10)
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
|
|
21
21
|
## Defined in
|
|
22
22
|
|
|
23
|
-
[packages/ai-tool/src/tool-func.ts:38](https://github.com/isdk/ai-tool.js/blob/
|
|
23
|
+
[packages/ai-tool/src/tool-func.ts:38](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/tool-func.ts#L38)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/chat.ts:43](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/chat.ts:43](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/chat.ts#L43)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/chat.ts:37](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/chat.ts:37](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/chat.ts#L37)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/chat.ts:4](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/chat.ts:4](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/chat.ts#L4)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/consts.ts#L5)
|
|
@@ -84,4 +84,4 @@
|
|
|
84
84
|
|
|
85
85
|
## Defined in
|
|
86
86
|
|
|
87
|
-
[packages/ai-tool/src/client-tools.ts:153](https://github.com/isdk/ai-tool.js/blob/
|
|
87
|
+
[packages/ai-tool/src/client-tools.ts:153](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/client-tools.ts#L153)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/async-semaphore.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/async-semaphore.ts:6](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/async-semaphore.ts#L6)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:7](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:7](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/event/event-ability.ts#L7)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/event/event-ability.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/event/event-ability.ts:6](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/event/event-ability.ts#L6)
|
|
@@ -13,4 +13,4 @@ do not use /g global option here: when the regex is executed multiple times, it
|
|
|
13
13
|
|
|
14
14
|
## Defined in
|
|
15
15
|
|
|
16
|
-
[packages/ai-tool/src/utils/filename.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
16
|
+
[packages/ai-tool/src/utils/filename.ts:8](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/filename.ts#L8)
|
|
@@ -89,4 +89,4 @@ console.log(select(str, -1)) // Last character
|
|
|
89
89
|
|
|
90
90
|
## Defined in
|
|
91
91
|
|
|
92
|
-
[packages/ai-tool/src/utils/prompt/template/jinja/src/builtins.ts:61](https://github.com/isdk/ai-tool.js/blob/
|
|
92
|
+
[packages/ai-tool/src/utils/prompt/template/jinja/src/builtins.ts:61](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/prompt/template/jinja/src/builtins.ts#L61)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / LLM\_TOKENIZER\_NAMES
|
|
6
|
+
|
|
7
|
+
# Variable: LLM\_TOKENIZER\_NAMES
|
|
8
|
+
|
|
9
|
+
> `const` **LLM\_TOKENIZER\_NAMES**: `object`
|
|
10
|
+
|
|
11
|
+
## Type declaration
|
|
12
|
+
|
|
13
|
+
### deepseek-ai/DeepSeek-V2-Lite-Chat
|
|
14
|
+
|
|
15
|
+
> **deepseek-ai/DeepSeek-V2-Lite-Chat**: `string` = `'deepseek2'`
|
|
16
|
+
|
|
17
|
+
### Qwen/Qwen2.5-0.5B
|
|
18
|
+
|
|
19
|
+
> **5B**: `string` = `'Qwen2.5'`
|
|
20
|
+
|
|
21
|
+
### unsloth/Llama-3.2-1B-Instruct
|
|
22
|
+
|
|
23
|
+
> **2-1B-Instruct**: `string` = `'Llama 3.2'`
|
|
24
|
+
|
|
25
|
+
### Xenova/bert-base-cased
|
|
26
|
+
|
|
27
|
+
> **Xenova/bert-base-cased**: `string` = `'bert-base-cased'`
|
|
28
|
+
|
|
29
|
+
### Xenova/c4ai-command-r-v01-tokenizer
|
|
30
|
+
|
|
31
|
+
> **Xenova/c4ai-command-r-v01-tokenizer**: `string` = `'Cohere Command-R'`
|
|
32
|
+
|
|
33
|
+
### Xenova/claude-tokenizer
|
|
34
|
+
|
|
35
|
+
> **Xenova/claude-tokenizer**: `string` = `'Claude'`
|
|
36
|
+
|
|
37
|
+
### Xenova/gemma-tokenizer
|
|
38
|
+
|
|
39
|
+
> **Xenova/gemma-tokenizer**: `string` = `'Gemma'`
|
|
40
|
+
|
|
41
|
+
### Xenova/gemma2-tokenizer
|
|
42
|
+
|
|
43
|
+
> **Xenova/gemma2-tokenizer**: `string` = `'Gemma2'`
|
|
44
|
+
|
|
45
|
+
### Xenova/gpt-3
|
|
46
|
+
|
|
47
|
+
> **Xenova/gpt-3**: `string` = `'gpt-3'`
|
|
48
|
+
|
|
49
|
+
### Xenova/gpt-4
|
|
50
|
+
|
|
51
|
+
> **Xenova/gpt-4**: `string` = `'gpt-4 / gpt-3.5-turbo / text-embedding-ada-002'`
|
|
52
|
+
|
|
53
|
+
### Xenova/grok-1-tokenizer
|
|
54
|
+
|
|
55
|
+
> **Xenova/grok-1-tokenizer**: `string` = `'Grok-1'`
|
|
56
|
+
|
|
57
|
+
### Xenova/llama-tokenizer
|
|
58
|
+
|
|
59
|
+
> **Xenova/llama-tokenizer**: `string` = `'LLaMA / Llama 2'`
|
|
60
|
+
|
|
61
|
+
### Xenova/llama3-tokenizer-new
|
|
62
|
+
|
|
63
|
+
> **Xenova/llama3-tokenizer-new**: `string` = `'Llama 3'`
|
|
64
|
+
|
|
65
|
+
### Xenova/mistral-tokenizer-v1
|
|
66
|
+
|
|
67
|
+
> **Xenova/mistral-tokenizer-v1**: `string` = `'Mistral v1'`
|
|
68
|
+
|
|
69
|
+
### Xenova/mistral-tokenizer-v3
|
|
70
|
+
|
|
71
|
+
> **Xenova/mistral-tokenizer-v3**: `string` = `'Mistral v3'`
|
|
72
|
+
|
|
73
|
+
### Xenova/t5-small
|
|
74
|
+
|
|
75
|
+
> **Xenova/t5-small**: `string` = `'T5'`
|
|
76
|
+
|
|
77
|
+
### Xenova/text-davinci-003
|
|
78
|
+
|
|
79
|
+
> **Xenova/text-davinci-003**: `string` = `'text-davinci-003 / text-davinci-002'`
|
|
80
|
+
|
|
81
|
+
## Defined in
|
|
82
|
+
|
|
83
|
+
[packages/ai-tool/src/utils/llm-tokenizer.ts:13](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/llm-tokenizer.ts#L13)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / LLM\_TOKENIZER\_NAMES\_MAP
|
|
6
|
+
|
|
7
|
+
# Variable: LLM\_TOKENIZER\_NAMES\_MAP
|
|
8
|
+
|
|
9
|
+
> `const` **LLM\_TOKENIZER\_NAMES\_MAP**: `any`
|
|
10
|
+
|
|
11
|
+
## Defined in
|
|
12
|
+
|
|
13
|
+
[packages/ai-tool/src/utils/llm-tokenizer.ts:33](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/llm-tokenizer.ts#L33)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/consts.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/consts.ts:3](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/consts.ts#L3)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:12](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/prompt/consts.ts:12](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/prompt/consts.ts#L12)
|
|
@@ -13,4 +13,4 @@ defaults to `chat`
|
|
|
13
13
|
|
|
14
14
|
## Defined in
|
|
15
15
|
|
|
16
|
-
[packages/ai-tool/src/utils/prompt/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/
|
|
16
|
+
[packages/ai-tool/src/utils/prompt/consts.ts:5](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/prompt/consts.ts#L5)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:3](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:3](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/stream/error-readable-stream.ts#L3)
|
|
@@ -84,4 +84,4 @@
|
|
|
84
84
|
|
|
85
85
|
## Defined in
|
|
86
86
|
|
|
87
|
-
[packages/ai-tool/src/utils/consts.ts:13](https://github.com/isdk/ai-tool.js/blob/
|
|
87
|
+
[packages/ai-tool/src/utils/consts.ts:13](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/consts.ts#L13)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:4](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/stream/error-readable-stream.ts:4](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/stream/error-readable-stream.ts#L4)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/event/sse-channel.ts:17](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/event/sse-channel.ts:17](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/event/sse-channel.ts#L17)
|
|
@@ -84,4 +84,4 @@
|
|
|
84
84
|
|
|
85
85
|
## Defined in
|
|
86
86
|
|
|
87
|
-
[packages/ai-tool/src/server-tools.ts:62](https://github.com/isdk/ai-tool.js/blob/
|
|
87
|
+
[packages/ai-tool/src/server-tools.ts:62](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/server-tools.ts#L62)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/tool-func.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/tool-func.ts:8](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/tool-func.ts#L8)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/tool-func.ts:7](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/tool-func.ts:7](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/tool-func.ts#L7)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/tool-func.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/tool-func.ts:9](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/tool-func.ts#L9)
|
|
@@ -122,4 +122,4 @@
|
|
|
122
122
|
|
|
123
123
|
## Defined in
|
|
124
124
|
|
|
125
|
-
[packages/ai-tool/src/tool-func.ts:348](https://github.com/isdk/ai-tool.js/blob/
|
|
125
|
+
[packages/ai-tool/src/tool-func.ts:348](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/tool-func.ts#L348)
|
|
@@ -12,4 +12,4 @@ Regular expression pattern for reserved names on Windows systems.
|
|
|
12
12
|
|
|
13
13
|
## Defined in
|
|
14
14
|
|
|
15
|
-
[packages/ai-tool/src/utils/filename.ts:13](https://github.com/isdk/ai-tool.js/blob/
|
|
15
|
+
[packages/ai-tool/src/utils/filename.ts:13](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/filename.ts#L13)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/hash/xxhash.ts:
|
|
13
|
+
[packages/ai-tool/src/utils/hash/xxhash.ts:6](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/hash/xxhash.ts#L6)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:8](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/utils/prompt/prompt-template.ts:8](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/prompt/prompt-template.ts#L8)
|
package/docs/variables/event.md
CHANGED
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/funcs/event.ts:22](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/funcs/event.ts:22](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/funcs/event.ts#L22)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/funcs/event-client.ts:180](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/funcs/event-client.ts:180](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/funcs/event-client.ts#L180)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/funcs/event-server.ts:133](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/funcs/event-server.ts:133](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/funcs/event-server.ts#L133)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[packages/ai-tool/src/funcs/lrucache.ts:40](https://github.com/isdk/ai-tool.js/blob/
|
|
13
|
+
[packages/ai-tool/src/funcs/lrucache.ts:40](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/funcs/lrucache.ts#L40)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isdk/ai-tool",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"author": "Riceball LEE <snowyu.lee@gmail.com>",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@isdk/common-error": "^0.1.
|
|
25
|
+
"@isdk/common-error": "^0.1.3",
|
|
26
|
+
"@xenova/transformers": "^2.17.2",
|
|
26
27
|
"abstract-error": "^2.0.0",
|
|
27
28
|
"base32768": "^3.0.1",
|
|
28
29
|
"custom-ability": "^2.0.0",
|
|
@@ -30,6 +31,8 @@
|
|
|
30
31
|
"date-fns": "^4.1.0",
|
|
31
32
|
"events-ex": "^2.0.0",
|
|
32
33
|
"eventsource-parser": "^2.0.1",
|
|
34
|
+
"hash-wasm": "^4.11.0",
|
|
35
|
+
"jschardet": "^3.1.4",
|
|
33
36
|
"json-canonicalize": "^1.0.6",
|
|
34
37
|
"load-config-file": "2.0.0",
|
|
35
38
|
"lodash-es": "^4.17.21",
|
|
@@ -45,7 +48,8 @@
|
|
|
45
48
|
"yaml": "^2.5.1",
|
|
46
49
|
"yaml-types": "^0.4.0",
|
|
47
50
|
"zod": "^3.23.8",
|
|
48
|
-
"zod-to-json-schema": "^3.23.3"
|
|
51
|
+
"zod-to-json-schema": "^3.23.3",
|
|
52
|
+
"@isdk/detect-text-language": "0.1.2"
|
|
49
53
|
},
|
|
50
54
|
"devDependencies": {
|
|
51
55
|
"@antfu/eslint-config": "^3.6.2",
|