@isdk/ai-tool 0.8.2 → 0.9.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-BIJ2JH4U.mjs +1 -0
- package/dist/chunk-OYMVHUDZ.mjs +1 -0
- package/dist/funcs.d.mts +16 -5
- package/dist/funcs.d.ts +16 -5
- package/dist/funcs.js +1 -1
- package/dist/funcs.mjs +1 -1
- package/dist/index.d.mts +839 -563
- package/dist/index.d.ts +839 -563
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/test/util.d.mts +1 -1
- package/dist/test/util.d.ts +1 -1
- package/dist/test/util.js +1 -1
- package/dist/test/util.mjs +1 -1
- package/docs/api/@isdk/namespaces/ClientTools/README.md +11 -0
- package/docs/api/@isdk/namespaces/ClientTools/functions/get.md +27 -0
- package/docs/api/@isdk/namespaces/EventStates/variables/ABORT.md +1 -1
- package/docs/api/@isdk/namespaces/EventStates/variables/CONTINUE.md +1 -1
- package/docs/api/@isdk/namespaces/EventStates/variables/DONE.md +1 -1
- package/docs/api/@isdk/namespaces/EventStates/variables/STOPPED.md +1 -1
- package/docs/api/classes/BinarySemaphore.md +148 -67
- package/docs/api/classes/CancelableAbility.md +95 -43
- package/docs/api/classes/ClientToolTransport.md +31 -16
- package/docs/api/classes/ClientTools.md +868 -158
- package/docs/api/classes/CmdArgLexer.md +82 -0
- package/docs/api/classes/CmdArgParser.md +56 -0
- package/docs/api/classes/ConfigFile.md +6 -6
- package/docs/api/classes/EnvPromptTemplate.md +224 -52
- package/docs/api/classes/EventClient.md +902 -192
- package/docs/api/classes/EventEmitter.md +62 -12
- package/docs/api/classes/EventServer.md +895 -182
- package/docs/api/classes/EventToolFunc.md +801 -123
- package/docs/api/classes/FStringPromptTemplate.md +224 -52
- package/docs/api/classes/FewShotPromptTemplate.md +231 -59
- package/docs/api/classes/GolangPromptTemplate.md +224 -52
- package/docs/api/classes/HttpClientToolTransport.md +33 -19
- package/docs/api/classes/HttpServerToolTransport.md +15 -15
- package/docs/api/classes/IntSet.md +21 -21
- package/docs/api/classes/MailboxClientTransport.md +398 -0
- package/docs/api/classes/MailboxServerTransport.md +433 -0
- package/docs/api/classes/PromptExampleSelector.md +11 -11
- package/docs/api/classes/PromptTemplate.md +199 -51
- package/docs/api/classes/ReadableStreamError.md +2 -2
- package/docs/api/classes/ResClientTools.md +875 -165
- package/docs/api/classes/ResServerTools.md +869 -156
- package/docs/api/classes/RpcMethodsClientTool.md +870 -160
- package/docs/api/classes/RpcMethodsServerTool.md +865 -152
- package/docs/api/classes/SSEChannel.md +23 -23
- package/docs/api/classes/Semaphore.md +148 -76
- package/docs/api/classes/ServerToolTransport.md +14 -13
- package/docs/api/classes/ServerTools.md +854 -138
- package/docs/api/classes/SignalGate.md +12 -12
- package/docs/api/classes/SseClientPubSubTransport.md +4 -4
- package/docs/api/classes/SseServerPubSubTransport.md +13 -13
- package/docs/api/classes/TaskAbortController.md +33 -11
- package/docs/api/classes/ToolFunc.md +725 -119
- package/docs/api/classes/ToolTransport.md +7 -7
- package/docs/api/classes/YamlTypeBaseObject.md +2 -2
- package/docs/api/enumerations/AsyncFeatureBits.md +4 -4
- package/docs/api/enumerations/AsyncFeatures.md +4 -4
- package/docs/api/enumerations/CmdArgTokenType.md +129 -0
- package/docs/api/enumerations/HashAlgorithm.md +38 -12
- package/docs/api/functions/AIArgProcessor.md +8 -17
- package/docs/api/functions/AIStream.md +1 -1
- package/docs/api/functions/ChoiceArgProcessor.md +13 -15
- package/docs/api/functions/DefaultDateFormat.md +1 -1
- package/docs/api/functions/ObjectArgsToArgsInfo.md +11 -9
- package/docs/api/functions/RateLimit.md +33 -6
- package/docs/api/functions/TemplateArgProcessor.md +13 -15
- package/docs/api/functions/assignDirs.md +1 -1
- package/docs/api/functions/beforeShutdown.md +3 -3
- package/docs/api/functions/calcPerplexity.md +3 -3
- package/docs/api/functions/calcPerplexitySimple.md +3 -3
- package/docs/api/functions/cmdArgEvaluate.md +28 -0
- package/docs/api/functions/cmdArgsToMergedObject.md +34 -0
- package/docs/api/functions/completeSentences.md +1 -1
- package/docs/api/functions/concatText.md +1 -1
- package/docs/api/functions/countLLMTokens.md +1 -1
- package/docs/api/functions/countRegexMatches.md +1 -1
- package/docs/api/functions/createCallbacksTransformer.md +23 -19
- package/docs/api/functions/createEmptyReadableStream.md +1 -1
- package/docs/api/functions/createEndWithRepetitionDetector.md +4 -4
- package/docs/api/functions/createEventStreamTransformer.md +1 -1
- package/docs/api/functions/createHfValueFunc.md +1 -1
- package/docs/api/functions/createLRUCache.md +1 -1
- package/docs/api/functions/createYamlObjectTag.md +1 -1
- package/docs/api/functions/dateToText.md +1 -1
- package/docs/api/functions/decodeCharset.md +1 -1
- package/docs/api/functions/defaultsWithConcat.md +1 -1
- package/docs/api/functions/detectCharset.md +1 -1
- package/docs/api/functions/encodeLLMTokens.md +1 -1
- package/docs/api/functions/ensureQuoted.md +3 -1
- package/docs/api/functions/evaluateExpression.md +40 -0
- package/docs/api/functions/eventable.md +1 -1
- package/docs/api/functions/expandConfig.md +1 -1
- package/docs/api/functions/expandEnv.md +1 -1
- package/docs/api/functions/expandObjEnv.md +1 -1
- package/docs/api/functions/expandPath.md +1 -1
- package/docs/api/functions/expandPathInObject.md +1 -1
- package/docs/api/functions/expandPaths.md +1 -1
- package/docs/api/functions/extNameLevel.md +1 -1
- package/docs/api/functions/extractCodeBlock.md +51 -0
- package/docs/api/functions/fileIsExists.md +3 -3
- package/docs/api/functions/filterValidFnScope.md +3 -3
- package/docs/api/functions/findIndexNonEmptyFrom.md +1 -1
- package/docs/api/functions/findPort.md +13 -5
- package/docs/api/functions/formatTextWithSpace.md +1 -1
- package/docs/api/functions/funcGetMeta.md +1 -1
- package/docs/api/functions/funcWithMeta.md +4 -4
- package/docs/api/functions/genUrlParamsStr.md +1 -1
- package/docs/api/functions/getAllEnumKeys.md +1 -1
- package/docs/api/functions/getConfigFileNames.md +1 -1
- package/docs/api/functions/getConfigs.md +1 -1
- package/docs/api/functions/getEnvVairables.md +1 -1
- package/docs/api/functions/getFileMetaInfo.md +1 -1
- package/docs/api/functions/getHashAlgoBySize.md +1 -1
- package/docs/api/functions/getKeysPath.md +1 -1
- package/docs/api/functions/getLLMTokenizer.md +1 -1
- package/docs/api/functions/getMultiLevelExtname.md +1 -1
- package/docs/api/functions/getPackageDir.md +1 -1
- package/docs/api/functions/getRealFilepath.md +1 -1
- package/docs/api/functions/getResponseErrorReadableStream.md +2 -2
- package/docs/api/functions/getXDGConfigs.md +1 -1
- package/docs/api/functions/hasDirectoryIn.md +3 -3
- package/docs/api/functions/hash.md +25 -4
- package/docs/api/functions/hashFile.md +1 -1
- package/docs/api/functions/hashObject.md +23 -1
- package/docs/api/functions/hashStream.md +25 -4
- package/docs/api/functions/initShutdown.md +1 -1
- package/docs/api/functions/isIdentifier.md +30 -0
- package/docs/api/functions/isLangUsingSpaces.md +1 -1
- package/docs/api/functions/isListItemString.md +3 -3
- package/docs/api/functions/isModelNameMatched.md +3 -3
- package/docs/api/functions/isPathIdentifier.md +23 -0
- package/docs/api/functions/isPunctuationChar.md +1 -1
- package/docs/api/functions/isQuoted.md +4 -1
- package/docs/api/functions/isRegExp.md +20 -1
- package/docs/api/functions/isSameString.md +1 -1
- package/docs/api/functions/isSectionString.md +3 -3
- package/docs/api/functions/isSentenceEnding.md +1 -1
- package/docs/api/functions/isSepLineString.md +3 -3
- package/docs/api/functions/isStrWrapped.md +3 -1
- package/docs/api/functions/isSubdirectory.md +1 -1
- package/docs/api/functions/isTitleString.md +3 -3
- package/docs/api/functions/isValidFilename.md +1 -1
- package/docs/api/functions/isValidFilepath.md +1 -1
- package/docs/api/functions/isWebStream.md +1 -1
- package/docs/api/functions/joinSplitWords.md +1 -1
- package/docs/api/functions/jsonFilterToWhere.md +1 -1
- package/docs/api/functions/jsonToMarkdownStr.md +1 -1
- package/docs/api/functions/loadAIConfig.md +1 -1
- package/docs/api/functions/loadConfig.md +1 -1
- package/docs/api/functions/loadConfigFile.md +1 -1
- package/docs/api/functions/loadFileFromPaths.md +1 -1
- package/docs/api/functions/loadTextFromPaths.md +1 -1
- package/docs/api/functions/lrucache.md +1 -1
- package/docs/api/functions/matchUrlProtocol.md +3 -3
- package/docs/api/functions/memoize.md +1 -1
- package/docs/api/functions/mergeArray.md +1 -1
- package/docs/api/functions/messagesToText.md +1 -1
- package/docs/api/functions/normalizePath.md +1 -1
- package/docs/api/functions/paramsSizeToScaleStr.md +1 -1
- package/docs/api/functions/parseCommand.md +21 -4
- package/docs/api/functions/parseJsJson.md +1 -1
- package/docs/api/functions/parseJsJsonSimpleSync.md +1 -1
- package/docs/api/functions/parseObjectArguments.md +17 -33
- package/docs/api/functions/parseYaml.md +1 -1
- package/docs/api/functions/prependNewlineIfMultiline.md +39 -0
- package/docs/api/functions/pruneSubdirectories.md +1 -1
- package/docs/api/functions/pruneSubdirectoriesInPlace.md +1 -1
- package/docs/api/functions/quoteStr.md +4 -1
- package/docs/api/functions/readFilenamesRecursiveSync.md +1 -1
- package/docs/api/functions/readTextFileChunks.md +1 -1
- package/docs/api/functions/readTextFileChunksEx.md +1 -1
- package/docs/api/functions/readableFromAsyncIterable.md +1 -1
- package/docs/api/functions/registerCoreTools.md +1 -1
- package/docs/api/functions/registerYamlTag.md +2 -2
- package/docs/api/functions/removeMarkdownBold.md +1 -1
- package/docs/api/functions/removeMarkdownBoldAndItalic.md +1 -1
- package/docs/api/functions/removeMarkdownItalic.md +1 -1
- package/docs/api/functions/replaceWithPlaceholder.md +3 -18
- package/docs/api/functions/restoreFromPlacehoders.md +2 -20
- package/docs/api/functions/sanitizeFilename.md +1 -1
- package/docs/api/functions/sanitizeFilepath.md +1 -1
- package/docs/api/functions/saveConfigFile.md +1 -1
- package/docs/api/functions/scaleStrToParamsSize.md +1 -1
- package/docs/api/functions/shutdown.md +2 -2
- package/docs/api/functions/simplifyObjectArguments.md +4 -1
- package/docs/api/functions/simplifyResult.md +34 -0
- package/docs/api/functions/sleep.md +1 -1
- package/docs/api/functions/sortedValues.md +1 -1
- package/docs/api/functions/splitChunks.md +1 -1
- package/docs/api/functions/splitParagraph.md +1 -1
- package/docs/api/functions/splitSentence.md +1 -1
- package/docs/api/functions/splitWords.md +1 -1
- package/docs/api/functions/stringifyYaml.md +1 -1
- package/docs/api/functions/stripConsoleColor.md +1 -1
- package/docs/api/functions/textToDate.md +1 -1
- package/docs/api/functions/textify.md +43 -0
- package/docs/api/functions/toDateTime.md +3 -3
- package/docs/api/functions/toRegExp.md +1 -1
- package/docs/api/functions/trimStartOfStreamHelper.md +1 -1
- package/docs/api/functions/truncTo.md +1 -1
- package/docs/api/functions/truncateByToken.md +1 -1
- package/docs/api/functions/truncateToTokenLimit.md +1 -1
- package/docs/api/functions/truncateToTokenLimitEx.md +1 -1
- package/docs/api/functions/uuid.md +1 -1
- package/docs/api/functions/wrapEventEmitter.md +1 -1
- package/docs/api/functions/wrapFlagValue.md +29 -0
- package/docs/api/functions/xxhash.md +27 -6
- package/docs/api/functions/xxhash32.md +22 -4
- package/docs/api/functions/xxhash64.md +22 -4
- package/docs/api/functions/xxhashAsStr.md +27 -6
- package/docs/api/functions/yieldExec.md +1 -1
- package/docs/api/globals.md +51 -18
- package/docs/api/interfaces/AIChatAssistantMessageParam.md +14 -14
- package/docs/api/interfaces/AIChatContentPartBase.md +26 -0
- package/docs/api/interfaces/AIChatContentPartImage.md +15 -3
- package/docs/api/interfaces/AIChatContentPartText.md +15 -3
- package/docs/api/interfaces/AIChatMessageParamBase.md +9 -9
- package/docs/api/interfaces/AIChatMessageToolCall.md +12 -8
- package/docs/api/interfaces/AIChatSystemMessageParam.md +10 -10
- package/docs/api/interfaces/AIChatToolChoiceFuncObject.md +3 -3
- package/docs/api/interfaces/AIChatToolChoiceObject.md +2 -2
- package/docs/api/interfaces/AIChatToolDefinition.md +45 -0
- package/docs/api/interfaces/AIChatToolFunc.md +5 -5
- package/docs/api/interfaces/AIChatToolFuncParam.md +3 -3
- package/docs/api/interfaces/AIChatToolMessageParam.md +13 -13
- package/docs/api/interfaces/AIChatToolParam.md +2 -2
- package/docs/api/interfaces/AIChatToolTypeObject.md +2 -2
- package/docs/api/interfaces/AIChatUserMessageParam.md +14 -14
- package/docs/api/interfaces/AIResult.md +7 -7
- package/docs/api/interfaces/AIStreamParser.md +2 -2
- package/docs/api/interfaces/AIStreamParserOptions.md +2 -2
- package/docs/api/interfaces/BaseFunc.md +15 -15
- package/docs/api/interfaces/BaseFuncItem.md +16 -16
- package/docs/api/interfaces/BinarySemaphoreAcquireOptions.md +9 -2
- package/docs/api/interfaces/BinarySemaphoreOptions.md +22 -5
- package/docs/api/interfaces/BinarySemaphoreReleaseOptions.md +7 -5
- package/docs/api/interfaces/CancelableAbilityOptions.md +4 -4
- package/docs/api/interfaces/ClientFuncItem.md +70 -19
- package/docs/api/interfaces/CmdArgAIChoiceConfig.md +97 -0
- package/docs/api/interfaces/CmdArgArgsInfo.md +31 -0
- package/docs/api/interfaces/CmdArgContext.md +103 -0
- package/docs/api/interfaces/CmdArgFlagMetadata.md +21 -0
- package/docs/api/interfaces/CmdArgMapResult.md +41 -0
- package/docs/api/interfaces/CmdArgParseResult.md +51 -0
- package/docs/api/interfaces/CmdArgParsedCommand.md +41 -0
- package/docs/api/interfaces/CmdArgParserOptions.md +225 -0
- package/docs/api/interfaces/CmdArgProcessorResultOptions.md +22 -0
- package/docs/api/interfaces/CmdArgSimplifyOptions.md +101 -0
- package/docs/api/interfaces/CmdArgToken.md +51 -0
- package/docs/api/interfaces/EventClientFuncParams.md +5 -5
- package/docs/api/interfaces/EventServerFuncParams.md +21 -7
- package/docs/api/interfaces/FewShotPromptTemplateOptions.md +18 -6
- package/docs/api/interfaces/FuncItem.md +19 -15
- package/docs/api/interfaces/FuncParam.md +5 -5
- package/docs/api/interfaces/FuncParams.md +1 -1
- package/docs/api/interfaces/Funcs.md +1 -1
- package/docs/api/interfaces/HashAlgoParams.md +36 -5
- package/docs/api/interfaces/IClientToolTransport.md +24 -10
- package/docs/api/interfaces/IFileMetaInfo.md +8 -8
- package/docs/api/interfaces/IPubSubClientTransport.md +4 -4
- package/docs/api/interfaces/IPubSubServerTransport.md +14 -14
- package/docs/api/interfaces/IReadTextFileChunksOptions.md +11 -11
- package/docs/api/interfaces/IServerToolTransport.md +8 -8
- package/docs/api/interfaces/IToolTransport.md +5 -5
- package/docs/api/interfaces/ITruncateToTokenLimitOptions.md +10 -10
- package/docs/api/interfaces/JsonFilter.md +1 -1
- package/docs/api/interfaces/MailboxClientOptions.md +74 -0
- package/docs/api/interfaces/MailboxServerOptions.md +69 -0
- package/docs/api/interfaces/ProbabilityItem.md +4 -4
- package/docs/api/interfaces/PromptExampleSelectorOptions.md +3 -3
- package/docs/api/interfaces/PromptTemplateOptions.md +8 -0
- package/docs/api/interfaces/PubSubClientStream.md +11 -11
- package/docs/api/interfaces/PubSubServerSession.md +8 -8
- package/docs/api/interfaces/RegisterOptions.md +298 -0
- package/docs/api/interfaces/RemoteFuncItem.md +63 -20
- package/docs/api/interfaces/ReplacePlacehoderOptions.md +5 -5
- package/docs/api/interfaces/ResClientFuncParams.md +3 -3
- package/docs/api/interfaces/ResServerFuncParams.md +20 -6
- package/docs/api/interfaces/RpcMethodsClientFuncParams.md +2 -2
- package/docs/api/interfaces/RpcMethodsServerFuncParams.md +18 -4
- package/docs/api/interfaces/SanitizeFilenameOptions.md +3 -3
- package/docs/api/interfaces/SectionStringOptions.md +3 -3
- package/docs/api/interfaces/SemaphoreOptions.md +30 -7
- package/docs/api/interfaces/SemaphoreTaskItem.md +18 -5
- package/docs/api/interfaces/ServerFuncItem.md +71 -20
- package/docs/api/interfaces/ServerFuncParams.md +14 -4
- package/docs/api/interfaces/SplitSentenceOptions.md +5 -5
- package/docs/api/interfaces/StreamCallbacksAndOptions.md +80 -7
- package/docs/api/interfaces/TaskAbortControllers.md +2 -2
- package/docs/api/interfaces/TaskPromise.md +6 -6
- package/docs/api/interfaces/TextifyInlineOptions.md +51 -0
- package/docs/api/interfaces/TextifyOptions.md +108 -0
- package/docs/api/interfaces/ToolFuncContext.md +73 -0
- package/docs/api/interfaces/ToolFuncPackage.md +4 -4
- package/docs/api/interfaces/ToolFuncRegistryIsolateOptions.md +41 -0
- package/docs/api/interfaces/UnregisterOptions.md +56 -0
- package/docs/api/type-aliases/AIChatContentPart.md +2 -2
- package/docs/api/type-aliases/AIChatMessageParam.md +1 -1
- package/docs/api/type-aliases/AIChatRole.md +2 -2
- package/docs/api/type-aliases/AIChatTemplateCaps.md +239 -0
- package/docs/api/type-aliases/AIChatToolChoiceParam.md +1 -1
- package/docs/api/type-aliases/AIMessageType.md +1 -1
- package/docs/api/type-aliases/AIModelNameRule.md +1 -1
- package/docs/api/type-aliases/AIModelNameRuleFn.md +1 -1
- package/docs/api/type-aliases/AIModelNameRules.md +1 -1
- package/docs/api/type-aliases/AITextGenerationFinishReason.md +1 -1
- package/docs/api/type-aliases/ActionName.md +1 -1
- package/docs/api/type-aliases/ArgProcessor.md +24 -0
- package/docs/api/type-aliases/ArrayMergeWay.md +1 -1
- package/docs/api/type-aliases/AsyncTaskId.md +1 -1
- package/docs/api/type-aliases/BeforeShutdownListener.md +1 -1
- package/docs/api/type-aliases/CmdArgFlagValue.md +14 -0
- package/docs/api/type-aliases/CmdArgFlagsRecord.md +13 -0
- package/docs/api/type-aliases/EventErrorListenerFn.md +1 -1
- package/docs/api/type-aliases/EventListenerFn.md +1 -1
- package/docs/api/type-aliases/FuncParamType.md +1 -1
- package/docs/api/type-aliases/PromptExamples.md +1 -1
- package/docs/api/type-aliases/PubSubClientId.md +1 -1
- package/docs/api/type-aliases/PubSubCtx.md +6 -6
- package/docs/api/type-aliases/RpcMethodHandler.md +1 -1
- package/docs/api/type-aliases/SSEClient.md +5 -5
- package/docs/api/type-aliases/SemaphoreIsReadyFuncType.md +4 -1
- package/docs/api/type-aliases/SimplifiedResultType.md +14 -0
- package/docs/api/type-aliases/StreamCloseStatus.md +16 -0
- package/docs/api/type-aliases/TFunc.md +1 -1
- package/docs/api/type-aliases/TextifyInlineStyleMode.md +16 -0
- package/docs/api/type-aliases/TextifyStringQuoting.md +16 -0
- package/docs/api/type-aliases/UUIDVersions.md +3 -1
- package/docs/api/variables/AIChatRoles.md +2 -2
- package/docs/api/variables/AIMessageTypes.md +1 -1
- package/docs/api/variables/AITextGenerationFinishReasons.md +1 -1
- package/docs/api/variables/ActionNames.md +1 -1
- package/docs/api/variables/ArrayMergeWay.md +1 -1
- package/docs/api/variables/ArrayMergeWaySymbol.md +1 -1
- package/docs/api/variables/CMD_ARG_FLAG_SYMBOL.md +21 -0
- package/docs/api/variables/CMD_ARG_PROCESSOR_RESULT.md +22 -0
- package/docs/api/variables/CMD_ARG_UNRESOLVED_SYMBOL.md +16 -0
- package/docs/api/variables/ClientEventPrefix.md +2 -2
- package/docs/api/variables/ClientToolFuncSchema.md +27 -17
- package/docs/api/variables/DEFAULT_CONFIG_NAME.md +1 -1
- package/docs/api/variables/DefaultAsyncSemaphoreCapacity.md +4 -1
- package/docs/api/variables/EventBusName.md +2 -2
- package/docs/api/variables/EventName.md +2 -2
- package/docs/api/variables/FilenameReservedRegex.md +1 -1
- package/docs/api/variables/FuncMetaSymbol.md +2 -2
- package/docs/api/variables/IDENTIFIER_REGEX.md +14 -0
- package/docs/api/variables/LLM_TOKENIZER_NAMES.md +1 -1
- package/docs/api/variables/LLM_TOKENIZER_NAMES_MAP.md +1 -1
- package/docs/api/variables/PASSING_SCORE.md +1 -1
- package/docs/api/variables/PATH_IDENTIFIER_REGEX.md +13 -0
- package/docs/api/variables/RESERVED_WORDS.md +13 -0
- package/docs/api/variables/RStreamErrCode.md +1 -1
- package/docs/api/variables/RemoteToolFuncSchema.md +36 -4
- package/docs/api/variables/ResponseRStreamErrCode.md +1 -1
- package/docs/api/variables/RpcMethodsClientToolSchema.md +2 -2
- package/docs/api/variables/RpcMethodsServerToolSchema.md +2 -2
- package/docs/api/variables/SHUTDOWN_SIGNALS.md +1 -1
- package/docs/api/variables/SSEChannelAlreadyClosedErrCode.md +1 -1
- package/docs/api/variables/SecondaryCache.md +1 -1
- package/docs/api/variables/ServerToolFuncSchema.md +27 -17
- package/docs/api/variables/StrangeHumanName.md +1 -1
- package/docs/api/variables/ToolAsyncCancelableBit.md +1 -1
- package/docs/api/variables/ToolAsyncMultiTaskBit.md +1 -1
- package/docs/api/variables/ToolAsyncPriorityBit.md +1 -1
- package/docs/api/variables/ToolFuncSchema.md +13 -13
- package/docs/api/variables/WindowsReservedNameRegex.md +1 -1
- package/docs/api/variables/backendEventable.md +23 -3
- package/docs/api/variables/base32768.md +2 -2
- package/docs/api/variables/event.md +1 -1
- package/docs/api/variables/eventClient.md +1 -1
- package/docs/api/variables/eventServer.md +1 -1
- package/docs/api/variables/lrucache.md +1 -1
- package/docs/api/variables/makeToolFuncCancelable.md +23 -3
- package/docs/api/variables/wait.md +1 -1
- package/docs/transport.dev.md +206 -0
- package/package.json +12 -10
- package/dist/chunk-4FKBOPZI.mjs +0 -1
- package/dist/chunk-TGTHY57V.mjs +0 -1
- package/dist/find-port-qS1CZ9c-.d.mts +0 -3
- package/dist/find-port-qS1CZ9c-.d.ts +0 -3
- package/dist/index-BLW3R7VS.d.mts +0 -1826
- package/dist/index-BLW3R7VS.d.ts +0 -1826
- package/docs/api/@isdk/namespaces/uuidv5/README.md +0 -12
- package/docs/api/@isdk/namespaces/uuidv5/variables/DNS.md +0 -11
- package/docs/api/@isdk/namespaces/uuidv5/variables/URL.md +0 -11
- package/docs/api/functions/nanoid.md +0 -45
- package/docs/api/functions/parseObjectArgInfo.md +0 -33
- package/docs/api/functions/parseObjectArgumentInfos.md +0 -29
- package/docs/api/functions/parseObjectArgumentsAsArgInfos.md +0 -46
- package/docs/api/functions/uuidParse.md +0 -21
- package/docs/api/functions/uuidStringify.md +0 -25
- package/docs/api/functions/uuidValidate.md +0 -21
- package/docs/api/functions/uuidVersion.md +0 -21
- package/docs/api/functions/uuidv1.md +0 -61
- package/docs/api/functions/uuidv4.md +0 -61
- package/docs/api/functions/uuidv5.md +0 -69
- package/docs/api/functions/uuidv6.md +0 -61
- package/docs/api/functions/uuidv7.md +0 -61
- package/docs/api/interfaces/AIChoiceConfig.md +0 -65
- package/docs/api/interfaces/BinarySemaphoreReleaserFunc.md +0 -37
- package/docs/api/interfaces/ParseObjectArgumentOptions.md +0 -89
- package/docs/api/variables/uuidNIL.md +0 -11
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/ai-tool](../globals.md) / MailboxServerTransport
|
|
6
|
+
|
|
7
|
+
# Class: MailboxServerTransport
|
|
8
|
+
|
|
9
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:606
|
|
10
|
+
|
|
11
|
+
A server-side transport implementation using @mboxlabs/mailbox.
|
|
12
|
+
|
|
13
|
+
## Extends
|
|
14
|
+
|
|
15
|
+
- [`ServerToolTransport`](ServerToolTransport.md)
|
|
16
|
+
|
|
17
|
+
## Constructors
|
|
18
|
+
|
|
19
|
+
### Constructor
|
|
20
|
+
|
|
21
|
+
> **new MailboxServerTransport**(`options?`): `MailboxServerTransport`
|
|
22
|
+
|
|
23
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:618
|
|
24
|
+
|
|
25
|
+
#### Parameters
|
|
26
|
+
|
|
27
|
+
##### options?
|
|
28
|
+
|
|
29
|
+
[`MailboxServerOptions`](../interfaces/MailboxServerOptions.md)
|
|
30
|
+
|
|
31
|
+
#### Returns
|
|
32
|
+
|
|
33
|
+
`MailboxServerTransport`
|
|
34
|
+
|
|
35
|
+
#### Overrides
|
|
36
|
+
|
|
37
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`constructor`](ServerToolTransport.md#constructor)
|
|
38
|
+
|
|
39
|
+
## Properties
|
|
40
|
+
|
|
41
|
+
### apiRoot
|
|
42
|
+
|
|
43
|
+
> **apiRoot**: `string`
|
|
44
|
+
|
|
45
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:442
|
|
46
|
+
|
|
47
|
+
The root endpoint for the remote service.
|
|
48
|
+
For HTTP, this is a URL. For IPC, it could be a channel name.
|
|
49
|
+
|
|
50
|
+
#### Inherited from
|
|
51
|
+
|
|
52
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`apiRoot`](ServerToolTransport.md#apiroot)
|
|
53
|
+
|
|
54
|
+
***
|
|
55
|
+
|
|
56
|
+
### discoveryHandlerInfo
|
|
57
|
+
|
|
58
|
+
> `protected` **discoveryHandlerInfo**: \{ `handler`: () => `any`; `prefix`: `string`; \} \| `null`
|
|
59
|
+
|
|
60
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:609
|
|
61
|
+
|
|
62
|
+
***
|
|
63
|
+
|
|
64
|
+
### isInternalMailbox
|
|
65
|
+
|
|
66
|
+
> `protected` **isInternalMailbox**: `boolean`
|
|
67
|
+
|
|
68
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:617
|
|
69
|
+
|
|
70
|
+
***
|
|
71
|
+
|
|
72
|
+
### isRunning
|
|
73
|
+
|
|
74
|
+
> `protected` **isRunning**: `boolean`
|
|
75
|
+
|
|
76
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:616
|
|
77
|
+
|
|
78
|
+
***
|
|
79
|
+
|
|
80
|
+
### listenAddress?
|
|
81
|
+
|
|
82
|
+
> `protected` `optional` **listenAddress**: `string`
|
|
83
|
+
|
|
84
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:608
|
|
85
|
+
|
|
86
|
+
***
|
|
87
|
+
|
|
88
|
+
### mailbox
|
|
89
|
+
|
|
90
|
+
> `protected` **mailbox**: `Mailbox`
|
|
91
|
+
|
|
92
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:607
|
|
93
|
+
|
|
94
|
+
***
|
|
95
|
+
|
|
96
|
+
### mode
|
|
97
|
+
|
|
98
|
+
> `protected` **mode**: `"push"` \| `"pull"`
|
|
99
|
+
|
|
100
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:614
|
|
101
|
+
|
|
102
|
+
***
|
|
103
|
+
|
|
104
|
+
### options?
|
|
105
|
+
|
|
106
|
+
> `optional` **options**: `any`
|
|
107
|
+
|
|
108
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:444
|
|
109
|
+
|
|
110
|
+
Additional options for the transport start or fetch, passed by mount.
|
|
111
|
+
|
|
112
|
+
#### Inherited from
|
|
113
|
+
|
|
114
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`options`](ServerToolTransport.md#options)
|
|
115
|
+
|
|
116
|
+
***
|
|
117
|
+
|
|
118
|
+
### pullInterval
|
|
119
|
+
|
|
120
|
+
> `protected` **pullInterval**: `number`
|
|
121
|
+
|
|
122
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:615
|
|
123
|
+
|
|
124
|
+
***
|
|
125
|
+
|
|
126
|
+
### subscription
|
|
127
|
+
|
|
128
|
+
> `protected` **subscription**: `any`
|
|
129
|
+
|
|
130
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:613
|
|
131
|
+
|
|
132
|
+
***
|
|
133
|
+
|
|
134
|
+
### Tools
|
|
135
|
+
|
|
136
|
+
> **Tools**: *typeof* [`ServerTools`](ServerTools.md)
|
|
137
|
+
|
|
138
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:443
|
|
139
|
+
|
|
140
|
+
#### Inherited from
|
|
141
|
+
|
|
142
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`Tools`](ServerToolTransport.md#tools)
|
|
143
|
+
|
|
144
|
+
## Methods
|
|
145
|
+
|
|
146
|
+
### \_mount()
|
|
147
|
+
|
|
148
|
+
> **\_mount**(`Tools`, `apiPrefix`, `options?`): `void`
|
|
149
|
+
|
|
150
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:445
|
|
151
|
+
|
|
152
|
+
#### Parameters
|
|
153
|
+
|
|
154
|
+
##### Tools
|
|
155
|
+
|
|
156
|
+
*typeof* [`ServerTools`](ServerTools.md)
|
|
157
|
+
|
|
158
|
+
##### apiPrefix
|
|
159
|
+
|
|
160
|
+
`string`
|
|
161
|
+
|
|
162
|
+
##### options?
|
|
163
|
+
|
|
164
|
+
`any`
|
|
165
|
+
|
|
166
|
+
#### Returns
|
|
167
|
+
|
|
168
|
+
`void`
|
|
169
|
+
|
|
170
|
+
#### Inherited from
|
|
171
|
+
|
|
172
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`_mount`](ServerToolTransport.md#_mount)
|
|
173
|
+
|
|
174
|
+
***
|
|
175
|
+
|
|
176
|
+
### \_start()
|
|
177
|
+
|
|
178
|
+
> **\_start**(`options?`): `Promise`\<`void`\>
|
|
179
|
+
|
|
180
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:622
|
|
181
|
+
|
|
182
|
+
#### Parameters
|
|
183
|
+
|
|
184
|
+
##### options?
|
|
185
|
+
|
|
186
|
+
`any`
|
|
187
|
+
|
|
188
|
+
#### Returns
|
|
189
|
+
|
|
190
|
+
`Promise`\<`void`\>
|
|
191
|
+
|
|
192
|
+
#### Overrides
|
|
193
|
+
|
|
194
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`_start`](ServerToolTransport.md#_start)
|
|
195
|
+
|
|
196
|
+
***
|
|
197
|
+
|
|
198
|
+
### addDiscoveryHandler()
|
|
199
|
+
|
|
200
|
+
> **addDiscoveryHandler**(`apiPrefix`, `handler`): `void`
|
|
201
|
+
|
|
202
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:619
|
|
203
|
+
|
|
204
|
+
#### Parameters
|
|
205
|
+
|
|
206
|
+
##### apiPrefix
|
|
207
|
+
|
|
208
|
+
`string`
|
|
209
|
+
|
|
210
|
+
##### handler
|
|
211
|
+
|
|
212
|
+
() => `any`
|
|
213
|
+
|
|
214
|
+
#### Returns
|
|
215
|
+
|
|
216
|
+
`void`
|
|
217
|
+
|
|
218
|
+
#### Overrides
|
|
219
|
+
|
|
220
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`addDiscoveryHandler`](ServerToolTransport.md#adddiscoveryhandler)
|
|
221
|
+
|
|
222
|
+
***
|
|
223
|
+
|
|
224
|
+
### addRpcHandler()
|
|
225
|
+
|
|
226
|
+
> **addRpcHandler**(`serverTools`, `apiPrefix`, `options?`): `void`
|
|
227
|
+
|
|
228
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:620
|
|
229
|
+
|
|
230
|
+
#### Parameters
|
|
231
|
+
|
|
232
|
+
##### serverTools
|
|
233
|
+
|
|
234
|
+
*typeof* [`ServerTools`](ServerTools.md)
|
|
235
|
+
|
|
236
|
+
##### apiPrefix
|
|
237
|
+
|
|
238
|
+
`string`
|
|
239
|
+
|
|
240
|
+
##### options?
|
|
241
|
+
|
|
242
|
+
`any`
|
|
243
|
+
|
|
244
|
+
#### Returns
|
|
245
|
+
|
|
246
|
+
`void`
|
|
247
|
+
|
|
248
|
+
#### Overrides
|
|
249
|
+
|
|
250
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`addRpcHandler`](ServerToolTransport.md#addrpchandler)
|
|
251
|
+
|
|
252
|
+
***
|
|
253
|
+
|
|
254
|
+
### drainBacklog()
|
|
255
|
+
|
|
256
|
+
> `protected` **drainBacklog**(`address`): `Promise`\<`void`\>
|
|
257
|
+
|
|
258
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:623
|
|
259
|
+
|
|
260
|
+
#### Parameters
|
|
261
|
+
|
|
262
|
+
##### address
|
|
263
|
+
|
|
264
|
+
`string`
|
|
265
|
+
|
|
266
|
+
#### Returns
|
|
267
|
+
|
|
268
|
+
`Promise`\<`void`\>
|
|
269
|
+
|
|
270
|
+
***
|
|
271
|
+
|
|
272
|
+
### getRaw()
|
|
273
|
+
|
|
274
|
+
> **getRaw**(): `Mailbox`
|
|
275
|
+
|
|
276
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:626
|
|
277
|
+
|
|
278
|
+
Gets the underlying raw server instance.
|
|
279
|
+
|
|
280
|
+
#### Returns
|
|
281
|
+
|
|
282
|
+
`Mailbox`
|
|
283
|
+
|
|
284
|
+
#### Overrides
|
|
285
|
+
|
|
286
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`getRaw`](ServerToolTransport.md#getraw)
|
|
287
|
+
|
|
288
|
+
***
|
|
289
|
+
|
|
290
|
+
### mount()
|
|
291
|
+
|
|
292
|
+
> **mount**(`Tools`, `apiRoot?`, `options?`): `any`
|
|
293
|
+
|
|
294
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:140
|
|
295
|
+
|
|
296
|
+
Mounts the ServerTools registry, creating the necessary API routes.
|
|
297
|
+
|
|
298
|
+
This method is responsible for integrating the tool-handling logic with a
|
|
299
|
+
running server instance.
|
|
300
|
+
|
|
301
|
+
#### Parameters
|
|
302
|
+
|
|
303
|
+
##### Tools
|
|
304
|
+
|
|
305
|
+
*typeof* [`ToolFunc`](ToolFunc.md)
|
|
306
|
+
|
|
307
|
+
The ServerTools class containing the tool definitions.
|
|
308
|
+
|
|
309
|
+
##### apiRoot?
|
|
310
|
+
|
|
311
|
+
`string`
|
|
312
|
+
|
|
313
|
+
An optional prefix for all API routes (e.g., '/api').
|
|
314
|
+
|
|
315
|
+
##### options?
|
|
316
|
+
|
|
317
|
+
`any`
|
|
318
|
+
|
|
319
|
+
A container for transport-specific options. For example,
|
|
320
|
+
an HTTP-based transport would expect an `{ server: http.Server }` object
|
|
321
|
+
to attach its route handlers to.
|
|
322
|
+
|
|
323
|
+
#### Returns
|
|
324
|
+
|
|
325
|
+
`any`
|
|
326
|
+
|
|
327
|
+
#### Inherited from
|
|
328
|
+
|
|
329
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`mount`](ServerToolTransport.md#mount)
|
|
330
|
+
|
|
331
|
+
***
|
|
332
|
+
|
|
333
|
+
### onReceive()
|
|
334
|
+
|
|
335
|
+
> `protected` **onReceive**(`message`): `Promise`\<`void`\>
|
|
336
|
+
|
|
337
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:621
|
|
338
|
+
|
|
339
|
+
#### Parameters
|
|
340
|
+
|
|
341
|
+
##### message
|
|
342
|
+
|
|
343
|
+
`MailMessage`
|
|
344
|
+
|
|
345
|
+
#### Returns
|
|
346
|
+
|
|
347
|
+
`Promise`\<`void`\>
|
|
348
|
+
|
|
349
|
+
***
|
|
350
|
+
|
|
351
|
+
### runPullLoop()
|
|
352
|
+
|
|
353
|
+
> `protected` **runPullLoop**(`address`): `Promise`\<`void`\>
|
|
354
|
+
|
|
355
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:624
|
|
356
|
+
|
|
357
|
+
#### Parameters
|
|
358
|
+
|
|
359
|
+
##### address
|
|
360
|
+
|
|
361
|
+
`string`
|
|
362
|
+
|
|
363
|
+
#### Returns
|
|
364
|
+
|
|
365
|
+
`Promise`\<`void`\>
|
|
366
|
+
|
|
367
|
+
***
|
|
368
|
+
|
|
369
|
+
### setApiRoot()
|
|
370
|
+
|
|
371
|
+
> **setApiRoot**(`apiRoot`): `void`
|
|
372
|
+
|
|
373
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:139
|
|
374
|
+
|
|
375
|
+
#### Parameters
|
|
376
|
+
|
|
377
|
+
##### apiRoot
|
|
378
|
+
|
|
379
|
+
`string`
|
|
380
|
+
|
|
381
|
+
#### Returns
|
|
382
|
+
|
|
383
|
+
`void`
|
|
384
|
+
|
|
385
|
+
#### Inherited from
|
|
386
|
+
|
|
387
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`setApiRoot`](ServerToolTransport.md#setapiroot)
|
|
388
|
+
|
|
389
|
+
***
|
|
390
|
+
|
|
391
|
+
### start()
|
|
392
|
+
|
|
393
|
+
> **start**(`options?`): `Promise`\<`any`\>
|
|
394
|
+
|
|
395
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:446
|
|
396
|
+
|
|
397
|
+
Starts the transport layer, making it listen for incoming connections.
|
|
398
|
+
|
|
399
|
+
#### Parameters
|
|
400
|
+
|
|
401
|
+
##### options?
|
|
402
|
+
|
|
403
|
+
`any`
|
|
404
|
+
|
|
405
|
+
Protocol-specific options (e.g., { port, host }).
|
|
406
|
+
|
|
407
|
+
#### Returns
|
|
408
|
+
|
|
409
|
+
`Promise`\<`any`\>
|
|
410
|
+
|
|
411
|
+
#### Inherited from
|
|
412
|
+
|
|
413
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`start`](ServerToolTransport.md#start)
|
|
414
|
+
|
|
415
|
+
***
|
|
416
|
+
|
|
417
|
+
### stop()
|
|
418
|
+
|
|
419
|
+
> **stop**(): `Promise`\<`void`\>
|
|
420
|
+
|
|
421
|
+
Defined in: @isdk/ai-tools/packages/tool-rpc/dist/index-359784IS.d.ts:625
|
|
422
|
+
|
|
423
|
+
Stops the server instance gracefully.
|
|
424
|
+
|
|
425
|
+
#### Returns
|
|
426
|
+
|
|
427
|
+
`Promise`\<`void`\>
|
|
428
|
+
|
|
429
|
+
Promise<void> when server is fully stopped
|
|
430
|
+
|
|
431
|
+
#### Overrides
|
|
432
|
+
|
|
433
|
+
[`ServerToolTransport`](ServerToolTransport.md).[`stop`](ServerToolTransport.md#stop)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: PromptExampleSelector\<T\>
|
|
8
8
|
|
|
9
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:46](https://github.com/isdk/ai-tool.js/blob/
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:46](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/prompt-example-selector.ts#L46)
|
|
10
10
|
|
|
11
11
|
The `PromptExampleSelector` class provides a mechanism to selectively choose examples from a given set based on
|
|
12
12
|
configurable options such as maximum length and probability threshold. This class is meant to be extended and customized
|
|
@@ -48,7 +48,7 @@ The type of the prompt examples.
|
|
|
48
48
|
|
|
49
49
|
> **new PromptExampleSelector**\<`T`\>(`examples`, `options?`): `PromptExampleSelector`\<`T`\>
|
|
50
50
|
|
|
51
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:62](https://github.com/isdk/ai-tool.js/blob/
|
|
51
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:62](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/prompt-example-selector.ts#L62)
|
|
52
52
|
|
|
53
53
|
Constructs a new `PromptExampleSelector` instance with the given examples and options.
|
|
54
54
|
|
|
@@ -76,7 +76,7 @@ An optional configuration object.
|
|
|
76
76
|
|
|
77
77
|
> **examples**: [`PromptExamples`](../type-aliases/PromptExamples.md)\<`T`\>
|
|
78
78
|
|
|
79
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:55](https://github.com/isdk/ai-tool.js/blob/
|
|
79
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:55](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/prompt-example-selector.ts#L55)
|
|
80
80
|
|
|
81
81
|
The collection of prompt examples.
|
|
82
82
|
|
|
@@ -84,17 +84,17 @@ The collection of prompt examples.
|
|
|
84
84
|
|
|
85
85
|
### maxLength
|
|
86
86
|
|
|
87
|
-
> **maxLength**: `
|
|
87
|
+
> **maxLength**: `number` \| `undefined`
|
|
88
88
|
|
|
89
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:47](https://github.com/isdk/ai-tool.js/blob/
|
|
89
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:47](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/prompt-example-selector.ts#L47)
|
|
90
90
|
|
|
91
91
|
***
|
|
92
92
|
|
|
93
93
|
### threshold
|
|
94
94
|
|
|
95
|
-
> **threshold**: `
|
|
95
|
+
> **threshold**: `number` \| `undefined`
|
|
96
96
|
|
|
97
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:51](https://github.com/isdk/ai-tool.js/blob/
|
|
97
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:51](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/prompt-example-selector.ts#L51)
|
|
98
98
|
|
|
99
99
|
The probability threshold (0-1) for selecting an example. If `undefined`, no filtering by probability occurs.
|
|
100
100
|
|
|
@@ -104,7 +104,7 @@ The probability threshold (0-1) for selecting an example. If `undefined`, no fil
|
|
|
104
104
|
|
|
105
105
|
> **\[asyncIterator\]**(): `AsyncGenerator`\<`Awaited`\<`T`\>, `void`, `unknown`\>
|
|
106
106
|
|
|
107
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:119](https://github.com/isdk/ai-tool.js/blob/
|
|
107
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:119](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/prompt-example-selector.ts#L119)
|
|
108
108
|
|
|
109
109
|
Returns an asynchronous iterator for the selected examples.
|
|
110
110
|
|
|
@@ -120,7 +120,7 @@ An asynchronous iterator over the selected examples.
|
|
|
120
120
|
|
|
121
121
|
> **initialize**(`examples`, `options?`): `void`
|
|
122
122
|
|
|
123
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:71](https://github.com/isdk/ai-tool.js/blob/
|
|
123
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:71](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/prompt-example-selector.ts#L71)
|
|
124
124
|
|
|
125
125
|
Initializes the selector with examples and options.
|
|
126
126
|
|
|
@@ -148,7 +148,7 @@ An optional configuration object.
|
|
|
148
148
|
|
|
149
149
|
> **selectExample**(`example`, `threshold?`): `void` \| `T`
|
|
150
150
|
|
|
151
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:92](https://github.com/isdk/ai-tool.js/blob/
|
|
151
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:92](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/prompt-example-selector.ts#L92)
|
|
152
152
|
|
|
153
153
|
Select an example. Can overwrite this in subclasses.
|
|
154
154
|
|
|
@@ -178,7 +178,7 @@ The selected example, or `undefined` if not selected.
|
|
|
178
178
|
|
|
179
179
|
> **selectExamples**(`examples`): `AsyncGenerator`\<`Awaited`\<`T`\>, `void`, `unknown`\>
|
|
180
180
|
|
|
181
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:103](https://github.com/isdk/ai-tool.js/blob/
|
|
181
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/prompt-example-selector.ts:103](https://github.com/isdk/ai-tool.js/blob/d10fb4cda65fc1975152a2c3ab327ecab008dea1/src/utils/prompt/prompt-example-selector.ts#L103)
|
|
182
182
|
|
|
183
183
|
Asynchronously selects examples from the given examples, applying the configured threshold (if any).
|
|
184
184
|
|