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