@isdk/ai-tool 0.2.2 → 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 +443 -11
- package/dist/index.d.ts +443 -11
- 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 +38 -0
- 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 +21 -0
- 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 +39 -0
- 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 +6 -34
- 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/toRegExp.md +34 -0
- 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 +50 -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-PY6NRGZE.mjs +0 -1
- package/docs/enumerations/XXHashAlgorithm.md +0 -27
- /package/dist/{chunk-PXQPLL62.mjs → chunk-VIG2GB47.mjs} +0 -0
|
@@ -18,4 +18,4 @@ val is ReadableStream\<any\> \| WritableStream\<any\>
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[packages/ai-tool/src/utils/stream/is-web-stream.ts:1](https://github.com/isdk/ai-tool.js/blob/
|
|
21
|
+
[packages/ai-tool/src/utils/stream/is-web-stream.ts:1](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/stream/is-web-stream.ts#L1)
|
|
@@ -42,4 +42,4 @@ console.log(jsonFilterToWhere(jsonFilter)); // Outputs a WHERE clause based on t
|
|
|
42
42
|
|
|
43
43
|
## Defined in
|
|
44
44
|
|
|
45
|
-
[packages/ai-tool/src/utils/json-filter.ts:123](https://github.com/isdk/ai-tool.js/blob/
|
|
45
|
+
[packages/ai-tool/src/utils/json-filter.ts:123](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/json-filter.ts#L123)
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
|
|
29
29
|
## Defined in
|
|
30
30
|
|
|
31
|
-
[packages/ai-tool/src/utils/json-to-markdown-str.ts:2](https://github.com/isdk/ai-tool.js/blob/
|
|
31
|
+
[packages/ai-tool/src/utils/json-to-markdown-str.ts:2](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/json-to-markdown-str.ts#L2)
|
|
@@ -51,4 +51,4 @@ const content = loadFileFromPaths('config', ['/etc', '/usr/local/etc'], ['.json'
|
|
|
51
51
|
|
|
52
52
|
## Defined in
|
|
53
53
|
|
|
54
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:
|
|
54
|
+
[packages/ai-tool/src/utils/load-file-from-paths.ts:44](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/load-file-from-paths.ts#L44)
|
|
@@ -26,4 +26,4 @@
|
|
|
26
26
|
|
|
27
27
|
## Defined in
|
|
28
28
|
|
|
29
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:
|
|
29
|
+
[packages/ai-tool/src/utils/load-file-from-paths.ts:101](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/load-file-from-paths.ts#L101)
|
|
@@ -26,4 +26,4 @@
|
|
|
26
26
|
|
|
27
27
|
## Defined in
|
|
28
28
|
|
|
29
|
-
[packages/ai-tool/src/funcs/lrucache.ts:6](https://github.com/isdk/ai-tool.js/blob/
|
|
29
|
+
[packages/ai-tool/src/funcs/lrucache.ts:6](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/funcs/lrucache.ts#L6)
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
|
|
21
21
|
## Defined in
|
|
22
22
|
|
|
23
|
-
[packages/ai-tool/src/utils/cancelable-ability.ts:340](https://github.com/isdk/ai-tool.js/blob/
|
|
23
|
+
[packages/ai-tool/src/utils/cancelable-ability.ts:340](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/cancelable-ability.ts#L340)
|
|
@@ -45,4 +45,4 @@ matchUrlProtocol("noProtocolHere");
|
|
|
45
45
|
|
|
46
46
|
## Defined in
|
|
47
47
|
|
|
48
|
-
[packages/ai-tool/src/utils/match-url-protocol.ts:23](https://github.com/isdk/ai-tool.js/blob/
|
|
48
|
+
[packages/ai-tool/src/utils/match-url-protocol.ts:23](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/match-url-protocol.ts#L23)
|
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
|
|
25
25
|
## Defined in
|
|
26
26
|
|
|
27
|
-
[packages/ai-tool/src/utils/memoize.ts:14](https://github.com/isdk/ai-tool.js/blob/
|
|
27
|
+
[packages/ai-tool/src/utils/memoize.ts:14](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/memoize.ts#L14)
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[packages/ai-tool/src/utils/chat.ts:
|
|
21
|
+
[packages/ai-tool/src/utils/chat.ts:121](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/chat.ts#L121)
|
|
@@ -29,4 +29,4 @@ A string representing the formatted parameter size with the appropriate scale un
|
|
|
29
29
|
|
|
30
30
|
## Defined in
|
|
31
31
|
|
|
32
|
-
[packages/ai-tool/src/utils/convert-params-size.ts:11](https://github.com/isdk/ai-tool.js/blob/
|
|
32
|
+
[packages/ai-tool/src/utils/convert-params-size.ts:11](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/convert-params-size.ts#L11)
|
|
@@ -30,4 +30,4 @@
|
|
|
30
30
|
|
|
31
31
|
## Defined in
|
|
32
32
|
|
|
33
|
-
[packages/ai-tool/src/utils/parse-command.ts:
|
|
33
|
+
[packages/ai-tool/src/utils/parse-command.ts:396](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/parse-command.ts#L396)
|
|
@@ -23,4 +23,4 @@ extract from langchain.js/langchain-core/src/prompts/template.ts
|
|
|
23
23
|
|
|
24
24
|
## Defined in
|
|
25
25
|
|
|
26
|
-
[packages/ai-tool/src/utils/prompt/template/python.ts:16](https://github.com/isdk/ai-tool.js/blob/
|
|
26
|
+
[packages/ai-tool/src/utils/prompt/template/python.ts:16](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/prompt/template/python.ts#L16)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: parseJsJson()
|
|
8
8
|
|
|
9
|
-
> **parseJsJson**(`input`, `scope`?): `any
|
|
9
|
+
> **parseJsJson**(`input`, `scope`?): `Promise`\<`any`\>
|
|
10
10
|
|
|
11
11
|
Parses a JavaScript string into a JSON object.
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ The string to be parsed into JSON.
|
|
|
20
20
|
|
|
21
21
|
## Returns
|
|
22
22
|
|
|
23
|
-
`any
|
|
23
|
+
`Promise`\<`any`\>
|
|
24
24
|
|
|
25
25
|
The parsed JSON object. If parsing fails, undefined is returned.
|
|
26
26
|
|
|
@@ -35,4 +35,4 @@ console.log(json); // { name: 'John' }
|
|
|
35
35
|
|
|
36
36
|
## Defined in
|
|
37
37
|
|
|
38
|
-
[packages/ai-tool/src/utils/parse-js-json.ts:
|
|
38
|
+
[packages/ai-tool/src/utils/parse-js-json.ts:16](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/parse-js-json.ts#L16)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / parseJsJsonSimpleSync
|
|
6
|
+
|
|
7
|
+
# Function: parseJsJsonSimpleSync()
|
|
8
|
+
|
|
9
|
+
> **parseJsJsonSimpleSync**(`input`, `scope`?): `any`
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
• **input**: `string`
|
|
14
|
+
|
|
15
|
+
• **scope?**: `Record`\<`string`, `any`\>
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
`any`
|
|
20
|
+
|
|
21
|
+
## Defined in
|
|
22
|
+
|
|
23
|
+
[packages/ai-tool/src/utils/parse-js-json.ts:28](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/parse-js-json.ts#L28)
|
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
|
|
25
25
|
## Defined in
|
|
26
26
|
|
|
27
|
-
[packages/ai-tool/src/utils/parse-command.ts:
|
|
27
|
+
[packages/ai-tool/src/utils/parse-command.ts:254](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/parse-command.ts#L254)
|
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
|
|
23
23
|
## Defined in
|
|
24
24
|
|
|
25
|
-
[packages/ai-tool/src/utils/parse-command.ts:
|
|
25
|
+
[packages/ai-tool/src/utils/parse-command.ts:92](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/parse-command.ts#L92)
|
|
@@ -65,4 +65,4 @@ console.log(arrayResult); // Output: [1, 2, 3]
|
|
|
65
65
|
|
|
66
66
|
## Defined in
|
|
67
67
|
|
|
68
|
-
[packages/ai-tool/src/utils/parse-command.ts:
|
|
68
|
+
[packages/ai-tool/src/utils/parse-command.ts:70](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/parse-command.ts#L70)
|
|
@@ -39,4 +39,4 @@ An array of parsed argument information, where each item contains a boolean indi
|
|
|
39
39
|
|
|
40
40
|
## Defined in
|
|
41
41
|
|
|
42
|
-
[packages/ai-tool/src/utils/parse-command.ts:
|
|
42
|
+
[packages/ai-tool/src/utils/parse-command.ts:303](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/parse-command.ts#L303)
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[packages/ai-tool/src/utils/config.ts:
|
|
21
|
+
[packages/ai-tool/src/utils/config.ts:24](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/config.ts#L24)
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[packages/ai-tool/src/utils/parse-command.ts:
|
|
21
|
+
[packages/ai-tool/src/utils/parse-command.ts:204](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/parse-command.ts#L204)
|
|
@@ -18,4 +18,4 @@ A compiled regular expression for control characters in a filename.
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[packages/ai-tool/src/utils/filename.ts:50](https://github.com/isdk/ai-tool.js/blob/
|
|
21
|
+
[packages/ai-tool/src/utils/filename.ts:50](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/filename.ts#L50)
|
|
@@ -44,4 +44,4 @@ console.log(files); // Outputs an array of JavaScript file paths.
|
|
|
44
44
|
|
|
45
45
|
## Defined in
|
|
46
46
|
|
|
47
|
-
[packages/ai-tool/src/utils/load-file-from-paths.ts:
|
|
47
|
+
[packages/ai-tool/src/utils/load-file-from-paths.ts:136](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/load-file-from-paths.ts#L136)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / readTextFileChunks
|
|
6
|
+
|
|
7
|
+
# Function: readTextFileChunks()
|
|
8
|
+
|
|
9
|
+
> **readTextFileChunks**(`filePath`, `options`?): `AsyncIterable`\<`string`\>
|
|
10
|
+
|
|
11
|
+
Reads a text file and yields chunks of text that are within a specified token limit.
|
|
12
|
+
This function supports both small files that can be read entirely into memory,
|
|
13
|
+
and large files that require streaming.
|
|
14
|
+
|
|
15
|
+
Note: The specified `size` must not be less than the token count of the longest sentence.
|
|
16
|
+
If the `size` is less than the token count of the longest sentence, some sentences may not
|
|
17
|
+
fit completely into a single chunk.
|
|
18
|
+
Without completeSentence and corrected Only!
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
• **filePath**: `string`
|
|
23
|
+
|
|
24
|
+
The path to the text file to be read.
|
|
25
|
+
|
|
26
|
+
• **options?**: [`IReadTextFileChunksOptions`](../interfaces/IReadTextFileChunksOptions.md)
|
|
27
|
+
|
|
28
|
+
optional Options for reading the file.
|
|
29
|
+
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
`AsyncIterable`\<`string`\>
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
const filePath = 'path/to/file.txt';
|
|
38
|
+
const options = {
|
|
39
|
+
size: 2048,
|
|
40
|
+
modelId: 'gpt-3.5',
|
|
41
|
+
metaInfo: { size: 10240 }
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
for await (const chunk of readTextFileChunks(filePath, options)) {
|
|
45
|
+
console.log('Chunk:', chunk);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Defined in
|
|
50
|
+
|
|
51
|
+
[packages/ai-tool/src/utils/read-text-file-chunks.ts:41](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/read-text-file-chunks.ts#L41)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / readTextFileChunksEx
|
|
6
|
+
|
|
7
|
+
# Function: readTextFileChunksEx()
|
|
8
|
+
|
|
9
|
+
> **readTextFileChunksEx**(`filePath`, `options`?): `AsyncIterable`\<`string`[]\>
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
• **filePath**: `string`
|
|
14
|
+
|
|
15
|
+
• **options?**: [`IReadTextFileChunksOptions`](../interfaces/IReadTextFileChunksOptions.md)
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
`AsyncIterable`\<`string`[]\>
|
|
20
|
+
|
|
21
|
+
## Defined in
|
|
22
|
+
|
|
23
|
+
[packages/ai-tool/src/utils/read-text-file-chunks.ts:109](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/read-text-file-chunks.ts#L109)
|
|
@@ -25,4 +25,4 @@ https://github.com/whatwg/streams/commit/8d7a0bf26eb2cc23e884ddbaac7c1da4b91cf2b
|
|
|
25
25
|
|
|
26
26
|
## Defined in
|
|
27
27
|
|
|
28
|
-
[packages/ai-tool/src/utils/stream/ai-stream.ts:166](https://github.com/isdk/ai-tool.js/blob/
|
|
28
|
+
[packages/ai-tool/src/utils/stream/ai-stream.ts:166](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/stream/ai-stream.ts#L166)
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[packages/ai-tool/src/funcs/index.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
17
|
+
[packages/ai-tool/src/funcs/index.ts:9](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/funcs/index.ts#L9)
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[packages/ai-tool/src/utils/config.ts:
|
|
21
|
+
[packages/ai-tool/src/utils/config.ts:14](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/config.ts#L14)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / removeMarkdownBold
|
|
6
|
+
|
|
7
|
+
# Function: removeMarkdownBold()
|
|
8
|
+
|
|
9
|
+
> **removeMarkdownBold**(`s`, `once`?): `string`
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
• **s**: `string`
|
|
14
|
+
|
|
15
|
+
• **once?**: `boolean`
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
## Defined in
|
|
22
|
+
|
|
23
|
+
[packages/ai-tool/src/utils/split-sentence.ts:292](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/split-sentence.ts#L292)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / removeMarkdownBoldAndItalic
|
|
6
|
+
|
|
7
|
+
# Function: removeMarkdownBoldAndItalic()
|
|
8
|
+
|
|
9
|
+
> **removeMarkdownBoldAndItalic**(`s`, `once`?): `string`
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
• **s**: `string`
|
|
14
|
+
|
|
15
|
+
• **once?**: `boolean`
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
## Defined in
|
|
22
|
+
|
|
23
|
+
[packages/ai-tool/src/utils/split-sentence.ts:312](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/split-sentence.ts#L312)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / removeMarkdownItalic
|
|
6
|
+
|
|
7
|
+
# Function: removeMarkdownItalic()
|
|
8
|
+
|
|
9
|
+
> **removeMarkdownItalic**(`s`, `once`?): `string`
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
• **s**: `string`
|
|
14
|
+
|
|
15
|
+
• **once?**: `boolean`
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
## Defined in
|
|
22
|
+
|
|
23
|
+
[packages/ai-tool/src/utils/split-sentence.ts:302](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/split-sentence.ts#L302)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / replaceWithPlaceholder
|
|
6
|
+
|
|
7
|
+
# Function: replaceWithPlaceholder()
|
|
8
|
+
|
|
9
|
+
> **replaceWithPlaceholder**(`content`, `options`?): [`string`, `string`[]]
|
|
10
|
+
|
|
11
|
+
Replaces substrings in the given content with placeholders.
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
• **content**: `string`
|
|
16
|
+
|
|
17
|
+
The string content to process.
|
|
18
|
+
|
|
19
|
+
• **options?**: [`ReplacePlacehoderOptions`](../interfaces/ReplacePlacehoderOptions.md)
|
|
20
|
+
|
|
21
|
+
Optional configuration object with the following properties:
|
|
22
|
+
- `startChar` - The starting character(s) of the substrings to replace. Can be a single character or an array of characters. Defaults to `["\"", "'"]`.
|
|
23
|
+
- `endChar` - The ending character(s) of the substrings to replace. Can be a single character or an array of characters. Defaults to the value of `startChar`.
|
|
24
|
+
- `placeholder` - The prefix for the placeholder names. Defaults to `defaultPlaceholderName`.
|
|
25
|
+
- `placehoders` - An array of placeholders to use instead of generating new one.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
[`string`, `string`[]]
|
|
30
|
+
|
|
31
|
+
An array containing:
|
|
32
|
+
- `content` - The modified content with placeholders.
|
|
33
|
+
- `placehoders` - An array of the original substrings that were replaced.
|
|
34
|
+
|
|
35
|
+
## Throws
|
|
36
|
+
|
|
37
|
+
If the lengths of `startChar` and `endChar` are not the same.
|
|
38
|
+
|
|
39
|
+
## Defined in
|
|
40
|
+
|
|
41
|
+
[packages/ai-tool/src/utils/parse-command.ts:436](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/parse-command.ts#L436)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / restoreFromPlacehoders
|
|
6
|
+
|
|
7
|
+
# Function: restoreFromPlacehoders()
|
|
8
|
+
|
|
9
|
+
> **restoreFromPlacehoders**(`content`, `placehoders`, `options`?): `string`
|
|
10
|
+
|
|
11
|
+
Restores the original substrings from placeholders in the given content.
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
• **content**: `string`
|
|
16
|
+
|
|
17
|
+
The string content containing placeholders to be restored.
|
|
18
|
+
|
|
19
|
+
• **placehoders**: `string`[]
|
|
20
|
+
|
|
21
|
+
An array of the original substrings that were replaced by placeholders.
|
|
22
|
+
|
|
23
|
+
• **options?**: [`ReplacePlacehoderOptions`](../interfaces/ReplacePlacehoderOptions.md)
|
|
24
|
+
|
|
25
|
+
Optional configuration object with the following properties:
|
|
26
|
+
- `placeholder` - The prefix for the placeholder names. Defaults to `__PlacEhoLdeR_`.
|
|
27
|
+
|
|
28
|
+
## Returns
|
|
29
|
+
|
|
30
|
+
`string`
|
|
31
|
+
|
|
32
|
+
The modified content with the original substrings restored.
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
const contentWithPlaceholders = "Hello __PlacEhoLdeR_0, welcome to __PlacEhoLdeR_1!";
|
|
38
|
+
const originalSubstrings = ["World", "the site"];
|
|
39
|
+
const restoredContent = restoreFromPlacehoders(contentWithPlaceholders, originalSubstrings);
|
|
40
|
+
console.log(restoredContent); // Output: "Hello World, welcome to the site!"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Defined in
|
|
44
|
+
|
|
45
|
+
[packages/ai-tool/src/utils/parse-command.ts:489](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/parse-command.ts#L489)
|
|
@@ -34,4 +34,4 @@ The sanitized filename.
|
|
|
34
34
|
|
|
35
35
|
## Defined in
|
|
36
36
|
|
|
37
|
-
[packages/ai-tool/src/utils/filename.ts:97](https://github.com/isdk/ai-tool.js/blob/
|
|
37
|
+
[packages/ai-tool/src/utils/filename.ts:97](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/filename.ts#L97)
|
|
@@ -28,4 +28,4 @@ The sanitized file path as a string.
|
|
|
28
28
|
|
|
29
29
|
## Defined in
|
|
30
30
|
|
|
31
|
-
[packages/ai-tool/src/utils/filename.ts:149](https://github.com/isdk/ai-tool.js/blob/
|
|
31
|
+
[packages/ai-tool/src/utils/filename.ts:149](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/filename.ts#L149)
|
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
|
|
23
23
|
## Defined in
|
|
24
24
|
|
|
25
|
-
[packages/ai-tool/src/utils/config.ts:
|
|
25
|
+
[packages/ai-tool/src/utils/config.ts:88](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/config.ts#L88)
|
|
@@ -24,4 +24,4 @@ The parameter size in bytes.
|
|
|
24
24
|
|
|
25
25
|
## Defined in
|
|
26
26
|
|
|
27
|
-
[packages/ai-tool/src/utils/convert-params-size.ts:44](https://github.com/isdk/ai-tool.js/blob/
|
|
27
|
+
[packages/ai-tool/src/utils/convert-params-size.ts:44](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/convert-params-size.ts#L44)
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[packages/ai-tool/src/utils/parse-command.ts:
|
|
21
|
+
[packages/ai-tool/src/utils/parse-command.ts:75](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/parse-command.ts#L75)
|
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
|
|
23
23
|
## Defined in
|
|
24
24
|
|
|
25
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:4](https://github.com/isdk/ai-tool.js/blob/
|
|
25
|
+
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:4](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/prompt/few-shot-prompt-template.ts#L4)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / splitChunks
|
|
6
|
+
|
|
7
|
+
# Function: splitChunks()
|
|
8
|
+
|
|
9
|
+
> **splitChunks**(`content`, `options`?): `Promise`\<`string`[][]\>
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
• **content**: `string`
|
|
14
|
+
|
|
15
|
+
• **options?**: [`IReadTextFileChunksOptions`](../interfaces/IReadTextFileChunksOptions.md)
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
`Promise`\<`string`[][]\>
|
|
20
|
+
|
|
21
|
+
## Defined in
|
|
22
|
+
|
|
23
|
+
[packages/ai-tool/src/utils/read-text-file-chunks.ts:182](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/read-text-file-chunks.ts#L182)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md) • **Docs**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / splitParagraph
|
|
6
|
+
|
|
7
|
+
# Function: splitParagraph()
|
|
8
|
+
|
|
9
|
+
> **splitParagraph**(`value`, `options`?): `string`[][]
|
|
10
|
+
|
|
11
|
+
Splits the input string into paragraphs based on empty lines and title lines.
|
|
12
|
+
Each paragraph is represented as an array of strings, where each string is a line in the paragraph.
|
|
13
|
+
|
|
14
|
+
## Parameters
|
|
15
|
+
|
|
16
|
+
• **value**: `string`
|
|
17
|
+
|
|
18
|
+
The input string to be split into paragraphs.
|
|
19
|
+
|
|
20
|
+
• **options?**: [`SplitSentenceOptions`](../interfaces/SplitSentenceOptions.md)
|
|
21
|
+
|
|
22
|
+
Optional configuration options for splitting the string.
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
`string`[][]
|
|
27
|
+
|
|
28
|
+
A two-dimensional array where each sub-array represents a paragraph.
|
|
29
|
+
|
|
30
|
+
## Defined in
|
|
31
|
+
|
|
32
|
+
[packages/ai-tool/src/utils/split-paragraph.ts:12](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/split-paragraph.ts#L12)
|
|
@@ -17,7 +17,7 @@ This function is used to split a text into separate sentences, based on punctuat
|
|
|
17
17
|
|
|
18
18
|
The input string that needs to be split into sentences.
|
|
19
19
|
|
|
20
|
-
• **best**: `
|
|
20
|
+
• **best**: [`SplitSentenceOptions`](../interfaces/SplitSentenceOptions.md) = `{}`
|
|
21
21
|
|
|
22
22
|
A boolean flag indicating if the function should use the best possible sentence splitting method (default is true).
|
|
23
23
|
If set to false, it will not perform any additional processing and simply split on newline characters ('\n').
|
|
@@ -34,4 +34,4 @@ console.log(splitSentence(text)); // returns ['Hello world!', 'How are you toda
|
|
|
34
34
|
|
|
35
35
|
## Defined in
|
|
36
36
|
|
|
37
|
-
[packages/ai-tool/src/utils/split-sentence.ts:
|
|
37
|
+
[packages/ai-tool/src/utils/split-sentence.ts:44](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/split-sentence.ts#L44)
|
|
@@ -6,44 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: stringifyYaml()
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
> **stringifyYaml**(`content`): `string`
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Parameters
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
• **content**: `any`
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
• **value**: `any`
|
|
18
|
-
|
|
19
|
-
• **options?**: `DocumentOptions` & `SchemaOptions` & `ParseOptions` & `CreateNodeOptions` & `ToStringOptions`
|
|
20
|
-
|
|
21
|
-
### Returns
|
|
22
|
-
|
|
23
|
-
`string`
|
|
24
|
-
|
|
25
|
-
Will always include `\n` as the last character, as is expected of YAML documents.
|
|
26
|
-
|
|
27
|
-
### Defined in
|
|
28
|
-
|
|
29
|
-
node\_modules/.pnpm/yaml@2.5.1/node\_modules/yaml/dist/public-api.d.ts:42
|
|
30
|
-
|
|
31
|
-
## stringifyYaml(value, replacer, options)
|
|
32
|
-
|
|
33
|
-
> **stringifyYaml**(`value`, `replacer`?, `options`?): `string`
|
|
34
|
-
|
|
35
|
-
### Parameters
|
|
36
|
-
|
|
37
|
-
• **value**: `any`
|
|
38
|
-
|
|
39
|
-
• **replacer?**: `null` \| `Replacer`
|
|
40
|
-
|
|
41
|
-
• **options?**: `string` \| `number` \| `DocumentOptions` & `SchemaOptions` & `ParseOptions` & `CreateNodeOptions` & `ToStringOptions`
|
|
42
|
-
|
|
43
|
-
### Returns
|
|
15
|
+
## Returns
|
|
44
16
|
|
|
45
17
|
`string`
|
|
46
18
|
|
|
47
|
-
|
|
19
|
+
## Defined in
|
|
48
20
|
|
|
49
|
-
|
|
21
|
+
[packages/ai-tool/src/utils/config.ts:28](https://github.com/isdk/ai-tool.js/blob/e324043799402aa2caa41711a9168487ab85c166/src/utils/config.ts#L28)
|