@isdk/ai-tool 0.4.0 → 0.5.1
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-VIG2GB47.mjs +39 -1
- package/dist/chunk-VJ45JQBR.mjs +7829 -0
- package/dist/funcs.d.mts +3 -2
- package/dist/funcs.d.ts +3 -2
- package/dist/funcs.js +5156 -1
- package/dist/funcs.mjs +29 -1
- package/dist/index-Br-4ZYgE.d.mts +892 -0
- package/dist/index-Br-4ZYgE.d.ts +892 -0
- package/dist/index.d.mts +204 -237
- package/dist/index.d.ts +204 -237
- package/dist/index.js +8132 -1
- package/dist/index.mjs +476 -1
- package/dist/test/util.js +101 -1
- package/dist/test/util.mjs +30 -1
- package/docs/README.md +1 -1
- package/docs/classes/AbortError.md +80 -82
- package/docs/classes/AlreadyExistsError.md +80 -82
- package/docs/classes/BaseError.md +81 -81
- package/docs/classes/BinarySemaphore.md +418 -0
- package/docs/classes/CancelableAbility.md +193 -105
- package/docs/classes/ClientTools.md +655 -631
- package/docs/classes/CommonError.md +85 -85
- package/docs/classes/ConfigFile.md +131 -111
- package/docs/classes/EnvPromptTemplate.md +1158 -0
- package/docs/classes/EventClient.md +766 -736
- package/docs/classes/EventEmitter.md +299 -0
- package/docs/classes/EventServer.md +783 -757
- package/docs/classes/EventToolFunc.md +612 -588
- package/docs/classes/FStringPromptTemplate.md +246 -238
- package/docs/classes/FewShotPromptTemplate.md +240 -246
- package/docs/classes/GolangPromptTemplate.md +246 -238
- package/docs/classes/HFEnvironment.md +42 -44
- package/docs/classes/HFInterpreter.md +22 -20
- package/docs/classes/HFTemplate.md +19 -19
- package/docs/classes/HfPromptTemplate.md +246 -238
- package/docs/classes/IntSet.md +53 -53
- package/docs/classes/LRUCache.md +601 -0
- package/docs/classes/NotFoundError.md +80 -82
- package/docs/classes/NotImplementationError.md +80 -82
- package/docs/classes/PromptExampleSelector.md +39 -39
- package/docs/classes/PromptTemplate.md +235 -226
- package/docs/classes/ReadableStreamError.md +82 -84
- package/docs/classes/ResClientTools.md +662 -630
- package/docs/classes/ResServerTools.md +648 -626
- package/docs/classes/SSEChannel.md +61 -61
- package/docs/classes/Semaphore.md +401 -40
- package/docs/classes/ServerTools.md +622 -608
- package/docs/classes/SignalGate.md +182 -0
- package/docs/classes/TaskAbortController.md +27 -33
- package/docs/classes/ToolFunc.md +582 -552
- package/docs/classes/YamlTypeBaseObject.md +9 -7
- package/docs/enumerations/AsyncFeatureBits.md +6 -10
- package/docs/enumerations/AsyncFeatures.md +6 -10
- package/docs/enumerations/ErrorCode.md +24 -64
- package/docs/enumerations/HashAlgorithm.md +14 -34
- package/docs/functions/AIArgProcessor.md +15 -9
- package/docs/functions/AIStream.md +9 -7
- package/docs/functions/ChoiceArgProcessor.md +15 -9
- package/docs/functions/ObjectArgsToArgsInfo.md +29 -0
- package/docs/functions/RateLimit.md +13 -9
- package/docs/functions/TemplateArgProcessor.md +15 -9
- package/docs/functions/assignDirs.md +33 -0
- package/docs/functions/backendEventable.md +14 -8
- package/docs/functions/beforeShutdown.md +29 -0
- package/docs/functions/canonicalize.md +6 -6
- package/docs/functions/completeSentences.md +9 -7
- package/docs/functions/concatText.md +8 -6
- package/docs/functions/countLLMTokens.md +9 -7
- package/docs/functions/countRegexMatches.md +9 -7
- package/docs/functions/createAbilityInjector.md +66 -34
- package/docs/functions/createCallbacksTransformer.md +6 -6
- package/docs/functions/createEmptyReadableStream.md +3 -5
- package/docs/functions/createEndWithRepetitionDetector.md +9 -7
- package/docs/functions/createError.md +12 -8
- package/docs/functions/createEventStreamTransformer.md +8 -8
- package/docs/functions/createHfValueFunc.md +9 -7
- package/docs/functions/createLRUCache.md +9 -7
- package/docs/functions/createYamlObjectTag.md +9 -7
- package/docs/functions/dateToText.md +9 -7
- package/docs/functions/decodeCharset.md +9 -7
- package/docs/functions/detectCharset.md +9 -7
- package/docs/functions/encodeLLMTokens.md +9 -7
- package/docs/functions/ensureQuoted.md +25 -0
- package/docs/functions/eventable.md +82 -0
- package/docs/functions/expandConfig.md +25 -0
- package/docs/functions/expandEnv.md +6 -6
- package/docs/functions/expandObjEnv.md +12 -8
- package/docs/functions/expandPath.md +25 -0
- package/docs/functions/extNameLevel.md +6 -6
- package/docs/functions/fileIsExists.md +6 -6
- package/docs/functions/filenameReservedRegex.md +3 -5
- package/docs/functions/filterValidFnScope.md +6 -6
- package/docs/functions/findIndexNonEmptyFrom.md +9 -7
- package/docs/functions/findPort.md +9 -7
- package/docs/functions/formatISO.md +9 -11
- package/docs/functions/formatTextWithSpace.md +13 -9
- package/docs/functions/getAllEnumKeys.md +8 -8
- package/docs/functions/getConfigFileNames.md +9 -7
- package/docs/functions/getConfigs.md +9 -7
- package/docs/functions/getEnvVairables.md +21 -0
- package/docs/functions/getFileMetaInfo.md +6 -6
- package/docs/functions/getHashAlgoBySize.md +6 -6
- package/docs/functions/getKeysPath.md +6 -6
- package/docs/functions/getLLMTokenizer.md +6 -6
- package/docs/functions/getMultiLevelExtname.md +9 -7
- package/docs/functions/getPackageDir.md +6 -6
- package/docs/functions/getRealFilepath.md +6 -6
- package/docs/functions/getResponseErrorReadableStream.md +6 -6
- package/docs/functions/getXDGConfigs.md +37 -0
- package/docs/functions/hasDirectoryIn.md +9 -7
- package/docs/functions/hash.md +25 -0
- package/docs/functions/hashFile.md +10 -8
- package/docs/functions/hashStream.md +10 -8
- package/docs/functions/hfParse.md +6 -6
- package/docs/functions/hfTokenize.md +9 -7
- package/docs/functions/initShutdown.md +15 -0
- package/docs/functions/interpolateEnv.md +13 -9
- package/docs/functions/interpolateFString.md +9 -7
- package/docs/functions/interpolateGolangTemplate.md +12 -8
- package/docs/functions/isLangUsingSpaces.md +6 -6
- package/docs/functions/isListItemString.md +6 -6
- package/docs/functions/isModelNameMatched.md +9 -7
- package/docs/functions/isPunctuationChar.md +6 -6
- package/docs/functions/isQuoted.md +21 -0
- package/docs/functions/isRegExp.md +6 -6
- package/docs/functions/isSameString.md +36 -0
- package/docs/functions/isSectionString.md +9 -7
- package/docs/functions/isSentenceEnding.md +6 -6
- package/docs/functions/isSepLineString.md +6 -6
- package/docs/functions/isStrWrapped.md +25 -0
- package/docs/functions/isSubdirectory.md +9 -7
- package/docs/functions/isTitleString.md +9 -7
- package/docs/functions/isValidFilename.md +6 -6
- package/docs/functions/isValidFilepath.md +6 -6
- package/docs/functions/isWebStream.md +6 -6
- package/docs/functions/jsonFilterToWhere.md +9 -7
- package/docs/functions/jsonToMarkdownStr.md +18 -10
- package/docs/functions/loadAIConfig.md +21 -0
- package/docs/functions/loadConfig.md +25 -0
- package/docs/functions/loadConfigFile.md +25 -0
- package/docs/functions/loadFileFromPaths.md +24 -14
- package/docs/functions/loadTextFromPaths.md +18 -10
- package/docs/functions/lrucache.md +17 -11
- package/docs/functions/makeToolFuncCancelable.md +14 -8
- package/docs/functions/matchUrlProtocol.md +6 -6
- package/docs/functions/memoize.md +9 -7
- package/docs/functions/messagesToText.md +6 -6
- package/docs/functions/paramsSizeToScaleStr.md +9 -7
- package/docs/functions/parseCommand.md +13 -9
- package/docs/functions/parseDateFormat.md +15 -13
- package/docs/functions/parseFString.md +6 -6
- package/docs/functions/parseISO.md +9 -11
- package/docs/functions/parseJsJson.md +9 -7
- package/docs/functions/parseJsJsonSimpleSync.md +9 -7
- package/docs/functions/parseObjectArgInfo.md +15 -9
- package/docs/functions/parseObjectArgumentInfos.md +12 -8
- package/docs/functions/parseObjectArguments.md +12 -8
- package/docs/functions/parseObjectArgumentsAsArgInfos.md +12 -8
- package/docs/functions/parseYaml.md +11 -7
- package/docs/functions/quoteStr.md +6 -6
- package/docs/functions/reControlCharsRegex.md +3 -5
- package/docs/functions/readFilenamesRecursiveSync.md +16 -10
- package/docs/functions/readTextFileChunks.md +9 -7
- package/docs/functions/readTextFileChunksEx.md +9 -7
- package/docs/functions/readableFromAsyncIterable.md +6 -6
- package/docs/functions/registerCoreTools.md +3 -5
- package/docs/functions/registerYamlTag.md +6 -6
- package/docs/functions/removeMarkdownBold.md +9 -7
- package/docs/functions/removeMarkdownBoldAndItalic.md +9 -7
- package/docs/functions/removeMarkdownItalic.md +9 -7
- package/docs/functions/replaceWithPlaceholder.md +11 -9
- package/docs/functions/restoreFromPlacehoders.md +12 -8
- package/docs/functions/sanitizeFilename.md +9 -7
- package/docs/functions/sanitizeFilepath.md +9 -7
- package/docs/functions/saveConfigFile.md +12 -8
- package/docs/functions/scaleStrToParamsSize.md +6 -6
- package/docs/functions/shutdown.md +33 -0
- package/docs/functions/simplifyObjectArguments.md +6 -6
- package/docs/functions/sortedValues.md +6 -6
- package/docs/functions/splitChunks.md +9 -7
- package/docs/functions/splitParagraph.md +9 -7
- package/docs/functions/splitSentence.md +9 -7
- package/docs/functions/stringifyYaml.md +11 -7
- package/docs/functions/stripConsoleColor.md +6 -6
- package/docs/functions/textToDate.md +9 -7
- package/docs/functions/throwError.md +12 -8
- package/docs/functions/toDate.md +9 -11
- package/docs/functions/toDateTime.md +6 -6
- package/docs/functions/toRegExp.md +6 -6
- package/docs/functions/trimStartOfStreamHelper.md +6 -6
- package/docs/functions/truncTo.md +12 -8
- package/docs/functions/truncateByToken.md +9 -7
- package/docs/functions/truncateToTokenLimit.md +9 -7
- package/docs/functions/truncateToTokenLimitEx.md +9 -7
- package/docs/functions/uuid.md +9 -7
- package/docs/functions/uuidParse.md +6 -6
- package/docs/functions/uuidStringify.md +10 -8
- package/docs/functions/uuidValidate.md +6 -6
- package/docs/functions/uuidVersion.md +6 -6
- package/docs/functions/uuidv1.md +28 -20
- package/docs/functions/uuidv4.md +28 -20
- package/docs/functions/uuidv5.md +34 -22
- package/docs/functions/wait.md +6 -6
- package/docs/functions/wrapEventEmitter.md +27 -0
- package/docs/functions/xxhash.md +12 -8
- package/docs/functions/xxhash32.md +9 -7
- package/docs/functions/xxhash64.md +9 -7
- package/docs/functions/xxhashAsStr.md +12 -8
- package/docs/globals.md +45 -1
- package/docs/interfaces/AIChatAssistantMessageParam.md +42 -30
- package/docs/interfaces/AIChatContentPartImage.md +6 -8
- package/docs/interfaces/AIChatContentPartText.md +5 -7
- package/docs/interfaces/AIChatMessageParamBase.md +23 -13
- package/docs/interfaces/AIChatMessageToolCall.md +7 -11
- package/docs/interfaces/AIChatSystemMessageParam.md +40 -22
- package/docs/interfaces/AIChatToolChoiceFuncObject.md +37 -0
- package/docs/interfaces/AIChatToolChoiceObject.md +25 -0
- package/docs/interfaces/AIChatToolFunc.md +41 -0
- package/docs/interfaces/AIChatToolFuncParam.md +37 -0
- package/docs/interfaces/AIChatToolMessageParam.md +40 -24
- package/docs/interfaces/AIChatToolParam.md +25 -0
- package/docs/interfaces/AIChatToolTypeObject.md +17 -0
- package/docs/interfaces/AIChatUserMessageParam.md +44 -34
- package/docs/interfaces/AIChoiceConfig.md +10 -22
- package/docs/interfaces/AIResult.md +13 -21
- package/docs/interfaces/AIStreamParser.md +11 -7
- package/docs/interfaces/AIStreamParserOptions.md +5 -5
- package/docs/interfaces/BaseFunc.md +30 -40
- package/docs/interfaces/BaseFuncItem.md +18 -28
- package/docs/interfaces/BinarySemaphoreAcquireOptions.md +25 -0
- package/docs/interfaces/BinarySemaphoreOptions.md +57 -0
- package/docs/interfaces/BinarySemaphoreReleaseOptions.md +25 -0
- package/docs/interfaces/BinarySemaphoreReleaserFunc.md +37 -0
- package/docs/interfaces/CancelableAbilityOptions.md +27 -29
- package/docs/interfaces/ClientFuncItem.md +31 -47
- package/docs/interfaces/DotenvExpandOptions.md +8 -12
- package/docs/interfaces/DotenvExpandOutput.md +5 -7
- package/docs/interfaces/DotenvParseInput.md +4 -2
- package/docs/interfaces/DotenvParseOutput.md +4 -2
- package/docs/interfaces/DotenvPopulateInput.md +4 -2
- package/docs/interfaces/EventClientFuncParams.md +11 -15
- package/docs/interfaces/EventServerFuncParams.md +14 -18
- package/docs/interfaces/FewShotPromptTemplateOptions.md +29 -45
- package/docs/interfaces/FuncItem.md +26 -38
- package/docs/interfaces/FuncParam.md +11 -21
- package/docs/interfaces/FuncParams.md +4 -2
- package/docs/interfaces/Funcs.md +4 -2
- package/docs/interfaces/HashAlgoParams.md +6 -10
- package/docs/interfaces/IFileMetaInfo.md +10 -22
- package/docs/interfaces/IReadTextFileChunksOptions.md +29 -43
- package/docs/interfaces/ITruncateToTokenLimitOptions.md +19 -31
- package/docs/interfaces/JsonFilter.md +4 -2
- package/docs/interfaces/ParseObjectArgumentOptions.md +13 -31
- package/docs/interfaces/PromptExampleSelectorOptions.md +8 -10
- package/docs/interfaces/PromptTemplateOptions.md +10 -20
- package/docs/interfaces/RemoteFuncItem.md +28 -44
- package/docs/interfaces/ReplacePlacehoderOptions.md +7 -13
- package/docs/interfaces/ResClientFuncParams.md +10 -8
- package/docs/interfaces/ResServerFuncParams.md +15 -19
- package/docs/interfaces/SanitizeFilenameOptions.md +5 -7
- package/docs/interfaces/SectionStringOptions.md +5 -7
- package/docs/interfaces/SemaphoreOptions.md +89 -0
- package/docs/interfaces/SemaphoreTaskItem.md +73 -0
- package/docs/interfaces/ServerFuncItem.md +32 -50
- package/docs/interfaces/ServerFuncParams.md +6 -8
- package/docs/interfaces/SplitSentenceOptions.md +7 -13
- package/docs/interfaces/StreamCallbacksAndOptions.md +26 -22
- package/docs/interfaces/TaskAbortControllers.md +4 -2
- package/docs/interfaces/TaskPromise.md +24 -24
- package/docs/interfaces/ToolFuncPackage.md +11 -13
- package/docs/namespaces/EventStates/README.md +14 -0
- package/docs/namespaces/EventStates/variables/ABORT.md +11 -0
- package/docs/namespaces/EventStates/variables/CONTINUE.md +11 -0
- package/docs/namespaces/EventStates/variables/DONE.md +11 -0
- package/docs/namespaces/EventStates/variables/STOPPED.md +11 -0
- package/docs/namespaces/uuidv5/README.md +12 -0
- package/docs/namespaces/uuidv5/variables/DNS.md +11 -0
- package/docs/namespaces/uuidv5/variables/URL.md +11 -0
- package/docs/type-aliases/AIChatContentPart.md +2 -4
- package/docs/type-aliases/AIChatMessageParam.md +3 -5
- package/docs/type-aliases/AIChatRole.md +2 -4
- package/docs/type-aliases/AIChatToolChoiceParam.md +11 -0
- package/docs/type-aliases/AIMessageType.md +2 -4
- package/docs/type-aliases/AIModelNameRule.md +2 -4
- package/docs/type-aliases/AIModelNameRuleFn.md +6 -6
- package/docs/type-aliases/AIModelNameRules.md +2 -4
- package/docs/type-aliases/AITextGenerationFinishReason.md +2 -4
- package/docs/type-aliases/ActionName.md +2 -4
- package/docs/type-aliases/AsyncTaskId.md +2 -4
- package/docs/type-aliases/BeforeShutdownListener.md +23 -0
- package/docs/type-aliases/EventErrorListenerFn.md +15 -9
- package/docs/type-aliases/EventListenerFn.md +12 -8
- package/docs/type-aliases/FStringPromptTemplateNode.md +4 -6
- package/docs/type-aliases/FuncParamType.md +2 -4
- package/docs/type-aliases/PromptExamples.md +3 -5
- package/docs/type-aliases/PromptTemplateType.md +2 -4
- package/docs/type-aliases/PromptType.md +2 -4
- package/docs/type-aliases/SemaphoreIsReadyFuncType.md +15 -0
- package/docs/type-aliases/TFunc.md +9 -7
- package/docs/variables/AIChatRoles.md +3 -5
- package/docs/variables/AIMessageTypes.md +3 -5
- package/docs/variables/AITextGenerationFinishReasons.md +3 -5
- package/docs/variables/AbortErrorCode.md +2 -4
- package/docs/variables/ActionNames.md +3 -5
- package/docs/variables/AlreadyExistsErrorCode.md +2 -4
- package/docs/variables/ClientToolFuncSchema.md +40 -26
- package/docs/variables/DEFAULT_CONFIG_NAME.md +11 -0
- package/docs/variables/DefaultAsyncSemaphoreCapacity.md +2 -4
- package/docs/variables/EventBusName.md +2 -4
- package/docs/variables/EventName.md +2 -4
- package/docs/variables/FilenameReservedRegex.md +3 -5
- package/docs/variables/HFBuiltins.md +42 -12
- package/docs/variables/InternalErrorCode.md +2 -4
- package/docs/variables/LLM_TOKENIZER_NAMES.md +5 -7
- package/docs/variables/LLM_TOKENIZER_NAMES_MAP.md +2 -4
- package/docs/variables/NotFoundErrorCode.md +2 -4
- package/docs/variables/NotImplementedErrorCode.md +2 -4
- package/docs/variables/PASSING_SCORE.md +2 -4
- package/docs/variables/PromptTemplateTypes.md +3 -5
- package/docs/variables/PromptTypes.md +4 -6
- package/docs/variables/RStreamErrCode.md +2 -4
- package/docs/variables/RemoteToolFuncSchema.md +40 -26
- package/docs/variables/ResponseRStreamErrCode.md +2 -4
- package/docs/variables/SHUTDOWN_SIGNALS.md +17 -0
- package/docs/variables/SSEChannelAlreadyClosedErrCode.md +2 -4
- package/docs/variables/SecondaryCache.md +11 -0
- package/docs/variables/ServerToolFuncSchema.md +40 -26
- package/docs/variables/ToolAsyncCancelableBit.md +2 -4
- package/docs/variables/ToolAsyncMultiTaskBit.md +2 -4
- package/docs/variables/ToolAsyncPriorityBit.md +2 -4
- package/docs/variables/ToolFuncSchema.md +33 -25
- package/docs/variables/WindowsReservedNameRegex.md +3 -5
- package/docs/variables/base32768.md +2 -4
- package/docs/variables/defaultTemplateFormat.md +2 -4
- package/docs/variables/event.md +2 -4
- package/docs/variables/eventClient.md +2 -4
- package/docs/variables/eventServer.md +2 -4
- package/docs/variables/lrucache.md +2 -4
- package/docs/variables/mimeType.md +2 -4
- package/docs/variables/uuidNIL.md +3 -5
- package/package.json +31 -31
- package/dist/chunk-SIP3XWIH.mjs +0 -1
- package/dist/index-BC3GQn6-.d.mts +0 -488
- package/dist/index-BC3GQn6-.d.ts +0 -488
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**@isdk/ai-tool**](../README.md)
|
|
1
|
+
[**@isdk/ai-tool**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: FewShotPromptTemplate\<T\>
|
|
8
8
|
|
|
9
|
+
Defined in: [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:39](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/few-shot-prompt-template.ts#L39)
|
|
10
|
+
|
|
9
11
|
## Extends
|
|
10
12
|
|
|
11
13
|
- [`PromptTemplate`](PromptTemplate.md)
|
|
@@ -20,9 +22,13 @@
|
|
|
20
22
|
|
|
21
23
|
> **new FewShotPromptTemplate**\<`T`\>(`options`): [`FewShotPromptTemplate`](FewShotPromptTemplate.md)\<`T`\>
|
|
22
24
|
|
|
25
|
+
Defined in: [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:50](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/few-shot-prompt-template.ts#L50)
|
|
26
|
+
|
|
23
27
|
#### Parameters
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
##### options
|
|
30
|
+
|
|
31
|
+
[`FewShotPromptTemplateOptions`](../interfaces/FewShotPromptTemplateOptions.md)\<`T`\>
|
|
26
32
|
|
|
27
33
|
#### Returns
|
|
28
34
|
|
|
@@ -32,47 +38,37 @@
|
|
|
32
38
|
|
|
33
39
|
[`PromptTemplate`](PromptTemplate.md).[`constructor`](PromptTemplate.md#constructors)
|
|
34
40
|
|
|
35
|
-
#### Defined in
|
|
36
|
-
|
|
37
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:50](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/few-shot-prompt-template.ts#L50)
|
|
38
|
-
|
|
39
41
|
## Properties
|
|
40
42
|
|
|
41
43
|
### compiledTemplate
|
|
42
44
|
|
|
43
45
|
> **compiledTemplate**: `any`
|
|
44
46
|
|
|
47
|
+
Defined in: [packages/ai-tool/src/utils/prompt/prompt-template.ts:21](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/prompt-template.ts#L21)
|
|
48
|
+
|
|
45
49
|
#### Inherited from
|
|
46
50
|
|
|
47
51
|
[`PromptTemplate`](PromptTemplate.md).[`compiledTemplate`](PromptTemplate.md#compiledtemplate)
|
|
48
52
|
|
|
49
|
-
#### Defined in
|
|
50
|
-
|
|
51
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:21](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/prompt-template.ts#L21)
|
|
52
|
-
|
|
53
53
|
***
|
|
54
54
|
|
|
55
55
|
### data
|
|
56
56
|
|
|
57
57
|
> **data**: `undefined` \| `Record`\<`string`, `any`\>
|
|
58
58
|
|
|
59
|
+
Defined in: [packages/ai-tool/src/utils/prompt/prompt-template.ts:24](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/prompt-template.ts#L24)
|
|
60
|
+
|
|
59
61
|
#### Inherited from
|
|
60
62
|
|
|
61
63
|
[`PromptTemplate`](PromptTemplate.md).[`data`](PromptTemplate.md#data)
|
|
62
64
|
|
|
63
|
-
#### Defined in
|
|
64
|
-
|
|
65
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:24](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/prompt-template.ts#L24)
|
|
66
|
-
|
|
67
65
|
***
|
|
68
66
|
|
|
69
67
|
### examplePrompt
|
|
70
68
|
|
|
71
69
|
> **examplePrompt**: `undefined` \| [`PromptTemplate`](PromptTemplate.md)
|
|
72
70
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:41](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/few-shot-prompt-template.ts#L41)
|
|
71
|
+
Defined in: [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:41](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/few-shot-prompt-template.ts#L41)
|
|
76
72
|
|
|
77
73
|
***
|
|
78
74
|
|
|
@@ -80,9 +76,7 @@
|
|
|
80
76
|
|
|
81
77
|
> **examples**: [`PromptExamples`](../type-aliases/PromptExamples.md)\<`T`\>
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:40](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/few-shot-prompt-template.ts#L40)
|
|
79
|
+
Defined in: [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:40](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/few-shot-prompt-template.ts#L40)
|
|
86
80
|
|
|
87
81
|
***
|
|
88
82
|
|
|
@@ -90,9 +84,7 @@
|
|
|
90
84
|
|
|
91
85
|
> **exampleSeparator**: `string`
|
|
92
86
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:43](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/few-shot-prompt-template.ts#L43)
|
|
87
|
+
Defined in: [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:43](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/few-shot-prompt-template.ts#L43)
|
|
96
88
|
|
|
97
89
|
***
|
|
98
90
|
|
|
@@ -100,23 +92,19 @@
|
|
|
100
92
|
|
|
101
93
|
> **inputVariables**: `undefined` \| `string`[]
|
|
102
94
|
|
|
95
|
+
Defined in: [packages/ai-tool/src/utils/prompt/prompt-template.ts:25](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/prompt-template.ts#L25)
|
|
96
|
+
|
|
103
97
|
#### Inherited from
|
|
104
98
|
|
|
105
99
|
[`PromptTemplate`](PromptTemplate.md).[`inputVariables`](PromptTemplate.md#inputvariables)
|
|
106
100
|
|
|
107
|
-
#### Defined in
|
|
108
|
-
|
|
109
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:25](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/prompt-template.ts#L25)
|
|
110
|
-
|
|
111
101
|
***
|
|
112
102
|
|
|
113
103
|
### prefix
|
|
114
104
|
|
|
115
105
|
> **prefix**: `string`
|
|
116
106
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:44](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/few-shot-prompt-template.ts#L44)
|
|
107
|
+
Defined in: [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:44](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/few-shot-prompt-template.ts#L44)
|
|
120
108
|
|
|
121
109
|
***
|
|
122
110
|
|
|
@@ -124,9 +112,7 @@
|
|
|
124
112
|
|
|
125
113
|
> **suffix**: `string`
|
|
126
114
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:42](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/few-shot-prompt-template.ts#L42)
|
|
115
|
+
Defined in: [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:42](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/few-shot-prompt-template.ts#L42)
|
|
130
116
|
|
|
131
117
|
***
|
|
132
118
|
|
|
@@ -134,13 +120,11 @@
|
|
|
134
120
|
|
|
135
121
|
> **template**: `string`
|
|
136
122
|
|
|
137
|
-
|
|
123
|
+
Defined in: [packages/ai-tool/src/utils/prompt/prompt-template.ts:22](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/prompt-template.ts#L22)
|
|
138
124
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
#### Defined in
|
|
125
|
+
#### Inherited from
|
|
142
126
|
|
|
143
|
-
[
|
|
127
|
+
[`PromptTemplate`](PromptTemplate.md).[`template`](PromptTemplate.md#template-1)
|
|
144
128
|
|
|
145
129
|
***
|
|
146
130
|
|
|
@@ -148,19 +132,19 @@
|
|
|
148
132
|
|
|
149
133
|
> **templateFormat**: `undefined` \| `string`
|
|
150
134
|
|
|
135
|
+
Defined in: [packages/ai-tool/src/utils/prompt/prompt-template.ts:23](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/prompt-template.ts#L23)
|
|
136
|
+
|
|
151
137
|
#### Inherited from
|
|
152
138
|
|
|
153
139
|
[`PromptTemplate`](PromptTemplate.md).[`templateFormat`](PromptTemplate.md#templateformat)
|
|
154
140
|
|
|
155
|
-
#### Defined in
|
|
156
|
-
|
|
157
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:23](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/prompt-template.ts#L23)
|
|
158
|
-
|
|
159
141
|
***
|
|
160
142
|
|
|
161
143
|
### \_aliases
|
|
162
144
|
|
|
163
|
-
> `abstract` `static` **\_aliases**: [`string
|
|
145
|
+
> `abstract` `static` **\_aliases**: \[`string`\]
|
|
146
|
+
|
|
147
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:59
|
|
164
148
|
|
|
165
149
|
**`Internal`**
|
|
166
150
|
|
|
@@ -171,16 +155,14 @@ the key is alias name, the value is the registered name
|
|
|
171
155
|
|
|
172
156
|
[`PromptTemplate`](PromptTemplate.md).[`_aliases`](PromptTemplate.md#_aliases)
|
|
173
157
|
|
|
174
|
-
#### Defined in
|
|
175
|
-
|
|
176
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:59
|
|
177
|
-
|
|
178
158
|
***
|
|
179
159
|
|
|
180
160
|
### \_baseNameOnly
|
|
181
161
|
|
|
182
162
|
> `static` **\_baseNameOnly**: `number`
|
|
183
163
|
|
|
164
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:82
|
|
165
|
+
|
|
184
166
|
**`Internal`**
|
|
185
167
|
|
|
186
168
|
Extracts a specified number of words from a PascalCase class name to use as a base name for registration,
|
|
@@ -214,23 +196,21 @@ _baseNameOnly
|
|
|
214
196
|
|
|
215
197
|
[`PromptTemplate`](PromptTemplate.md).[`_baseNameOnly`](PromptTemplate.md#_basenameonly)
|
|
216
198
|
|
|
217
|
-
#### Defined in
|
|
218
|
-
|
|
219
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:82
|
|
220
|
-
|
|
221
199
|
***
|
|
222
200
|
|
|
223
201
|
### \_children
|
|
224
202
|
|
|
225
203
|
> `abstract` `static` **\_children**: `object`
|
|
226
204
|
|
|
205
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:49
|
|
206
|
+
|
|
227
207
|
**`Internal`**
|
|
228
208
|
|
|
229
209
|
The registered classes in the Factory
|
|
230
210
|
|
|
231
211
|
#### Index Signature
|
|
232
212
|
|
|
233
|
-
|
|
213
|
+
\[`name`: `string`\]: `any`
|
|
234
214
|
|
|
235
215
|
#### Name
|
|
236
216
|
|
|
@@ -240,16 +220,14 @@ _children
|
|
|
240
220
|
|
|
241
221
|
[`PromptTemplate`](PromptTemplate.md).[`_children`](PromptTemplate.md#_children)
|
|
242
222
|
|
|
243
|
-
#### Defined in
|
|
244
|
-
|
|
245
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:49
|
|
246
|
-
|
|
247
223
|
***
|
|
248
224
|
|
|
249
225
|
### \_Factory
|
|
250
226
|
|
|
251
227
|
> `abstract` `static` **\_Factory**: *typeof* `BaseFactory`
|
|
252
228
|
|
|
229
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:41
|
|
230
|
+
|
|
253
231
|
**`Internal`**
|
|
254
232
|
|
|
255
233
|
The Root Factory class
|
|
@@ -262,45 +240,55 @@ _Factory
|
|
|
262
240
|
|
|
263
241
|
[`PromptTemplate`](PromptTemplate.md).[`_Factory`](PromptTemplate.md#_factory)
|
|
264
242
|
|
|
265
|
-
#### Defined in
|
|
266
|
-
|
|
267
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:41
|
|
268
|
-
|
|
269
243
|
## Accessors
|
|
270
244
|
|
|
271
245
|
### aliases
|
|
272
246
|
|
|
273
|
-
|
|
247
|
+
#### Get Signature
|
|
248
|
+
|
|
249
|
+
> **get** `static` **aliases**(): `string`[]
|
|
250
|
+
|
|
251
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:200
|
|
274
252
|
|
|
275
253
|
the aliases of itself
|
|
276
254
|
|
|
277
|
-
|
|
255
|
+
##### Returns
|
|
278
256
|
|
|
279
|
-
|
|
257
|
+
`string`[]
|
|
280
258
|
|
|
281
|
-
|
|
259
|
+
#### Set Signature
|
|
282
260
|
|
|
283
|
-
|
|
261
|
+
> **set** `static` **aliases**(`value`): `void`
|
|
262
|
+
|
|
263
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:196
|
|
264
|
+
|
|
265
|
+
##### Parameters
|
|
266
|
+
|
|
267
|
+
###### value
|
|
284
268
|
|
|
285
269
|
`string`[]
|
|
286
270
|
|
|
287
|
-
|
|
271
|
+
##### Returns
|
|
288
272
|
|
|
289
|
-
|
|
273
|
+
`void`
|
|
290
274
|
|
|
291
|
-
####
|
|
275
|
+
#### Inherited from
|
|
292
276
|
|
|
293
|
-
|
|
277
|
+
[`PromptTemplate`](PromptTemplate.md).[`aliases`](PromptTemplate.md#aliases)
|
|
294
278
|
|
|
295
279
|
***
|
|
296
280
|
|
|
297
281
|
### Factory
|
|
298
282
|
|
|
299
|
-
|
|
283
|
+
#### Get Signature
|
|
284
|
+
|
|
285
|
+
> **get** `static` **Factory**(): *typeof* `BaseFactory`
|
|
286
|
+
|
|
287
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:63
|
|
300
288
|
|
|
301
289
|
The Root Factory class
|
|
302
290
|
|
|
303
|
-
|
|
291
|
+
##### Returns
|
|
304
292
|
|
|
305
293
|
*typeof* `BaseFactory`
|
|
306
294
|
|
|
@@ -308,19 +296,19 @@ The Root Factory class
|
|
|
308
296
|
|
|
309
297
|
[`PromptTemplate`](PromptTemplate.md).[`Factory`](PromptTemplate.md#factory)
|
|
310
298
|
|
|
311
|
-
#### Defined in
|
|
312
|
-
|
|
313
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:63
|
|
314
|
-
|
|
315
299
|
## Methods
|
|
316
300
|
|
|
317
301
|
### \_format()
|
|
318
302
|
|
|
319
303
|
> **\_format**(`data`): `Promise`\<`string`\>
|
|
320
304
|
|
|
305
|
+
Defined in: [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:69](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/few-shot-prompt-template.ts#L69)
|
|
306
|
+
|
|
321
307
|
#### Parameters
|
|
322
308
|
|
|
323
|
-
|
|
309
|
+
##### data
|
|
310
|
+
|
|
311
|
+
`Record`\<`string`, `any`\>
|
|
324
312
|
|
|
325
313
|
#### Returns
|
|
326
314
|
|
|
@@ -330,19 +318,19 @@ node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-f
|
|
|
330
318
|
|
|
331
319
|
[`PromptTemplate`](PromptTemplate.md).[`_format`](PromptTemplate.md#_format)
|
|
332
320
|
|
|
333
|
-
#### Defined in
|
|
334
|
-
|
|
335
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:69](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/few-shot-prompt-template.ts#L69)
|
|
336
|
-
|
|
337
321
|
***
|
|
338
322
|
|
|
339
323
|
### \_initialize()
|
|
340
324
|
|
|
341
325
|
> **\_initialize**(`options`?): `void`
|
|
342
326
|
|
|
327
|
+
Defined in: [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:54](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/few-shot-prompt-template.ts#L54)
|
|
328
|
+
|
|
343
329
|
#### Parameters
|
|
344
330
|
|
|
345
|
-
|
|
331
|
+
##### options?
|
|
332
|
+
|
|
333
|
+
[`FewShotPromptTemplateOptions`](../interfaces/FewShotPromptTemplateOptions.md)\<`T`\>
|
|
346
334
|
|
|
347
335
|
#### Returns
|
|
348
336
|
|
|
@@ -352,21 +340,21 @@ node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-f
|
|
|
352
340
|
|
|
353
341
|
[`PromptTemplate`](PromptTemplate.md).[`_initialize`](PromptTemplate.md#_initialize)
|
|
354
342
|
|
|
355
|
-
#### Defined in
|
|
356
|
-
|
|
357
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:54](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/few-shot-prompt-template.ts#L54)
|
|
358
|
-
|
|
359
343
|
***
|
|
360
344
|
|
|
361
345
|
### filterData()
|
|
362
346
|
|
|
363
347
|
> **filterData**(`data`): `Record`\<`string`, `any`\>
|
|
364
348
|
|
|
349
|
+
Defined in: [packages/ai-tool/src/utils/prompt/prompt-template.ts:62](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/prompt-template.ts#L62)
|
|
350
|
+
|
|
365
351
|
Validate/filter the data in inputVariables
|
|
366
352
|
|
|
367
353
|
#### Parameters
|
|
368
354
|
|
|
369
|
-
|
|
355
|
+
##### data
|
|
356
|
+
|
|
357
|
+
`Record`\<`string`, `any`\>
|
|
370
358
|
|
|
371
359
|
#### Returns
|
|
372
360
|
|
|
@@ -376,19 +364,19 @@ Validate/filter the data in inputVariables
|
|
|
376
364
|
|
|
377
365
|
[`PromptTemplate`](PromptTemplate.md).[`filterData`](PromptTemplate.md#filterdata)
|
|
378
366
|
|
|
379
|
-
#### Defined in
|
|
380
|
-
|
|
381
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:62](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/prompt-template.ts#L62)
|
|
382
|
-
|
|
383
367
|
***
|
|
384
368
|
|
|
385
369
|
### format()
|
|
386
370
|
|
|
387
371
|
> **format**(`data`?): `Promise`\<`string`\>
|
|
388
372
|
|
|
373
|
+
Defined in: [packages/ai-tool/src/utils/prompt/prompt-template.ts:109](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/prompt-template.ts#L109)
|
|
374
|
+
|
|
389
375
|
#### Parameters
|
|
390
376
|
|
|
391
|
-
|
|
377
|
+
##### data?
|
|
378
|
+
|
|
379
|
+
`Record`\<`string`, `any`\>
|
|
392
380
|
|
|
393
381
|
#### Returns
|
|
394
382
|
|
|
@@ -398,23 +386,23 @@ Validate/filter the data in inputVariables
|
|
|
398
386
|
|
|
399
387
|
[`PromptTemplate`](PromptTemplate.md).[`format`](PromptTemplate.md#format)
|
|
400
388
|
|
|
401
|
-
#### Defined in
|
|
402
|
-
|
|
403
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:109](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/prompt-template.ts#L109)
|
|
404
|
-
|
|
405
389
|
***
|
|
406
390
|
|
|
407
391
|
### initialize()
|
|
408
392
|
|
|
409
393
|
> `abstract` **initialize**(`options`?): `void`
|
|
410
394
|
|
|
395
|
+
Defined in: [packages/ai-tool/src/utils/prompt/prompt-template.ts:96](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/prompt-template.ts#L96)
|
|
396
|
+
|
|
411
397
|
**`Internal`**
|
|
412
398
|
|
|
413
399
|
initialize instance method
|
|
414
400
|
|
|
415
401
|
#### Parameters
|
|
416
402
|
|
|
417
|
-
|
|
403
|
+
##### options?
|
|
404
|
+
|
|
405
|
+
[`PromptTemplateOptions`](../interfaces/PromptTemplateOptions.md)
|
|
418
406
|
|
|
419
407
|
#### Returns
|
|
420
408
|
|
|
@@ -424,21 +412,21 @@ initialize instance method
|
|
|
424
412
|
|
|
425
413
|
[`PromptTemplate`](PromptTemplate.md).[`initialize`](PromptTemplate.md#initialize)
|
|
426
414
|
|
|
427
|
-
#### Defined in
|
|
428
|
-
|
|
429
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:96](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/prompt-template.ts#L96)
|
|
430
|
-
|
|
431
415
|
***
|
|
432
416
|
|
|
433
417
|
### partial()
|
|
434
418
|
|
|
435
419
|
> **partial**(`data`): [`PromptTemplate`](PromptTemplate.md)
|
|
436
420
|
|
|
421
|
+
Defined in: [packages/ai-tool/src/utils/prompt/prompt-template.ts:139](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/prompt-template.ts#L139)
|
|
422
|
+
|
|
437
423
|
it can make sense to "partial" a prompt template - eg pass in a subset of the required values, as to create a new prompt template which expects only the remaining subset of values.
|
|
438
424
|
|
|
439
425
|
#### Parameters
|
|
440
426
|
|
|
441
|
-
|
|
427
|
+
##### data
|
|
428
|
+
|
|
429
|
+
`Record`\<`string`, `any`\>
|
|
442
430
|
|
|
443
431
|
the partial data
|
|
444
432
|
|
|
@@ -452,19 +440,19 @@ the new partial PromptTemplate instance
|
|
|
452
440
|
|
|
453
441
|
[`PromptTemplate`](PromptTemplate.md).[`partial`](PromptTemplate.md#partial)
|
|
454
442
|
|
|
455
|
-
#### Defined in
|
|
456
|
-
|
|
457
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:139](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/prompt-template.ts#L139)
|
|
458
|
-
|
|
459
443
|
***
|
|
460
444
|
|
|
461
445
|
### toJSON()
|
|
462
446
|
|
|
463
447
|
> **toJSON**(`options`): [`FewShotPromptTemplateOptions`](../interfaces/FewShotPromptTemplateOptions.md)\<`T`\>
|
|
464
448
|
|
|
449
|
+
Defined in: [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:94](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/few-shot-prompt-template.ts#L94)
|
|
450
|
+
|
|
465
451
|
#### Parameters
|
|
466
452
|
|
|
467
|
-
|
|
453
|
+
##### options
|
|
454
|
+
|
|
455
|
+
`this` = `...`
|
|
468
456
|
|
|
469
457
|
#### Returns
|
|
470
458
|
|
|
@@ -474,23 +462,23 @@ the new partial PromptTemplate instance
|
|
|
474
462
|
|
|
475
463
|
[`PromptTemplate`](PromptTemplate.md).[`toJSON`](PromptTemplate.md#tojson)
|
|
476
464
|
|
|
477
|
-
#### Defined in
|
|
478
|
-
|
|
479
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:94](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/few-shot-prompt-template.ts#L94)
|
|
480
|
-
|
|
481
465
|
***
|
|
482
466
|
|
|
483
467
|
### \_findRootFactory()
|
|
484
468
|
|
|
485
469
|
> `static` **\_findRootFactory**(`aClass`): `undefined` \| *typeof* `BaseFactory`
|
|
486
470
|
|
|
471
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:99
|
|
472
|
+
|
|
487
473
|
**`Internal`**
|
|
488
474
|
|
|
489
475
|
find the real root factory
|
|
490
476
|
|
|
491
477
|
#### Parameters
|
|
492
478
|
|
|
493
|
-
|
|
479
|
+
##### aClass
|
|
480
|
+
|
|
481
|
+
*typeof* `BaseFactory`
|
|
494
482
|
|
|
495
483
|
the abstract root factory class
|
|
496
484
|
|
|
@@ -502,19 +490,19 @@ the abstract root factory class
|
|
|
502
490
|
|
|
503
491
|
[`PromptTemplate`](PromptTemplate.md).[`_findRootFactory`](PromptTemplate.md#_findrootfactory)
|
|
504
492
|
|
|
505
|
-
#### Defined in
|
|
506
|
-
|
|
507
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:99
|
|
508
|
-
|
|
509
493
|
***
|
|
510
494
|
|
|
511
495
|
### \_get()
|
|
512
496
|
|
|
513
497
|
> `static` **\_get**(`name`): `any`
|
|
514
498
|
|
|
499
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:234
|
|
500
|
+
|
|
515
501
|
#### Parameters
|
|
516
502
|
|
|
517
|
-
|
|
503
|
+
##### name
|
|
504
|
+
|
|
505
|
+
`any`
|
|
518
506
|
|
|
519
507
|
#### Returns
|
|
520
508
|
|
|
@@ -524,27 +512,29 @@ node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-f
|
|
|
524
512
|
|
|
525
513
|
[`PromptTemplate`](PromptTemplate.md).[`_get`](PromptTemplate.md#_get)
|
|
526
514
|
|
|
527
|
-
#### Defined in
|
|
528
|
-
|
|
529
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:234
|
|
530
|
-
|
|
531
515
|
***
|
|
532
516
|
|
|
533
517
|
### \_register()
|
|
534
518
|
|
|
535
519
|
> `static` **\_register**(`aClass`, `aOptions`?): `boolean`
|
|
536
520
|
|
|
521
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:145
|
|
522
|
+
|
|
537
523
|
**`Internal`**
|
|
538
524
|
|
|
539
525
|
register the aClass to the factory
|
|
540
526
|
|
|
541
527
|
#### Parameters
|
|
542
528
|
|
|
543
|
-
|
|
529
|
+
##### aClass
|
|
530
|
+
|
|
531
|
+
*typeof* `BaseFactory`
|
|
544
532
|
|
|
545
533
|
the class to register the Factory
|
|
546
534
|
|
|
547
|
-
|
|
535
|
+
##### aOptions?
|
|
536
|
+
|
|
537
|
+
`any`
|
|
548
538
|
|
|
549
539
|
the options for the class and the factory
|
|
550
540
|
|
|
@@ -558,24 +548,24 @@ return true if successful.
|
|
|
558
548
|
|
|
559
549
|
[`PromptTemplate`](PromptTemplate.md).[`_register`](PromptTemplate.md#_register)
|
|
560
550
|
|
|
561
|
-
#### Defined in
|
|
562
|
-
|
|
563
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:145
|
|
564
|
-
|
|
565
551
|
***
|
|
566
552
|
|
|
567
553
|
### cleanAliases()
|
|
568
554
|
|
|
569
555
|
> `static` **cleanAliases**(`aName`): `void`
|
|
570
556
|
|
|
557
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:162
|
|
558
|
+
|
|
571
559
|
remove all aliases of the registered item or itself
|
|
572
560
|
|
|
573
561
|
#### Parameters
|
|
574
562
|
|
|
575
|
-
|
|
563
|
+
##### aName
|
|
576
564
|
|
|
577
565
|
the registered item or name
|
|
578
566
|
|
|
567
|
+
`undefined` | `string` | *typeof* `BaseFactory`
|
|
568
|
+
|
|
579
569
|
#### Returns
|
|
580
570
|
|
|
581
571
|
`void`
|
|
@@ -584,23 +574,25 @@ the registered item or name
|
|
|
584
574
|
|
|
585
575
|
[`PromptTemplate`](PromptTemplate.md).[`cleanAliases`](PromptTemplate.md#cleanaliases)
|
|
586
576
|
|
|
587
|
-
#### Defined in
|
|
588
|
-
|
|
589
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:162
|
|
590
|
-
|
|
591
577
|
***
|
|
592
578
|
|
|
593
579
|
### createObject()
|
|
594
580
|
|
|
595
581
|
> `static` **createObject**(`aName`, `aOptions`): `undefined` \| `BaseFactory`
|
|
596
582
|
|
|
583
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:241
|
|
584
|
+
|
|
597
585
|
Create a new object instance of Factory
|
|
598
586
|
|
|
599
587
|
#### Parameters
|
|
600
588
|
|
|
601
|
-
|
|
589
|
+
##### aName
|
|
590
|
+
|
|
591
|
+
`string` | `BaseFactory`
|
|
602
592
|
|
|
603
|
-
|
|
593
|
+
##### aOptions
|
|
594
|
+
|
|
595
|
+
`any`
|
|
604
596
|
|
|
605
597
|
#### Returns
|
|
606
598
|
|
|
@@ -610,16 +602,14 @@ Create a new object instance of Factory
|
|
|
610
602
|
|
|
611
603
|
[`PromptTemplate`](PromptTemplate.md).[`createObject`](PromptTemplate.md#createobject)
|
|
612
604
|
|
|
613
|
-
#### Defined in
|
|
614
|
-
|
|
615
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:241
|
|
616
|
-
|
|
617
605
|
***
|
|
618
606
|
|
|
619
607
|
### findRootFactory()
|
|
620
608
|
|
|
621
609
|
> `abstract` `static` **findRootFactory**(): `undefined` \| *typeof* `BaseFactory`
|
|
622
610
|
|
|
611
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:92
|
|
612
|
+
|
|
623
613
|
**`Internal`**
|
|
624
614
|
|
|
625
615
|
find the real root factory
|
|
@@ -637,21 +627,21 @@ the root factory class
|
|
|
637
627
|
|
|
638
628
|
[`PromptTemplate`](PromptTemplate.md).[`findRootFactory`](PromptTemplate.md#findrootfactory)
|
|
639
629
|
|
|
640
|
-
#### Defined in
|
|
641
|
-
|
|
642
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:92
|
|
643
|
-
|
|
644
630
|
***
|
|
645
631
|
|
|
646
632
|
### forEach()
|
|
647
633
|
|
|
648
634
|
> `static` **forEach**(`cb`): `any`
|
|
649
635
|
|
|
636
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:227
|
|
637
|
+
|
|
650
638
|
executes a provided callback function once for each registered element.
|
|
651
639
|
|
|
652
640
|
#### Parameters
|
|
653
641
|
|
|
654
|
-
|
|
642
|
+
##### cb
|
|
643
|
+
|
|
644
|
+
(`ctor`, `name`) => `undefined` \| `string`
|
|
655
645
|
|
|
656
646
|
the forEach callback function
|
|
657
647
|
|
|
@@ -663,19 +653,19 @@ the forEach callback function
|
|
|
663
653
|
|
|
664
654
|
[`PromptTemplate`](PromptTemplate.md).[`forEach`](PromptTemplate.md#foreach)
|
|
665
655
|
|
|
666
|
-
#### Defined in
|
|
667
|
-
|
|
668
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:227
|
|
669
|
-
|
|
670
656
|
***
|
|
671
657
|
|
|
672
658
|
### format()
|
|
673
659
|
|
|
674
660
|
> `static` **format**(`options`): `Promise`\<`string`\>
|
|
675
661
|
|
|
662
|
+
Defined in: [packages/ai-tool/src/utils/prompt/prompt-template.ts:31](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/prompt-template.ts#L31)
|
|
663
|
+
|
|
676
664
|
#### Parameters
|
|
677
665
|
|
|
678
|
-
|
|
666
|
+
##### options
|
|
667
|
+
|
|
668
|
+
[`PromptTemplateOptions`](../interfaces/PromptTemplateOptions.md)
|
|
679
669
|
|
|
680
670
|
#### Returns
|
|
681
671
|
|
|
@@ -683,11 +673,7 @@ node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-f
|
|
|
683
673
|
|
|
684
674
|
#### Inherited from
|
|
685
675
|
|
|
686
|
-
[`PromptTemplate`](PromptTemplate.md).[`format`](PromptTemplate.md#format-
|
|
687
|
-
|
|
688
|
-
#### Defined in
|
|
689
|
-
|
|
690
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:31](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/prompt-template.ts#L31)
|
|
676
|
+
[`PromptTemplate`](PromptTemplate.md).[`format`](PromptTemplate.md#format-2)
|
|
691
677
|
|
|
692
678
|
***
|
|
693
679
|
|
|
@@ -695,11 +681,15 @@ node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-f
|
|
|
695
681
|
|
|
696
682
|
> `static` **formatIf**(`options`): `Promise`\<`undefined` \| `string`\>
|
|
697
683
|
|
|
684
|
+
Defined in: [packages/ai-tool/src/utils/prompt/prompt-template.ts:41](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/prompt-template.ts#L41)
|
|
685
|
+
|
|
698
686
|
If the given options.template is the template, perform formatting using that template.
|
|
699
687
|
|
|
700
688
|
#### Parameters
|
|
701
689
|
|
|
702
|
-
|
|
690
|
+
##### options
|
|
691
|
+
|
|
692
|
+
[`PromptTemplateOptions`](../interfaces/PromptTemplateOptions.md)
|
|
703
693
|
|
|
704
694
|
The options object to check for being a template and to format.
|
|
705
695
|
|
|
@@ -713,16 +703,14 @@ A Promise that resolves to the formatted result if options is a template; otherw
|
|
|
713
703
|
|
|
714
704
|
[`PromptTemplate`](PromptTemplate.md).[`formatIf`](PromptTemplate.md#formatif)
|
|
715
705
|
|
|
716
|
-
#### Defined in
|
|
717
|
-
|
|
718
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:41](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/prompt-template.ts#L41)
|
|
719
|
-
|
|
720
706
|
***
|
|
721
707
|
|
|
722
708
|
### formatName()
|
|
723
709
|
|
|
724
710
|
> `abstract` `static` **formatName**(`aName`): `string`
|
|
725
711
|
|
|
712
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:116
|
|
713
|
+
|
|
726
714
|
**`Internal`**
|
|
727
715
|
|
|
728
716
|
format(transform) the name to be registered.
|
|
@@ -731,7 +719,9 @@ defaults to returning the name unchanged. By overloading this method, case-insen
|
|
|
731
719
|
|
|
732
720
|
#### Parameters
|
|
733
721
|
|
|
734
|
-
|
|
722
|
+
##### aName
|
|
723
|
+
|
|
724
|
+
`string`
|
|
735
725
|
|
|
736
726
|
#### Returns
|
|
737
727
|
|
|
@@ -741,25 +731,27 @@ defaults to returning the name unchanged. By overloading this method, case-insen
|
|
|
741
731
|
|
|
742
732
|
[`PromptTemplate`](PromptTemplate.md).[`formatName`](PromptTemplate.md#formatname)
|
|
743
733
|
|
|
744
|
-
#### Defined in
|
|
745
|
-
|
|
746
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:116
|
|
747
|
-
|
|
748
734
|
***
|
|
749
735
|
|
|
750
736
|
### formatNameFromClass()
|
|
751
737
|
|
|
752
738
|
> `static` **formatNameFromClass**(`aClass`, `aBaseNameOnly`?): `string`
|
|
753
739
|
|
|
740
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:130
|
|
741
|
+
|
|
754
742
|
**`Internal`**
|
|
755
743
|
|
|
756
744
|
format(transform) the name to be registered for the aClass
|
|
757
745
|
|
|
758
746
|
#### Parameters
|
|
759
747
|
|
|
760
|
-
|
|
748
|
+
##### aClass
|
|
749
|
+
|
|
750
|
+
`any`
|
|
761
751
|
|
|
762
|
-
|
|
752
|
+
##### aBaseNameOnly?
|
|
753
|
+
|
|
754
|
+
`number`
|
|
763
755
|
|
|
764
756
|
#### Returns
|
|
765
757
|
|
|
@@ -771,23 +763,23 @@ the name to register
|
|
|
771
763
|
|
|
772
764
|
[`PromptTemplate`](PromptTemplate.md).[`formatNameFromClass`](PromptTemplate.md#formatnamefromclass)
|
|
773
765
|
|
|
774
|
-
#### Defined in
|
|
775
|
-
|
|
776
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:130
|
|
777
|
-
|
|
778
766
|
***
|
|
779
767
|
|
|
780
768
|
### from()
|
|
781
769
|
|
|
782
770
|
> `static` **from**\<`T`\>(`options`): [`FewShotPromptTemplate`](FewShotPromptTemplate.md)\<`T`\>
|
|
783
771
|
|
|
772
|
+
Defined in: [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:46](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/few-shot-prompt-template.ts#L46)
|
|
773
|
+
|
|
784
774
|
#### Type Parameters
|
|
785
775
|
|
|
786
776
|
• **T** = `any`
|
|
787
777
|
|
|
788
778
|
#### Parameters
|
|
789
779
|
|
|
790
|
-
|
|
780
|
+
##### options
|
|
781
|
+
|
|
782
|
+
[`FewShotPromptTemplateOptions`](../interfaces/FewShotPromptTemplateOptions.md)\<`T`\>
|
|
791
783
|
|
|
792
784
|
#### Returns
|
|
793
785
|
|
|
@@ -797,21 +789,21 @@ node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-f
|
|
|
797
789
|
|
|
798
790
|
[`PromptTemplate`](PromptTemplate.md).[`from`](PromptTemplate.md#from)
|
|
799
791
|
|
|
800
|
-
#### Defined in
|
|
801
|
-
|
|
802
|
-
[packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:46](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/few-shot-prompt-template.ts#L46)
|
|
803
|
-
|
|
804
792
|
***
|
|
805
793
|
|
|
806
794
|
### get()
|
|
807
795
|
|
|
808
796
|
> `static` **get**(`name`): `undefined` \| *typeof* `BaseFactory`
|
|
809
797
|
|
|
798
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:233
|
|
799
|
+
|
|
810
800
|
Get the registered class via name
|
|
811
801
|
|
|
812
802
|
#### Parameters
|
|
813
803
|
|
|
814
|
-
|
|
804
|
+
##### name
|
|
805
|
+
|
|
806
|
+
`any`
|
|
815
807
|
|
|
816
808
|
#### Returns
|
|
817
809
|
|
|
@@ -823,24 +815,24 @@ return the registered class if found the name
|
|
|
823
815
|
|
|
824
816
|
[`PromptTemplate`](PromptTemplate.md).[`get`](PromptTemplate.md#get)
|
|
825
817
|
|
|
826
|
-
#### Defined in
|
|
827
|
-
|
|
828
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:233
|
|
829
|
-
|
|
830
818
|
***
|
|
831
819
|
|
|
832
820
|
### getAliases()
|
|
833
821
|
|
|
834
822
|
> `static` **getAliases**(`aClass`): `string`[]
|
|
835
823
|
|
|
824
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:195
|
|
825
|
+
|
|
836
826
|
get the aliases of the aClass
|
|
837
827
|
|
|
838
828
|
#### Parameters
|
|
839
829
|
|
|
840
|
-
|
|
830
|
+
##### aClass
|
|
841
831
|
|
|
842
832
|
the class or name to get aliases, means itself if no aClass specified
|
|
843
833
|
|
|
834
|
+
`undefined` | `string` | *typeof* `BaseFactory`
|
|
835
|
+
|
|
844
836
|
#### Returns
|
|
845
837
|
|
|
846
838
|
`string`[]
|
|
@@ -851,24 +843,24 @@ aliases
|
|
|
851
843
|
|
|
852
844
|
[`PromptTemplate`](PromptTemplate.md).[`getAliases`](PromptTemplate.md#getaliases)
|
|
853
845
|
|
|
854
|
-
#### Defined in
|
|
855
|
-
|
|
856
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:195
|
|
857
|
-
|
|
858
846
|
***
|
|
859
847
|
|
|
860
848
|
### getDisplayName()
|
|
861
849
|
|
|
862
850
|
> `static` **getDisplayName**(`aClass`): `undefined` \| `string`
|
|
863
851
|
|
|
852
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:206
|
|
853
|
+
|
|
864
854
|
Get the display name from aClass
|
|
865
855
|
|
|
866
856
|
#### Parameters
|
|
867
857
|
|
|
868
|
-
|
|
858
|
+
##### aClass
|
|
869
859
|
|
|
870
860
|
the class, name or itself, means itself if no aClass
|
|
871
861
|
|
|
862
|
+
`undefined` | `string` | `Function`
|
|
863
|
+
|
|
872
864
|
#### Returns
|
|
873
865
|
|
|
874
866
|
`undefined` \| `string`
|
|
@@ -877,21 +869,21 @@ the class, name or itself, means itself if no aClass
|
|
|
877
869
|
|
|
878
870
|
[`PromptTemplate`](PromptTemplate.md).[`getDisplayName`](PromptTemplate.md#getdisplayname)
|
|
879
871
|
|
|
880
|
-
#### Defined in
|
|
881
|
-
|
|
882
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:206
|
|
883
|
-
|
|
884
872
|
***
|
|
885
873
|
|
|
886
874
|
### getNameFrom()
|
|
887
875
|
|
|
888
876
|
> `static` **getNameFrom**(`aClass`): `string`
|
|
889
877
|
|
|
878
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:122
|
|
879
|
+
|
|
890
880
|
Get the unique(registered) name in the factory
|
|
891
881
|
|
|
892
882
|
#### Parameters
|
|
893
883
|
|
|
894
|
-
|
|
884
|
+
##### aClass
|
|
885
|
+
|
|
886
|
+
`string` | `Function`
|
|
895
887
|
|
|
896
888
|
#### Returns
|
|
897
889
|
|
|
@@ -903,19 +895,19 @@ the unique name in the factory
|
|
|
903
895
|
|
|
904
896
|
[`PromptTemplate`](PromptTemplate.md).[`getNameFrom`](PromptTemplate.md#getnamefrom)
|
|
905
897
|
|
|
906
|
-
#### Defined in
|
|
907
|
-
|
|
908
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:122
|
|
909
|
-
|
|
910
898
|
***
|
|
911
899
|
|
|
912
900
|
### getRealName()
|
|
913
901
|
|
|
914
902
|
> `static` **getRealName**(`name`): `any`
|
|
915
903
|
|
|
904
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:100
|
|
905
|
+
|
|
916
906
|
#### Parameters
|
|
917
907
|
|
|
918
|
-
|
|
908
|
+
##### name
|
|
909
|
+
|
|
910
|
+
`any`
|
|
919
911
|
|
|
920
912
|
#### Returns
|
|
921
913
|
|
|
@@ -925,21 +917,21 @@ node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-f
|
|
|
925
917
|
|
|
926
918
|
[`PromptTemplate`](PromptTemplate.md).[`getRealName`](PromptTemplate.md#getrealname)
|
|
927
919
|
|
|
928
|
-
#### Defined in
|
|
929
|
-
|
|
930
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:100
|
|
931
|
-
|
|
932
920
|
***
|
|
933
921
|
|
|
934
922
|
### getRealNameFromAlias()
|
|
935
923
|
|
|
936
924
|
> `static` **getRealNameFromAlias**(`alias`): `undefined` \| `string`
|
|
937
925
|
|
|
926
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:106
|
|
927
|
+
|
|
938
928
|
get the unique name in the factory from an alias name
|
|
939
929
|
|
|
940
930
|
#### Parameters
|
|
941
931
|
|
|
942
|
-
|
|
932
|
+
##### alias
|
|
933
|
+
|
|
934
|
+
`string`
|
|
943
935
|
|
|
944
936
|
the alias name
|
|
945
937
|
|
|
@@ -953,19 +945,19 @@ the unique name in the factory
|
|
|
953
945
|
|
|
954
946
|
[`PromptTemplate`](PromptTemplate.md).[`getRealNameFromAlias`](PromptTemplate.md#getrealnamefromalias)
|
|
955
947
|
|
|
956
|
-
#### Defined in
|
|
957
|
-
|
|
958
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:106
|
|
959
|
-
|
|
960
948
|
***
|
|
961
949
|
|
|
962
950
|
### isTemplate()
|
|
963
951
|
|
|
964
952
|
> `static` **isTemplate**(`templateOpt`): `any`
|
|
965
953
|
|
|
954
|
+
Defined in: [packages/ai-tool/src/utils/prompt/prompt-template.ts:48](https://github.com/isdk/ai-tool.js/blob/6a89194ac34437a1bc58f7ec590cd22976939ca6/src/utils/prompt/prompt-template.ts#L48)
|
|
955
|
+
|
|
966
956
|
#### Parameters
|
|
967
957
|
|
|
968
|
-
|
|
958
|
+
##### templateOpt
|
|
959
|
+
|
|
960
|
+
[`PromptTemplateOptions`](../interfaces/PromptTemplateOptions.md)
|
|
969
961
|
|
|
970
962
|
#### Returns
|
|
971
963
|
|
|
@@ -975,21 +967,21 @@ node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-f
|
|
|
975
967
|
|
|
976
968
|
[`PromptTemplate`](PromptTemplate.md).[`isTemplate`](PromptTemplate.md#istemplate)
|
|
977
969
|
|
|
978
|
-
#### Defined in
|
|
979
|
-
|
|
980
|
-
[packages/ai-tool/src/utils/prompt/prompt-template.ts:48](https://github.com/isdk/ai-tool.js/blob/b0813174e9b350ae47231f8e5f885150313123b0/src/utils/prompt/prompt-template.ts#L48)
|
|
981
|
-
|
|
982
970
|
***
|
|
983
971
|
|
|
984
972
|
### register()
|
|
985
973
|
|
|
986
974
|
> `static` **register**(...`args`): `boolean`
|
|
987
975
|
|
|
976
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:137
|
|
977
|
+
|
|
988
978
|
register the aClass to the factory
|
|
989
979
|
|
|
990
980
|
#### Parameters
|
|
991
981
|
|
|
992
|
-
|
|
982
|
+
##### args
|
|
983
|
+
|
|
984
|
+
...`any`[]
|
|
993
985
|
|
|
994
986
|
#### Returns
|
|
995
987
|
|
|
@@ -1001,24 +993,24 @@ return true if successful.
|
|
|
1001
993
|
|
|
1002
994
|
[`PromptTemplate`](PromptTemplate.md).[`register`](PromptTemplate.md#register)
|
|
1003
995
|
|
|
1004
|
-
#### Defined in
|
|
1005
|
-
|
|
1006
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:137
|
|
1007
|
-
|
|
1008
996
|
***
|
|
1009
997
|
|
|
1010
998
|
### registeredClass()
|
|
1011
999
|
|
|
1012
1000
|
> `static` **registeredClass**(`aName`): `false` \| *typeof* `BaseFactory`
|
|
1013
1001
|
|
|
1002
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:151
|
|
1003
|
+
|
|
1014
1004
|
Check the name, alias or itself whether registered.
|
|
1015
1005
|
|
|
1016
1006
|
#### Parameters
|
|
1017
1007
|
|
|
1018
|
-
|
|
1008
|
+
##### aName
|
|
1019
1009
|
|
|
1020
1010
|
the class name
|
|
1021
1011
|
|
|
1012
|
+
`undefined` | `string`
|
|
1013
|
+
|
|
1022
1014
|
#### Returns
|
|
1023
1015
|
|
|
1024
1016
|
`false` \| *typeof* `BaseFactory`
|
|
@@ -1029,21 +1021,21 @@ the registered class if registered, otherwise returns false
|
|
|
1029
1021
|
|
|
1030
1022
|
[`PromptTemplate`](PromptTemplate.md).[`registeredClass`](PromptTemplate.md#registeredclass)
|
|
1031
1023
|
|
|
1032
|
-
#### Defined in
|
|
1033
|
-
|
|
1034
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:151
|
|
1035
|
-
|
|
1036
1024
|
***
|
|
1037
1025
|
|
|
1038
1026
|
### removeAlias()
|
|
1039
1027
|
|
|
1040
1028
|
> `static` **removeAlias**(...`aliases`): `void`
|
|
1041
1029
|
|
|
1030
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:167
|
|
1031
|
+
|
|
1042
1032
|
remove specified aliases
|
|
1043
1033
|
|
|
1044
1034
|
#### Parameters
|
|
1045
1035
|
|
|
1046
|
-
|
|
1036
|
+
##### aliases
|
|
1037
|
+
|
|
1038
|
+
...`string`[]
|
|
1047
1039
|
|
|
1048
1040
|
the aliases to remove
|
|
1049
1041
|
|
|
@@ -1055,25 +1047,27 @@ the aliases to remove
|
|
|
1055
1047
|
|
|
1056
1048
|
[`PromptTemplate`](PromptTemplate.md).[`removeAlias`](PromptTemplate.md#removealias)
|
|
1057
1049
|
|
|
1058
|
-
#### Defined in
|
|
1059
|
-
|
|
1060
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:167
|
|
1061
|
-
|
|
1062
1050
|
***
|
|
1063
1051
|
|
|
1064
1052
|
### setAlias()
|
|
1065
1053
|
|
|
1066
1054
|
> `static` **setAlias**(`aClass`, `alias`): `void`
|
|
1067
1055
|
|
|
1056
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:189
|
|
1057
|
+
|
|
1068
1058
|
set alias to a class
|
|
1069
1059
|
|
|
1070
1060
|
#### Parameters
|
|
1071
1061
|
|
|
1072
|
-
|
|
1062
|
+
##### aClass
|
|
1073
1063
|
|
|
1074
1064
|
the class to set alias
|
|
1075
1065
|
|
|
1076
|
-
|
|
1066
|
+
`undefined` | `string` | *typeof* `BaseFactory`
|
|
1067
|
+
|
|
1068
|
+
##### alias
|
|
1069
|
+
|
|
1070
|
+
`string`
|
|
1077
1071
|
|
|
1078
1072
|
#### Returns
|
|
1079
1073
|
|
|
@@ -1083,25 +1077,27 @@ the class to set alias
|
|
|
1083
1077
|
|
|
1084
1078
|
[`PromptTemplate`](PromptTemplate.md).[`setAlias`](PromptTemplate.md#setalias)
|
|
1085
1079
|
|
|
1086
|
-
#### Defined in
|
|
1087
|
-
|
|
1088
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:189
|
|
1089
|
-
|
|
1090
1080
|
***
|
|
1091
1081
|
|
|
1092
1082
|
### setAliases()
|
|
1093
1083
|
|
|
1094
1084
|
> `static` **setAliases**(`aClass`, ...`aAliases`): `void`
|
|
1095
1085
|
|
|
1086
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:183
|
|
1087
|
+
|
|
1096
1088
|
set aliases to a class
|
|
1097
1089
|
|
|
1098
1090
|
#### Parameters
|
|
1099
1091
|
|
|
1100
|
-
|
|
1092
|
+
##### aClass
|
|
1101
1093
|
|
|
1102
1094
|
the class to set aliases
|
|
1103
1095
|
|
|
1104
|
-
|
|
1096
|
+
`undefined` | `string` | *typeof* `BaseFactory`
|
|
1097
|
+
|
|
1098
|
+
##### aAliases
|
|
1099
|
+
|
|
1100
|
+
...`any`[]
|
|
1105
1101
|
|
|
1106
1102
|
#### Returns
|
|
1107
1103
|
|
|
@@ -1123,28 +1119,30 @@ import { BaseFactory } from 'custom-factory'
|
|
|
1123
1119
|
|
|
1124
1120
|
[`PromptTemplate`](PromptTemplate.md).[`setAliases`](PromptTemplate.md#setaliases)
|
|
1125
1121
|
|
|
1126
|
-
#### Defined in
|
|
1127
|
-
|
|
1128
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:183
|
|
1129
|
-
|
|
1130
1122
|
***
|
|
1131
1123
|
|
|
1132
1124
|
### setDisplayName()
|
|
1133
1125
|
|
|
1134
1126
|
> `static` **setDisplayName**(`aClass`, `aDisplayName`): `void`
|
|
1135
1127
|
|
|
1128
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:212
|
|
1129
|
+
|
|
1136
1130
|
Set the display name to the aClass
|
|
1137
1131
|
|
|
1138
1132
|
#### Parameters
|
|
1139
1133
|
|
|
1140
|
-
|
|
1134
|
+
##### aClass
|
|
1141
1135
|
|
|
1142
1136
|
the class, name or itself, means itself if no aClass
|
|
1143
1137
|
|
|
1144
|
-
|
|
1138
|
+
`undefined` | `string` | `Function`
|
|
1139
|
+
|
|
1140
|
+
##### aDisplayName
|
|
1145
1141
|
|
|
1146
1142
|
the display name to set
|
|
1147
1143
|
|
|
1144
|
+
`string` | \{ `displayName`: `string`; \}
|
|
1145
|
+
|
|
1148
1146
|
#### Returns
|
|
1149
1147
|
|
|
1150
1148
|
`void`
|
|
@@ -1153,24 +1151,24 @@ the display name to set
|
|
|
1153
1151
|
|
|
1154
1152
|
[`PromptTemplate`](PromptTemplate.md).[`setDisplayName`](PromptTemplate.md#setdisplayname)
|
|
1155
1153
|
|
|
1156
|
-
#### Defined in
|
|
1157
|
-
|
|
1158
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:212
|
|
1159
|
-
|
|
1160
1154
|
***
|
|
1161
1155
|
|
|
1162
1156
|
### unregister()
|
|
1163
1157
|
|
|
1164
1158
|
> `static` **unregister**(`aName`): `boolean`
|
|
1165
1159
|
|
|
1160
|
+
Defined in: node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:157
|
|
1161
|
+
|
|
1166
1162
|
unregister this class in the factory
|
|
1167
1163
|
|
|
1168
1164
|
#### Parameters
|
|
1169
1165
|
|
|
1170
|
-
|
|
1166
|
+
##### aName
|
|
1171
1167
|
|
|
1172
1168
|
the registered name or class, no name means unregister itself.
|
|
1173
1169
|
|
|
1170
|
+
`undefined` | `string` | `Function`
|
|
1171
|
+
|
|
1174
1172
|
#### Returns
|
|
1175
1173
|
|
|
1176
1174
|
`boolean`
|
|
@@ -1180,7 +1178,3 @@ true means successful
|
|
|
1180
1178
|
#### Inherited from
|
|
1181
1179
|
|
|
1182
1180
|
[`PromptTemplate`](PromptTemplate.md).[`unregister`](PromptTemplate.md#unregister)
|
|
1183
|
-
|
|
1184
|
-
#### Defined in
|
|
1185
|
-
|
|
1186
|
-
node\_modules/.pnpm/custom-factory@2.3.0/node\_modules/custom-factory/lib/base-factory.d.ts:157
|