@isdk/ai-tool 0.7.0 → 0.8.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-4FKBOPZI.mjs +1 -0
- package/dist/{chunk-VIG2GB47.mjs → chunk-TGTHY57V.mjs} +1 -1
- package/dist/funcs.d.mts +1 -2
- package/dist/funcs.d.ts +1 -2
- package/dist/funcs.js +1 -1
- package/dist/funcs.mjs +1 -1
- package/dist/{index-BCco-g_I.d.mts → index-BLW3R7VS.d.mts} +114 -69
- package/dist/{index-BCco-g_I.d.ts → index-BLW3R7VS.d.ts} +114 -69
- package/dist/index.d.mts +101 -38
- package/dist/index.d.ts +101 -38
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/test/util.js +1 -1
- package/dist/test/util.mjs +1 -1
- package/docs/api/{namespaces → @isdk/namespaces}/EventStates/README.md +2 -2
- package/docs/api/{namespaces → @isdk/namespaces}/EventStates/variables/ABORT.md +2 -2
- package/docs/api/{namespaces → @isdk/namespaces}/EventStates/variables/CONTINUE.md +2 -2
- package/docs/api/{namespaces → @isdk/namespaces}/EventStates/variables/DONE.md +2 -2
- package/docs/api/{namespaces → @isdk/namespaces}/EventStates/variables/STOPPED.md +2 -2
- package/docs/api/@isdk/namespaces/uuidv5/README.md +12 -0
- package/docs/api/{namespaces → @isdk/namespaces}/uuidv5/variables/DNS.md +2 -2
- package/docs/api/{namespaces → @isdk/namespaces}/uuidv5/variables/URL.md +2 -2
- package/docs/api/_media/pubsub.md +427 -105
- package/docs/api/_media/server_client_tools.md +5 -3
- package/docs/api/_media/toolFunc.md +3 -1
- package/docs/api/classes/AbortError.md +8 -8
- package/docs/api/classes/AlreadyExistsError.md +8 -8
- package/docs/api/classes/BaseError.md +14 -14
- package/docs/api/classes/BinarySemaphore.md +39 -39
- package/docs/api/classes/CancelableAbility.md +43 -39
- package/docs/api/classes/ClientToolTransport.md +22 -22
- package/docs/api/classes/ClientTools.md +182 -154
- package/docs/api/classes/CommonError.md +12 -12
- package/docs/api/classes/ConfigFile.md +6 -6
- package/docs/api/classes/EnvPromptTemplate.md +14 -14
- package/docs/api/classes/EventClient.md +258 -201
- package/docs/api/classes/EventEmitter.md +14 -14
- package/docs/api/classes/EventServer.md +220 -237
- package/docs/api/classes/EventToolFunc.md +144 -116
- package/docs/api/classes/FStringPromptTemplate.md +14 -14
- package/docs/api/classes/FewShotPromptTemplate.md +30 -26
- package/docs/api/classes/GolangPromptTemplate.md +13 -13
- package/docs/api/classes/HttpClientToolTransport.md +23 -23
- package/docs/api/classes/HttpServerToolTransport.md +40 -27
- package/docs/api/classes/IntSet.md +21 -21
- package/docs/api/classes/LRUCache.md +18 -18
- package/docs/api/classes/NotFoundError.md +8 -8
- package/docs/api/classes/NotImplementationError.md +8 -8
- package/docs/api/classes/PromptExampleSelector.md +17 -15
- package/docs/api/classes/PromptTemplate.md +15 -15
- package/docs/api/classes/ReadableStreamError.md +12 -12
- package/docs/api/classes/ResClientTools.md +658 -143
- package/docs/api/classes/ResServerTools.md +643 -133
- package/docs/api/classes/RpcMethodsClientTool.md +3303 -0
- package/docs/api/classes/RpcMethodsServerTool.md +3248 -0
- package/docs/api/classes/SSEChannel.md +142 -52
- package/docs/api/classes/Semaphore.md +40 -40
- package/docs/api/classes/ServerToolTransport.md +32 -27
- package/docs/api/classes/ServerTools.md +167 -139
- package/docs/api/classes/SignalGate.md +19 -17
- package/docs/api/classes/SseClientPubSubTransport.md +38 -10
- package/docs/api/classes/SseServerPubSubTransport.md +115 -42
- package/docs/api/classes/TaskAbortController.md +13 -13
- package/docs/api/classes/ToolFunc.md +157 -129
- package/docs/api/classes/ToolTransport.md +13 -13
- package/docs/api/classes/YamlTypeBaseObject.md +5 -5
- package/docs/api/enumerations/AsyncFeatureBits.md +4 -4
- package/docs/api/enumerations/AsyncFeatures.md +4 -4
- package/docs/api/enumerations/HashAlgorithm.md +12 -12
- package/docs/api/functions/AIArgProcessor.md +2 -2
- package/docs/api/functions/AIStream.md +8 -4
- package/docs/api/functions/ChoiceArgProcessor.md +2 -2
- package/docs/api/functions/DefaultDateFormat.md +2 -2
- package/docs/api/functions/ObjectArgsToArgsInfo.md +1 -1
- package/docs/api/functions/RateLimit.md +2 -2
- package/docs/api/functions/TemplateArgProcessor.md +2 -2
- package/docs/api/functions/addDate.md +7 -3
- package/docs/api/functions/assignDirs.md +1 -1
- package/docs/api/functions/beforeShutdown.md +1 -1
- package/docs/api/functions/calcPerplexity.md +2 -2
- package/docs/api/functions/calcPerplexitySimple.md +1 -1
- package/docs/api/functions/canonicalize.md +1 -1
- 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/createAbilityInjector.md +16 -8
- package/docs/api/functions/createCallbacksTransformer.md +7 -3
- package/docs/api/functions/createEmptyReadableStream.md +1 -1
- package/docs/api/functions/createEndWithRepetitionDetector.md +2 -2
- package/docs/api/functions/createError.md +1 -1
- package/docs/api/functions/createEventStreamTransformer.md +8 -4
- package/docs/api/functions/createHfValueFunc.md +1 -1
- package/docs/api/functions/createLRUCache.md +2 -2
- package/docs/api/functions/createYamlObjectTag.md +1 -1
- package/docs/api/functions/dateToText.md +1 -1
- package/docs/api/functions/decodeCharset.md +2 -2
- package/docs/api/functions/defaultsWithConcat.md +1 -1
- package/docs/api/functions/detectCharset.md +2 -2
- package/docs/api/functions/encodeLLMTokens.md +1 -1
- package/docs/api/functions/ensureQuoted.md +1 -1
- package/docs/api/functions/eventable.md +6 -8
- package/docs/api/functions/expandConfig.md +2 -2
- package/docs/api/functions/expandObjEnv.md +1 -1
- package/docs/api/functions/expandPath.md +2 -2
- package/docs/api/functions/expandPathInObject.md +2 -2
- package/docs/api/functions/expandPaths.md +2 -2
- package/docs/api/functions/fileIsExists.md +1 -1
- package/docs/api/functions/filterValidFnScope.md +2 -2
- package/docs/api/functions/findIndexNonEmptyFrom.md +1 -1
- package/docs/api/functions/findPort.md +1 -1
- package/docs/api/functions/formatISO.md +1 -1
- package/docs/api/functions/formatTextWithSpace.md +2 -2
- package/docs/api/functions/funcGetMeta.md +1 -1
- package/docs/api/functions/funcWithMeta.md +2 -2
- package/docs/api/functions/genUrlParamsStr.md +8 -2
- package/docs/api/functions/getAllEnumKeys.md +4 -2
- package/docs/api/functions/getConfigFileNames.md +2 -2
- package/docs/api/functions/getConfigs.md +2 -2
- package/docs/api/functions/getFileMetaInfo.md +1 -1
- package/docs/api/functions/getHashAlgoBySize.md +1 -1
- package/docs/api/functions/getKeysPath.md +4 -2
- 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 +2 -2
- package/docs/api/functions/hash.md +1 -1
- package/docs/api/functions/hashFile.md +2 -2
- package/docs/api/functions/hashObject.md +2 -2
- package/docs/api/functions/hashStream.md +1 -1
- package/docs/api/functions/initShutdown.md +1 -1
- package/docs/api/functions/isLangUsingSpaces.md +1 -1
- package/docs/api/functions/isListItemString.md +1 -1
- package/docs/api/functions/isModelNameMatched.md +2 -2
- package/docs/api/functions/isPunctuationChar.md +1 -1
- package/docs/api/functions/isQuoted.md +1 -1
- package/docs/api/functions/isRegExp.md +1 -1
- package/docs/api/functions/isSameString.md +1 -1
- package/docs/api/functions/isSectionString.md +2 -2
- package/docs/api/functions/isSentenceEnding.md +1 -1
- package/docs/api/functions/isSepLineString.md +1 -1
- package/docs/api/functions/isStrWrapped.md +1 -1
- package/docs/api/functions/isSubdirectory.md +1 -1
- package/docs/api/functions/isTitleString.md +2 -2
- package/docs/api/functions/isWebStream.md +1 -1
- package/docs/api/functions/joinSplitWords.md +1 -1
- package/docs/api/functions/jsonFilterToWhere.md +2 -2
- package/docs/api/functions/jsonToMarkdownStr.md +2 -2
- 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 +2 -2
- package/docs/api/functions/loadTextFromPaths.md +3 -3
- package/docs/api/functions/lrucache.md +1 -1
- package/docs/api/functions/matchUrlProtocol.md +1 -1
- package/docs/api/functions/memoize.md +5 -3
- package/docs/api/functions/mergeArray.md +1 -1
- package/docs/api/functions/messagesToText.md +1 -1
- package/docs/api/functions/nanoid.md +45 -0
- package/docs/api/functions/normalizePath.md +1 -1
- package/docs/api/functions/paramsSizeToScaleStr.md +1 -1
- package/docs/api/functions/parseCommand.md +3 -3
- package/docs/api/functions/parseDateFormat.md +7 -3
- package/docs/api/functions/parseISO.md +7 -3
- package/docs/api/functions/parseJsJson.md +2 -2
- package/docs/api/functions/parseJsJsonSimpleSync.md +2 -2
- package/docs/api/functions/parseObjectArgInfo.md +2 -2
- package/docs/api/functions/parseObjectArgumentInfos.md +2 -2
- package/docs/api/functions/parseObjectArguments.md +2 -2
- package/docs/api/functions/parseObjectArgumentsAsArgInfos.md +2 -2
- package/docs/api/functions/parseYaml.md +1 -1
- package/docs/api/functions/pruneSubdirectories.md +1 -1
- package/docs/api/functions/pruneSubdirectoriesInPlace.md +1 -1
- package/docs/api/functions/quoteStr.md +1 -1
- package/docs/api/functions/readFilenamesRecursiveSync.md +2 -2
- package/docs/api/functions/readTextFileChunks.md +2 -2
- package/docs/api/functions/readTextFileChunksEx.md +2 -2
- package/docs/api/functions/readableFromAsyncIterable.md +4 -2
- package/docs/api/functions/registerCoreTools.md +1 -1
- package/docs/api/functions/removeMarkdownBold.md +2 -2
- package/docs/api/functions/removeMarkdownBoldAndItalic.md +2 -2
- package/docs/api/functions/removeMarkdownItalic.md +2 -2
- package/docs/api/functions/replaceWithPlaceholder.md +2 -2
- package/docs/api/functions/restoreFromPlacehoders.md +2 -2
- 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 +1 -1
- package/docs/api/functions/simplifyObjectArguments.md +1 -1
- package/docs/api/functions/sleep.md +1 -1
- package/docs/api/functions/sortedValues.md +4 -2
- package/docs/api/functions/splitChunks.md +2 -2
- package/docs/api/functions/splitParagraph.md +2 -2
- 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/throwError.md +1 -1
- package/docs/api/functions/toDate.md +7 -3
- package/docs/api/functions/toDateTime.md +1 -1
- package/docs/api/functions/trimStartOfStreamHelper.md +3 -3
- package/docs/api/functions/truncTo.md +1 -1
- package/docs/api/functions/truncateByToken.md +2 -2
- package/docs/api/functions/truncateToTokenLimit.md +2 -2
- package/docs/api/functions/truncateToTokenLimitEx.md +2 -2
- package/docs/api/functions/uuid.md +15 -6
- package/docs/api/functions/uuidStringify.md +1 -1
- package/docs/api/functions/uuidv1.md +5 -3
- package/docs/api/functions/uuidv4.md +5 -3
- package/docs/api/functions/uuidv5.md +5 -3
- package/docs/api/functions/uuidv6.md +61 -0
- package/docs/api/functions/uuidv7.md +61 -0
- package/docs/api/functions/wrapEventEmitter.md +1 -1
- package/docs/api/functions/xxhash.md +1 -1
- package/docs/api/functions/xxhash32.md +1 -1
- package/docs/api/functions/xxhash64.md +1 -1
- package/docs/api/functions/xxhashAsStr.md +1 -1
- package/docs/api/functions/yieldExec.md +1 -1
- package/docs/api/globals.md +17 -6
- package/docs/api/interfaces/AIChatAssistantMessageParam.md +12 -12
- package/docs/api/interfaces/AIChatContentPartImage.md +3 -3
- package/docs/api/interfaces/AIChatContentPartText.md +3 -3
- package/docs/api/interfaces/AIChatMessageParamBase.md +7 -7
- package/docs/api/interfaces/AIChatMessageToolCall.md +4 -4
- package/docs/api/interfaces/AIChatSystemMessageParam.md +9 -9
- package/docs/api/interfaces/AIChatToolChoiceFuncObject.md +3 -3
- package/docs/api/interfaces/AIChatToolChoiceObject.md +2 -2
- package/docs/api/interfaces/AIChatToolFunc.md +5 -5
- package/docs/api/interfaces/AIChatToolFuncParam.md +3 -3
- package/docs/api/interfaces/AIChatToolMessageParam.md +10 -10
- package/docs/api/interfaces/AIChatToolParam.md +2 -2
- package/docs/api/interfaces/AIChatToolTypeObject.md +2 -2
- package/docs/api/interfaces/AIChatUserMessageParam.md +13 -13
- package/docs/api/interfaces/AIChoiceConfig.md +8 -8
- package/docs/api/interfaces/AIResult.md +12 -8
- package/docs/api/interfaces/AIStreamParser.md +8 -6
- package/docs/api/interfaces/AIStreamParserOptions.md +2 -2
- package/docs/api/interfaces/BaseFunc.md +17 -17
- package/docs/api/interfaces/BaseFuncItem.md +15 -15
- package/docs/api/interfaces/BinarySemaphoreAcquireOptions.md +2 -2
- package/docs/api/interfaces/BinarySemaphoreOptions.md +5 -5
- package/docs/api/interfaces/BinarySemaphoreReleaseOptions.md +2 -2
- package/docs/api/interfaces/BinarySemaphoreReleaserFunc.md +3 -3
- package/docs/api/interfaces/CancelableAbilityOptions.md +4 -4
- package/docs/api/interfaces/ClientFuncItem.md +21 -25
- package/docs/api/interfaces/EventClientFuncParams.md +5 -5
- package/docs/api/interfaces/EventServerFuncParams.md +14 -6
- package/docs/api/interfaces/FewShotPromptTemplateOptions.md +9 -7
- package/docs/api/interfaces/FuncItem.md +18 -18
- 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 +4 -4
- package/docs/api/interfaces/IClientToolTransport.md +9 -9
- package/docs/api/interfaces/IFileMetaInfo.md +8 -8
- package/docs/api/interfaces/IPubSubClientTransport.md +31 -7
- package/docs/api/interfaces/IPubSubServerTransport.md +92 -47
- package/docs/api/interfaces/IReadTextFileChunksOptions.md +13 -13
- package/docs/api/interfaces/IServerToolTransport.md +19 -14
- package/docs/api/interfaces/IToolTransport.md +6 -6
- package/docs/api/interfaces/ITruncateToTokenLimitOptions.md +11 -11
- package/docs/api/interfaces/JsonFilter.md +1 -1
- package/docs/api/interfaces/ParseObjectArgumentOptions.md +11 -11
- package/docs/api/interfaces/ProbabilityItem.md +4 -4
- package/docs/api/interfaces/PromptExampleSelectorOptions.md +3 -3
- package/docs/api/interfaces/PubSubClientStream.md +26 -14
- package/docs/api/interfaces/PubSubServerSession.md +8 -8
- package/docs/api/interfaces/RemoteFuncItem.md +21 -25
- package/docs/api/interfaces/ReplacePlacehoderOptions.md +5 -5
- package/docs/api/interfaces/ResClientFuncParams.md +5 -5
- package/docs/api/interfaces/ResServerFuncParams.md +14 -10
- package/docs/api/interfaces/RpcMethodsClientFuncParams.md +25 -0
- package/docs/api/interfaces/RpcMethodsServerFuncParams.md +61 -0
- package/docs/api/interfaces/SectionStringOptions.md +3 -3
- package/docs/api/interfaces/SemaphoreOptions.md +7 -7
- package/docs/api/interfaces/SemaphoreTaskItem.md +6 -6
- package/docs/api/interfaces/ServerFuncItem.md +22 -26
- package/docs/api/interfaces/ServerFuncParams.md +4 -3
- package/docs/api/interfaces/SplitSentenceOptions.md +5 -5
- package/docs/api/interfaces/StreamCallbacksAndOptions.md +11 -7
- package/docs/api/interfaces/TaskAbortControllers.md +1 -1
- package/docs/api/interfaces/TaskPromise.md +17 -9
- package/docs/api/interfaces/ToolFuncPackage.md +5 -5
- package/docs/api/type-aliases/AIChatContentPart.md +2 -2
- package/docs/api/type-aliases/AIChatMessageParam.md +2 -2
- package/docs/api/type-aliases/AIChatRole.md +2 -2
- package/docs/api/type-aliases/AIChatToolChoiceParam.md +2 -2
- package/docs/api/type-aliases/AIMessageType.md +2 -2
- package/docs/api/type-aliases/AIModelNameRule.md +2 -2
- package/docs/api/type-aliases/AIModelNameRuleFn.md +2 -2
- package/docs/api/type-aliases/AIModelNameRules.md +2 -2
- package/docs/api/type-aliases/AITextGenerationFinishReason.md +2 -2
- package/docs/api/type-aliases/ActionName.md +2 -2
- package/docs/api/type-aliases/ArrayMergeWay.md +2 -2
- package/docs/api/type-aliases/AsyncTaskId.md +2 -2
- package/docs/api/type-aliases/BeforeShutdownListener.md +2 -2
- package/docs/api/type-aliases/EventErrorListenerFn.md +2 -2
- package/docs/api/type-aliases/EventListenerFn.md +2 -2
- package/docs/api/type-aliases/FuncParamType.md +2 -2
- package/docs/api/type-aliases/PromptExamples.md +5 -3
- package/docs/api/type-aliases/PubSubClientId.md +2 -2
- package/docs/api/type-aliases/PubSubCtx.md +24 -4
- package/docs/api/type-aliases/RpcMethodHandler.md +2 -2
- package/docs/api/type-aliases/SSEClient.md +53 -0
- package/docs/api/type-aliases/SemaphoreIsReadyFuncType.md +2 -2
- package/docs/api/type-aliases/TFunc.md +2 -2
- package/docs/api/type-aliases/UUIDVersions.md +11 -0
- package/docs/api/variables/AIChatRoles.md +1 -1
- 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 +2 -2
- package/docs/api/variables/ArrayMergeWaySymbol.md +2 -2
- package/docs/api/variables/ClientEventPrefix.md +11 -0
- package/docs/api/variables/ClientToolFuncSchema.md +4 -2
- package/docs/api/variables/DEFAULT_CONFIG_NAME.md +1 -1
- package/docs/api/variables/DefaultAsyncSemaphoreCapacity.md +1 -1
- package/docs/api/variables/EventBusName.md +1 -1
- package/docs/api/variables/EventName.md +1 -1
- package/docs/api/variables/FuncMetaSymbol.md +2 -2
- package/docs/api/variables/LLM_TOKENIZER_NAMES.md +4 -4
- package/docs/api/variables/LLM_TOKENIZER_NAMES_MAP.md +1 -1
- package/docs/api/variables/PASSING_SCORE.md +1 -1
- package/docs/api/variables/RStreamErrCode.md +1 -1
- package/docs/api/variables/RemoteToolFuncSchema.md +4 -2
- package/docs/api/variables/ResponseRStreamErrCode.md +1 -1
- package/docs/api/variables/RpcMethodsClientToolSchema.md +51 -0
- package/docs/api/variables/RpcMethodsServerToolSchema.md +21 -0
- 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 +4 -2
- 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 +4 -2
- package/docs/api/variables/backendEventable.md +11 -0
- package/docs/api/variables/base32768.md +1 -1
- 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 +11 -0
- package/docs/api/{functions → variables}/wait.md +16 -14
- package/docs/pubsub.md +427 -105
- package/docs/server_client_tools.md +5 -3
- package/docs/toolFunc.md +3 -1
- package/package.json +10 -9
- package/dist/chunk-LNTIQQNN.mjs +0 -1
- package/docs/api/functions/backendEventable.md +0 -29
- package/docs/api/functions/makeToolFuncCancelable.md +0 -29
- package/docs/api/interfaces/PubSubClient.md +0 -27
- package/docs/api/namespaces/uuidv5/README.md +0 -12
|
@@ -41,9 +41,9 @@ console.log(result); // Output: "Formatted: Hello World"
|
|
|
41
41
|
|
|
42
42
|
## Constructors
|
|
43
43
|
|
|
44
|
-
###
|
|
44
|
+
### Constructor
|
|
45
45
|
|
|
46
|
-
> **new FStringPromptTemplate**(`template
|
|
46
|
+
> **new FStringPromptTemplate**(`template?`, `options?`): `FStringTemplate`
|
|
47
47
|
|
|
48
48
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:187
|
|
49
49
|
|
|
@@ -65,7 +65,7 @@ Additional configuration options for the template.
|
|
|
65
65
|
|
|
66
66
|
#### Returns
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
`FStringTemplate`
|
|
69
69
|
|
|
70
70
|
#### Example
|
|
71
71
|
|
|
@@ -79,7 +79,7 @@ console.log(template instanceof TestStringTemplate); // Output: true
|
|
|
79
79
|
|
|
80
80
|
#### Inherited from
|
|
81
81
|
|
|
82
|
-
[`PromptTemplate`](PromptTemplate.md).[`constructor`](PromptTemplate.md#
|
|
82
|
+
[`PromptTemplate`](PromptTemplate.md).[`constructor`](PromptTemplate.md#constructor)
|
|
83
83
|
|
|
84
84
|
## Properties
|
|
85
85
|
|
|
@@ -135,7 +135,7 @@ Declares the raw template string.
|
|
|
135
135
|
|
|
136
136
|
#### Inherited from
|
|
137
137
|
|
|
138
|
-
[`PromptTemplate`](PromptTemplate.md).[`template`](PromptTemplate.md#template
|
|
138
|
+
[`PromptTemplate`](PromptTemplate.md).[`template`](PromptTemplate.md#template)
|
|
139
139
|
|
|
140
140
|
***
|
|
141
141
|
|
|
@@ -341,7 +341,7 @@ A formatted string or a promise resolving to the formatted string.
|
|
|
341
341
|
|
|
342
342
|
### \_initialize()
|
|
343
343
|
|
|
344
|
-
> **\_initialize**(`options
|
|
344
|
+
> **\_initialize**(`options?`): `void`
|
|
345
345
|
|
|
346
346
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:646
|
|
347
347
|
|
|
@@ -405,7 +405,7 @@ console.log(filteredData); // Output: { name: "Alice" }
|
|
|
405
405
|
|
|
406
406
|
### format()
|
|
407
407
|
|
|
408
|
-
> **format**(`data
|
|
408
|
+
> **format**(`data?`): `Promise`\<`string`\>
|
|
409
409
|
|
|
410
410
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:219
|
|
411
411
|
|
|
@@ -444,7 +444,7 @@ console.log(result); // Output: "Hello"
|
|
|
444
444
|
|
|
445
445
|
### getVariables()
|
|
446
446
|
|
|
447
|
-
> **getVariables**(`template
|
|
447
|
+
> **getVariables**(`template?`): `string`[]
|
|
448
448
|
|
|
449
449
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:645
|
|
450
450
|
|
|
@@ -462,7 +462,7 @@ Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:645
|
|
|
462
462
|
|
|
463
463
|
### initialize()
|
|
464
464
|
|
|
465
|
-
> **initialize**(`options
|
|
465
|
+
> **initialize**(`options?`): `void`
|
|
466
466
|
|
|
467
467
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:197
|
|
468
468
|
|
|
@@ -539,7 +539,7 @@ console.log(dateResult.date instanceof Date); // Output: true
|
|
|
539
539
|
|
|
540
540
|
### toJSON()
|
|
541
541
|
|
|
542
|
-
> **toJSON**(`options
|
|
542
|
+
> **toJSON**(`options?`): [`PromptTemplateOptions`](../interfaces/PromptTemplateOptions.md)
|
|
543
543
|
|
|
544
544
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:264
|
|
545
545
|
|
|
@@ -629,7 +629,7 @@ Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_module
|
|
|
629
629
|
|
|
630
630
|
### \_register()
|
|
631
631
|
|
|
632
|
-
> `static` **\_register**(`aClass`, `aOptions
|
|
632
|
+
> `static` **\_register**(`aClass`, `aOptions?`): `boolean`
|
|
633
633
|
|
|
634
634
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:145
|
|
635
635
|
|
|
@@ -876,7 +876,7 @@ defaults to returning the name unchanged. By overloading this method, case-insen
|
|
|
876
876
|
|
|
877
877
|
### formatNameFromClass()
|
|
878
878
|
|
|
879
|
-
> `static` **formatNameFromClass**(`aClass`, `aBaseNameOnly
|
|
879
|
+
> `static` **formatNameFromClass**(`aClass`, `aBaseNameOnly?`): `string`
|
|
880
880
|
|
|
881
881
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:130
|
|
882
882
|
|
|
@@ -908,7 +908,7 @@ the name to register
|
|
|
908
908
|
|
|
909
909
|
### from()
|
|
910
910
|
|
|
911
|
-
> `static` **from**(`template
|
|
911
|
+
> `static` **from**(`template?`, `options?`): [`PromptTemplate`](PromptTemplate.md)
|
|
912
912
|
|
|
913
913
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:86
|
|
914
914
|
|
|
@@ -1146,7 +1146,7 @@ console.log(isValid); // Output: true
|
|
|
1146
1146
|
|
|
1147
1147
|
### matchTemplateSegment()
|
|
1148
1148
|
|
|
1149
|
-
> `static` **matchTemplateSegment**(`template`, `index
|
|
1149
|
+
> `static` **matchTemplateSegment**(`template`, `index?`): `undefined` \| `RegExpExecArray`
|
|
1150
1150
|
|
|
1151
1151
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:643
|
|
1152
1152
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: FewShotPromptTemplate\<T\>
|
|
8
8
|
|
|
9
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:39](https://github.com/isdk/ai-tool.js/blob/
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:39](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/prompt/few-shot-prompt-template.ts#L39)
|
|
10
10
|
|
|
11
11
|
The `StringTemplate` class is a versatile template engine that supports dynamic template creation,
|
|
12
12
|
formatting, and partial data processing. It extends the `BaseFactory` class and provides methods
|
|
@@ -41,15 +41,17 @@ console.log(result); // Output: "Formatted: Hello World"
|
|
|
41
41
|
|
|
42
42
|
## Type Parameters
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
### T
|
|
45
|
+
|
|
46
|
+
`T` = `any`
|
|
45
47
|
|
|
46
48
|
## Constructors
|
|
47
49
|
|
|
48
|
-
###
|
|
50
|
+
### Constructor
|
|
49
51
|
|
|
50
|
-
> **new FewShotPromptTemplate**\<`T`\>(`options`):
|
|
52
|
+
> **new FewShotPromptTemplate**\<`T`\>(`options`): `FewShotPromptTemplate`\<`T`\>
|
|
51
53
|
|
|
52
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:50](https://github.com/isdk/ai-tool.js/blob/
|
|
54
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:50](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/prompt/few-shot-prompt-template.ts#L50)
|
|
53
55
|
|
|
54
56
|
#### Parameters
|
|
55
57
|
|
|
@@ -59,11 +61,11 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-te
|
|
|
59
61
|
|
|
60
62
|
#### Returns
|
|
61
63
|
|
|
62
|
-
|
|
64
|
+
`FewShotPromptTemplate`\<`T`\>
|
|
63
65
|
|
|
64
66
|
#### Overrides
|
|
65
67
|
|
|
66
|
-
[`PromptTemplate`](PromptTemplate.md).[`constructor`](PromptTemplate.md#
|
|
68
|
+
[`PromptTemplate`](PromptTemplate.md).[`constructor`](PromptTemplate.md#constructor)
|
|
67
69
|
|
|
68
70
|
## Properties
|
|
69
71
|
|
|
@@ -99,7 +101,7 @@ Declares the data object used for template interpolation.
|
|
|
99
101
|
|
|
100
102
|
> **examplePrompt**: `undefined` \| [`PromptTemplate`](PromptTemplate.md)
|
|
101
103
|
|
|
102
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:41](https://github.com/isdk/ai-tool.js/blob/
|
|
104
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:41](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/prompt/few-shot-prompt-template.ts#L41)
|
|
103
105
|
|
|
104
106
|
***
|
|
105
107
|
|
|
@@ -107,7 +109,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-te
|
|
|
107
109
|
|
|
108
110
|
> **examples**: [`PromptExamples`](../type-aliases/PromptExamples.md)\<`T`\>
|
|
109
111
|
|
|
110
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:40](https://github.com/isdk/ai-tool.js/blob/
|
|
112
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:40](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/prompt/few-shot-prompt-template.ts#L40)
|
|
111
113
|
|
|
112
114
|
***
|
|
113
115
|
|
|
@@ -115,7 +117,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-te
|
|
|
115
117
|
|
|
116
118
|
> **exampleSeparator**: `string`
|
|
117
119
|
|
|
118
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:43](https://github.com/isdk/ai-tool.js/blob/
|
|
120
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:43](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/prompt/few-shot-prompt-template.ts#L43)
|
|
119
121
|
|
|
120
122
|
***
|
|
121
123
|
|
|
@@ -137,7 +139,7 @@ Declares the list of input variables expected by the template.
|
|
|
137
139
|
|
|
138
140
|
> **prefix**: `string`
|
|
139
141
|
|
|
140
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:44](https://github.com/isdk/ai-tool.js/blob/
|
|
142
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:44](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/prompt/few-shot-prompt-template.ts#L44)
|
|
141
143
|
|
|
142
144
|
***
|
|
143
145
|
|
|
@@ -145,7 +147,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-te
|
|
|
145
147
|
|
|
146
148
|
> **suffix**: `string`
|
|
147
149
|
|
|
148
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:42](https://github.com/isdk/ai-tool.js/blob/
|
|
150
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:42](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/prompt/few-shot-prompt-template.ts#L42)
|
|
149
151
|
|
|
150
152
|
***
|
|
151
153
|
|
|
@@ -159,7 +161,7 @@ Declares the raw template string.
|
|
|
159
161
|
|
|
160
162
|
#### Inherited from
|
|
161
163
|
|
|
162
|
-
[`PromptTemplate`](PromptTemplate.md).[`template`](PromptTemplate.md#template
|
|
164
|
+
[`PromptTemplate`](PromptTemplate.md).[`template`](PromptTemplate.md#template)
|
|
163
165
|
|
|
164
166
|
***
|
|
165
167
|
|
|
@@ -339,7 +341,7 @@ The Root Factory class
|
|
|
339
341
|
|
|
340
342
|
> **\_format**(`data`): `Promise`\<`string`\>
|
|
341
343
|
|
|
342
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:69](https://github.com/isdk/ai-tool.js/blob/
|
|
344
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:69](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/prompt/few-shot-prompt-template.ts#L69)
|
|
343
345
|
|
|
344
346
|
Placeholder method for formatting the template. Must be implemented by subclasses.
|
|
345
347
|
|
|
@@ -365,9 +367,9 @@ A formatted string or a promise resolving to the formatted string.
|
|
|
365
367
|
|
|
366
368
|
### \_initialize()
|
|
367
369
|
|
|
368
|
-
> **\_initialize**(`options
|
|
370
|
+
> **\_initialize**(`options?`): `void`
|
|
369
371
|
|
|
370
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:54](https://github.com/isdk/ai-tool.js/blob/
|
|
372
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:54](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/prompt/few-shot-prompt-template.ts#L54)
|
|
371
373
|
|
|
372
374
|
Placeholder method for initializing the template. Must be implemented by subclasses.
|
|
373
375
|
|
|
@@ -429,7 +431,7 @@ console.log(filteredData); // Output: { name: "Alice" }
|
|
|
429
431
|
|
|
430
432
|
### format()
|
|
431
433
|
|
|
432
|
-
> **format**(`data
|
|
434
|
+
> **format**(`data?`): `Promise`\<`string`\>
|
|
433
435
|
|
|
434
436
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:219
|
|
435
437
|
|
|
@@ -468,7 +470,7 @@ console.log(result); // Output: "Hello"
|
|
|
468
470
|
|
|
469
471
|
### initialize()
|
|
470
472
|
|
|
471
|
-
> **initialize**(`options
|
|
473
|
+
> **initialize**(`options?`): `void`
|
|
472
474
|
|
|
473
475
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:197
|
|
474
476
|
|
|
@@ -547,7 +549,7 @@ console.log(dateResult.date instanceof Date); // Output: true
|
|
|
547
549
|
|
|
548
550
|
> **toJSON**(`options`): [`FewShotPromptTemplateOptions`](../interfaces/FewShotPromptTemplateOptions.md)\<`T`\>
|
|
549
551
|
|
|
550
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:94](https://github.com/isdk/ai-tool.js/blob/
|
|
552
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:94](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/prompt/few-shot-prompt-template.ts#L94)
|
|
551
553
|
|
|
552
554
|
Serializes the `StringTemplate` instance into a JSON-compatible object.
|
|
553
555
|
|
|
@@ -635,7 +637,7 @@ Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_module
|
|
|
635
637
|
|
|
636
638
|
### \_register()
|
|
637
639
|
|
|
638
|
-
> `static` **\_register**(`aClass`, `aOptions
|
|
640
|
+
> `static` **\_register**(`aClass`, `aOptions?`): `boolean`
|
|
639
641
|
|
|
640
642
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:145
|
|
641
643
|
|
|
@@ -882,7 +884,7 @@ defaults to returning the name unchanged. By overloading this method, case-insen
|
|
|
882
884
|
|
|
883
885
|
### formatNameFromClass()
|
|
884
886
|
|
|
885
|
-
> `static` **formatNameFromClass**(`aClass`, `aBaseNameOnly
|
|
887
|
+
> `static` **formatNameFromClass**(`aClass`, `aBaseNameOnly?`): `string`
|
|
886
888
|
|
|
887
889
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:130
|
|
888
890
|
|
|
@@ -914,15 +916,17 @@ the name to register
|
|
|
914
916
|
|
|
915
917
|
### from()
|
|
916
918
|
|
|
917
|
-
> `static` **from**\<`T`\>(`options`):
|
|
919
|
+
> `static` **from**\<`T`\>(`options`): `FewShotPromptTemplate`\<`T`\>
|
|
918
920
|
|
|
919
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:46](https://github.com/isdk/ai-tool.js/blob/
|
|
921
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:46](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/utils/prompt/few-shot-prompt-template.ts#L46)
|
|
920
922
|
|
|
921
923
|
Creates a new instance of the `StringTemplate` class.
|
|
922
924
|
|
|
923
925
|
#### Type Parameters
|
|
924
926
|
|
|
925
|
-
|
|
927
|
+
##### T
|
|
928
|
+
|
|
929
|
+
`T` = `any`
|
|
926
930
|
|
|
927
931
|
#### Parameters
|
|
928
932
|
|
|
@@ -934,7 +938,7 @@ Additional configuration options for the template.
|
|
|
934
938
|
|
|
935
939
|
#### Returns
|
|
936
940
|
|
|
937
|
-
|
|
941
|
+
`FewShotPromptTemplate`\<`T`\>
|
|
938
942
|
|
|
939
943
|
A new `StringTemplate` instance.
|
|
940
944
|
|
|
@@ -1150,7 +1154,7 @@ console.log(isValid); // Output: true
|
|
|
1150
1154
|
|
|
1151
1155
|
### matchTemplateSegment()
|
|
1152
1156
|
|
|
1153
|
-
> `static` **matchTemplateSegment**(`templateOpt`, `index
|
|
1157
|
+
> `static` **matchTemplateSegment**(`templateOpt`, `index?`): `undefined` \| `RegExpExecArray`
|
|
1154
1158
|
|
|
1155
1159
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:157
|
|
1156
1160
|
|
|
@@ -41,9 +41,9 @@ console.log(result); // Output: "Formatted: Hello World"
|
|
|
41
41
|
|
|
42
42
|
## Constructors
|
|
43
43
|
|
|
44
|
-
###
|
|
44
|
+
### Constructor
|
|
45
45
|
|
|
46
|
-
> **new GolangPromptTemplate**(`template
|
|
46
|
+
> **new GolangPromptTemplate**(`template?`, `options?`): `GolangStringTemplate`
|
|
47
47
|
|
|
48
48
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:187
|
|
49
49
|
|
|
@@ -65,7 +65,7 @@ Additional configuration options for the template.
|
|
|
65
65
|
|
|
66
66
|
#### Returns
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
`GolangStringTemplate`
|
|
69
69
|
|
|
70
70
|
#### Example
|
|
71
71
|
|
|
@@ -79,7 +79,7 @@ console.log(template instanceof TestStringTemplate); // Output: true
|
|
|
79
79
|
|
|
80
80
|
#### Inherited from
|
|
81
81
|
|
|
82
|
-
[`PromptTemplate`](PromptTemplate.md).[`constructor`](PromptTemplate.md#
|
|
82
|
+
[`PromptTemplate`](PromptTemplate.md).[`constructor`](PromptTemplate.md#constructor)
|
|
83
83
|
|
|
84
84
|
## Properties
|
|
85
85
|
|
|
@@ -135,7 +135,7 @@ Declares the raw template string.
|
|
|
135
135
|
|
|
136
136
|
#### Inherited from
|
|
137
137
|
|
|
138
|
-
[`PromptTemplate`](PromptTemplate.md).[`template`](PromptTemplate.md#template
|
|
138
|
+
[`PromptTemplate`](PromptTemplate.md).[`template`](PromptTemplate.md#template)
|
|
139
139
|
|
|
140
140
|
***
|
|
141
141
|
|
|
@@ -341,7 +341,7 @@ A formatted string or a promise resolving to the formatted string.
|
|
|
341
341
|
|
|
342
342
|
### \_initialize()
|
|
343
343
|
|
|
344
|
-
> **\_initialize**(`options
|
|
344
|
+
> **\_initialize**(`options?`): `void`
|
|
345
345
|
|
|
346
346
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:653
|
|
347
347
|
|
|
@@ -405,7 +405,7 @@ console.log(filteredData); // Output: { name: "Alice" }
|
|
|
405
405
|
|
|
406
406
|
### format()
|
|
407
407
|
|
|
408
|
-
> **format**(`data
|
|
408
|
+
> **format**(`data?`): `Promise`\<`string`\>
|
|
409
409
|
|
|
410
410
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:219
|
|
411
411
|
|
|
@@ -462,7 +462,7 @@ Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:652
|
|
|
462
462
|
|
|
463
463
|
### initialize()
|
|
464
464
|
|
|
465
|
-
> **initialize**(`options
|
|
465
|
+
> **initialize**(`options?`): `void`
|
|
466
466
|
|
|
467
467
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:197
|
|
468
468
|
|
|
@@ -539,7 +539,7 @@ console.log(dateResult.date instanceof Date); // Output: true
|
|
|
539
539
|
|
|
540
540
|
### toJSON()
|
|
541
541
|
|
|
542
|
-
> **toJSON**(`options
|
|
542
|
+
> **toJSON**(`options?`): [`PromptTemplateOptions`](../interfaces/PromptTemplateOptions.md)
|
|
543
543
|
|
|
544
544
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:264
|
|
545
545
|
|
|
@@ -629,7 +629,7 @@ Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_module
|
|
|
629
629
|
|
|
630
630
|
### \_register()
|
|
631
631
|
|
|
632
|
-
> `static` **\_register**(`aClass`, `aOptions
|
|
632
|
+
> `static` **\_register**(`aClass`, `aOptions?`): `boolean`
|
|
633
633
|
|
|
634
634
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:145
|
|
635
635
|
|
|
@@ -876,7 +876,7 @@ defaults to returning the name unchanged. By overloading this method, case-insen
|
|
|
876
876
|
|
|
877
877
|
### formatNameFromClass()
|
|
878
878
|
|
|
879
|
-
> `static` **formatNameFromClass**(`aClass`, `aBaseNameOnly
|
|
879
|
+
> `static` **formatNameFromClass**(`aClass`, `aBaseNameOnly?`): `string`
|
|
880
880
|
|
|
881
881
|
Defined in: @isdk/ai-tools/node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:130
|
|
882
882
|
|
|
@@ -908,7 +908,7 @@ the name to register
|
|
|
908
908
|
|
|
909
909
|
### from()
|
|
910
910
|
|
|
911
|
-
> `static` **from**(`template
|
|
911
|
+
> `static` **from**(`template?`, `options?`): [`PromptTemplate`](PromptTemplate.md)
|
|
912
912
|
|
|
913
913
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:86
|
|
914
914
|
|
|
@@ -1146,7 +1146,7 @@ console.log(isValid); // Output: true
|
|
|
1146
1146
|
|
|
1147
1147
|
### matchTemplateSegment()
|
|
1148
1148
|
|
|
1149
|
-
> `static` **matchTemplateSegment**(`template`, `index
|
|
1149
|
+
> `static` **matchTemplateSegment**(`template`, `index?`): `undefined` \| `RegExpExecArray`
|
|
1150
1150
|
|
|
1151
1151
|
Defined in: @isdk/ai-tools/packages/template-engines/dist/index.d.ts:651
|
|
1152
1152
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: HttpClientToolTransport
|
|
8
8
|
|
|
9
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/http-client.ts:9](https://github.com/isdk/ai-tool.js/blob/
|
|
9
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/http-client.ts:9](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/http-client.ts#L9)
|
|
10
10
|
|
|
11
11
|
A concrete client transport implementation that uses the browser/node `fetch` API.
|
|
12
12
|
|
|
@@ -16,11 +16,11 @@ A concrete client transport implementation that uses the browser/node `fetch` AP
|
|
|
16
16
|
|
|
17
17
|
## Constructors
|
|
18
18
|
|
|
19
|
-
###
|
|
19
|
+
### Constructor
|
|
20
20
|
|
|
21
|
-
> **new HttpClientToolTransport**(`apiRoot`):
|
|
21
|
+
> **new HttpClientToolTransport**(`apiRoot`): `HttpClientToolTransport`
|
|
22
22
|
|
|
23
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:41](https://github.com/isdk/ai-tool.js/blob/
|
|
23
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:41](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/client.ts#L41)
|
|
24
24
|
|
|
25
25
|
#### Parameters
|
|
26
26
|
|
|
@@ -30,11 +30,11 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:41](https:
|
|
|
30
30
|
|
|
31
31
|
#### Returns
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
`HttpClientToolTransport`
|
|
34
34
|
|
|
35
35
|
#### Inherited from
|
|
36
36
|
|
|
37
|
-
[`ClientToolTransport`](ClientToolTransport.md).[`constructor`](ClientToolTransport.md#
|
|
37
|
+
[`ClientToolTransport`](ClientToolTransport.md).[`constructor`](ClientToolTransport.md#constructor)
|
|
38
38
|
|
|
39
39
|
## Properties
|
|
40
40
|
|
|
@@ -42,14 +42,14 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:41](https:
|
|
|
42
42
|
|
|
43
43
|
> **apiRoot**: `string`
|
|
44
44
|
|
|
45
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:37](https://github.com/isdk/ai-tool.js/blob/
|
|
45
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:37](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/client.ts#L37)
|
|
46
46
|
|
|
47
47
|
The root endpoint for the remote service.
|
|
48
48
|
For HTTP, this is a URL. For IPC, it could be a channel name.
|
|
49
49
|
|
|
50
50
|
#### Inherited from
|
|
51
51
|
|
|
52
|
-
[`ClientToolTransport`](ClientToolTransport.md).[`apiRoot`](ClientToolTransport.md#apiroot
|
|
52
|
+
[`ClientToolTransport`](ClientToolTransport.md).[`apiRoot`](ClientToolTransport.md#apiroot)
|
|
53
53
|
|
|
54
54
|
***
|
|
55
55
|
|
|
@@ -57,7 +57,7 @@ For HTTP, this is a URL. For IPC, it could be a channel name.
|
|
|
57
57
|
|
|
58
58
|
> `optional` **options**: `any`
|
|
59
59
|
|
|
60
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/base.ts:36](https://github.com/isdk/ai-tool.js/blob/
|
|
60
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/base.ts:36](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/base.ts#L36)
|
|
61
61
|
|
|
62
62
|
Additional options for the transport start or fetch, passed by mount.
|
|
63
63
|
|
|
@@ -71,7 +71,7 @@ Additional options for the transport start or fetch, passed by mount.
|
|
|
71
71
|
|
|
72
72
|
> **Tools**: *typeof* [`ClientTools`](ClientTools.md)
|
|
73
73
|
|
|
74
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:38](https://github.com/isdk/ai-tool.js/blob/
|
|
74
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:38](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/client.ts#L38)
|
|
75
75
|
|
|
76
76
|
#### Inherited from
|
|
77
77
|
|
|
@@ -81,9 +81,9 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:38](https:
|
|
|
81
81
|
|
|
82
82
|
### \_fetch()
|
|
83
83
|
|
|
84
|
-
> **\_fetch**(`name`, `args
|
|
84
|
+
> **\_fetch**(`name`, `args?`, `act?`, `subName?`, `fetchOptions?`): `Promise`\<`Response`\>
|
|
85
85
|
|
|
86
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/http-client.ts:26](https://github.com/isdk/ai-tool.js/blob/
|
|
86
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/http-client.ts:26](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/http-client.ts#L26)
|
|
87
87
|
|
|
88
88
|
#### Parameters
|
|
89
89
|
|
|
@@ -119,9 +119,9 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/http-client.ts:26](h
|
|
|
119
119
|
|
|
120
120
|
### \_mount()
|
|
121
121
|
|
|
122
|
-
> **\_mount**(`clientTools`, `apiPrefix`, `options
|
|
122
|
+
> **\_mount**(`clientTools`, `apiPrefix`, `options?`): `Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
|
|
123
123
|
|
|
124
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:49](https://github.com/isdk/ai-tool.js/blob/
|
|
124
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:49](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/client.ts#L49)
|
|
125
125
|
|
|
126
126
|
#### Parameters
|
|
127
127
|
|
|
@@ -151,7 +151,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:49](https:
|
|
|
151
151
|
|
|
152
152
|
> **errorFrom**(`name`, `res`): `Promise`\<[`CommonError`](CommonError.md)\>
|
|
153
153
|
|
|
154
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/http-client.ts:
|
|
154
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/http-client.ts:84](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/http-client.ts#L84)
|
|
155
155
|
|
|
156
156
|
**`Internal`**
|
|
157
157
|
|
|
@@ -179,9 +179,9 @@ A structured error object.
|
|
|
179
179
|
|
|
180
180
|
### fetch()
|
|
181
181
|
|
|
182
|
-
> **fetch**(`name`, `args
|
|
182
|
+
> **fetch**(`name`, `args?`, `act?`, `subName?`, `fetchOptions?`): `Promise`\<`any`\>
|
|
183
183
|
|
|
184
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:64](https://github.com/isdk/ai-tool.js/blob/
|
|
184
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/client.ts:64](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/client.ts#L64)
|
|
185
185
|
|
|
186
186
|
Fetches data from the server.
|
|
187
187
|
|
|
@@ -231,7 +231,7 @@ A promise that resolves with the fetched data.
|
|
|
231
231
|
|
|
232
232
|
> **loadApis**(): `Promise`\<[`Funcs`](../interfaces/Funcs.md)\>
|
|
233
233
|
|
|
234
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/http-client.ts:15](https://github.com/isdk/ai-tool.js/blob/
|
|
234
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/http-client.ts:15](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/http-client.ts#L15)
|
|
235
235
|
|
|
236
236
|
Connects to the server's discovery endpoint to get the list of available tools.
|
|
237
237
|
|
|
@@ -249,9 +249,9 @@ A promise that resolves to a map of tool function metadata.
|
|
|
249
249
|
|
|
250
250
|
### mount()
|
|
251
251
|
|
|
252
|
-
> **mount**(`Tools`, `apiRoot
|
|
252
|
+
> **mount**(`Tools`, `apiRoot?`, `options?`): `any`
|
|
253
253
|
|
|
254
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/base.ts:42](https://github.com/isdk/ai-tool.js/blob/
|
|
254
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/base.ts:42](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/base.ts#L42)
|
|
255
255
|
|
|
256
256
|
#### Parameters
|
|
257
257
|
|
|
@@ -281,7 +281,7 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/base.ts:42](https://
|
|
|
281
281
|
|
|
282
282
|
> **setApiRoot**(`apiRoot`): `void`
|
|
283
283
|
|
|
284
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/base.ts:38](https://github.com/isdk/ai-tool.js/blob/
|
|
284
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/base.ts:38](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/base.ts#L38)
|
|
285
285
|
|
|
286
286
|
#### Parameters
|
|
287
287
|
|
|
@@ -301,9 +301,9 @@ Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/base.ts:38](https://
|
|
|
301
301
|
|
|
302
302
|
### toObject()
|
|
303
303
|
|
|
304
|
-
> **toObject**(`res`, `args
|
|
304
|
+
> **toObject**(`res`, `args?`): `Promise`\<`any`\>
|
|
305
305
|
|
|
306
|
-
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/http-client.ts:
|
|
306
|
+
Defined in: [@isdk/ai-tools/packages/ai-tool/src/transports/http-client.ts:114](https://github.com/isdk/ai-tool.js/blob/d0765f898f217d97c57c6949502b4a7bef5dce5e/src/transports/http-client.ts#L114)
|
|
307
307
|
|
|
308
308
|
#### Parameters
|
|
309
309
|
|