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