@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,212 @@
1
+ [@isdk/ai-tool](../README.md) / [Exports](../modules.md) / HFEnvironment
2
+
3
+ # Class: HFEnvironment
4
+
5
+ ## Hierarchy
6
+
7
+ - `Environment`
8
+
9
+ ↳ **`HFEnvironment`**
10
+
11
+ ## Table of contents
12
+
13
+ ### Constructors
14
+
15
+ - [constructor](HFEnvironment.md#constructor)
16
+
17
+ ### Properties
18
+
19
+ - [parent](HFEnvironment.md#parent)
20
+ - [tests](HFEnvironment.md#tests)
21
+ - [variables](HFEnvironment.md#variables)
22
+
23
+ ### Methods
24
+
25
+ - [assign](HFEnvironment.md#assign)
26
+ - [clear](HFEnvironment.md#clear)
27
+ - [lookupVariable](HFEnvironment.md#lookupvariable)
28
+ - [set](HFEnvironment.md#set)
29
+ - [setVariable](HFEnvironment.md#setvariable)
30
+
31
+ ## Constructors
32
+
33
+ ### constructor
34
+
35
+ • **new HFEnvironment**(`parent?`): [`HFEnvironment`](HFEnvironment.md)
36
+
37
+ #### Parameters
38
+
39
+ | Name | Type |
40
+ | :------ | :------ |
41
+ | `parent?` | [`HFEnvironment`](HFEnvironment.md) |
42
+
43
+ #### Returns
44
+
45
+ [`HFEnvironment`](HFEnvironment.md)
46
+
47
+ #### Overrides
48
+
49
+ Environment.constructor
50
+
51
+ #### Defined in
52
+
53
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/index.ts:22](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/index.ts#L22)
54
+
55
+ ## Properties
56
+
57
+ ### parent
58
+
59
+ • `Optional` **parent**: [`HFEnvironment`](HFEnvironment.md)
60
+
61
+ #### Inherited from
62
+
63
+ Environment.parent
64
+
65
+ #### Defined in
66
+
67
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/index.ts:22](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/index.ts#L22)
68
+
69
+ ___
70
+
71
+ ### tests
72
+
73
+ • **tests**: `Map`\<`string`, (...`value`: `AnyRuntimeValue`[]) => `boolean`\>
74
+
75
+ The tests available in this environment.
76
+
77
+ #### Inherited from
78
+
79
+ Environment.tests
80
+
81
+ #### Defined in
82
+
83
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:267](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L267)
84
+
85
+ ___
86
+
87
+ ### variables
88
+
89
+ • **variables**: `Map`\<`string`, `AnyRuntimeValue`\>
90
+
91
+ The variables declared in this environment.
92
+
93
+ #### Inherited from
94
+
95
+ Environment.variables
96
+
97
+ #### Defined in
98
+
99
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:249](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L249)
100
+
101
+ ## Methods
102
+
103
+ ### assign
104
+
105
+ ▸ **assign**(`items`): `void`
106
+
107
+ #### Parameters
108
+
109
+ | Name | Type |
110
+ | :------ | :------ |
111
+ | `items` | `Record`\<`string`, `unknown`\> |
112
+
113
+ #### Returns
114
+
115
+ `void`
116
+
117
+ #### Defined in
118
+
119
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/index.ts:26](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/index.ts#L26)
120
+
121
+ ___
122
+
123
+ ### clear
124
+
125
+ ▸ **clear**(): `void`
126
+
127
+ #### Returns
128
+
129
+ `void`
130
+
131
+ #### Defined in
132
+
133
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/index.ts:32](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/index.ts#L32)
134
+
135
+ ___
136
+
137
+ ### lookupVariable
138
+
139
+ ▸ **lookupVariable**(`name`): `AnyRuntimeValue`
140
+
141
+ #### Parameters
142
+
143
+ | Name | Type |
144
+ | :------ | :------ |
145
+ | `name` | `string` |
146
+
147
+ #### Returns
148
+
149
+ `AnyRuntimeValue`
150
+
151
+ #### Inherited from
152
+
153
+ Environment.lookupVariable
154
+
155
+ #### Defined in
156
+
157
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:363](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L363)
158
+
159
+ ___
160
+
161
+ ### set
162
+
163
+ ▸ **set**(`name`, `value`): `AnyRuntimeValue`
164
+
165
+ Set the value of a variable in the current environment.
166
+
167
+ #### Parameters
168
+
169
+ | Name | Type |
170
+ | :------ | :------ |
171
+ | `name` | `string` |
172
+ | `value` | `unknown` |
173
+
174
+ #### Returns
175
+
176
+ `AnyRuntimeValue`
177
+
178
+ #### Inherited from
179
+
180
+ Environment.set
181
+
182
+ #### Defined in
183
+
184
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:318](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L318)
185
+
186
+ ___
187
+
188
+ ### setVariable
189
+
190
+ ▸ **setVariable**(`name`, `value`): `AnyRuntimeValue`
191
+
192
+ Set variable in the current scope.
193
+ See https://jinja.palletsprojects.com/en/3.0.x/templates/#assignments for more information.
194
+
195
+ #### Parameters
196
+
197
+ | Name | Type |
198
+ | :------ | :------ |
199
+ | `name` | `string` |
200
+ | `value` | `AnyRuntimeValue` |
201
+
202
+ #### Returns
203
+
204
+ `AnyRuntimeValue`
205
+
206
+ #### Inherited from
207
+
208
+ Environment.setVariable
209
+
210
+ #### Defined in
211
+
212
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:340](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L340)
@@ -0,0 +1,386 @@
1
+ [@isdk/ai-tool](../README.md) / [Exports](../modules.md) / HFInterpreter
2
+
3
+ # Class: HFInterpreter
4
+
5
+ ## Table of contents
6
+
7
+ ### Constructors
8
+
9
+ - [constructor](HFInterpreter.md#constructor)
10
+
11
+ ### Properties
12
+
13
+ - [global](HFInterpreter.md#global)
14
+
15
+ ### Methods
16
+
17
+ - [evalProgram](HFInterpreter.md#evalprogram)
18
+ - [evaluate](HFInterpreter.md#evaluate)
19
+ - [evaluateBinaryExpression](HFInterpreter.md#evaluatebinaryexpression)
20
+ - [evaluateBlock](HFInterpreter.md#evaluateblock)
21
+ - [evaluateCallExpression](HFInterpreter.md#evaluatecallexpression)
22
+ - [evaluateFilterExpression](HFInterpreter.md#evaluatefilterexpression)
23
+ - [evaluateFor](HFInterpreter.md#evaluatefor)
24
+ - [evaluateIdentifier](HFInterpreter.md#evaluateidentifier)
25
+ - [evaluateIf](HFInterpreter.md#evaluateif)
26
+ - [evaluateMemberExpression](HFInterpreter.md#evaluatememberexpression)
27
+ - [evaluateSet](HFInterpreter.md#evaluateset)
28
+ - [evaluateSliceExpression](HFInterpreter.md#evaluatesliceexpression)
29
+ - [evaluateTestExpression](HFInterpreter.md#evaluatetestexpression)
30
+ - [evaluateUnaryExpression](HFInterpreter.md#evaluateunaryexpression)
31
+ - [run](HFInterpreter.md#run)
32
+
33
+ ## Constructors
34
+
35
+ ### constructor
36
+
37
+ • **new HFInterpreter**(`env?`): [`HFInterpreter`](HFInterpreter.md)
38
+
39
+ #### Parameters
40
+
41
+ | Name | Type |
42
+ | :------ | :------ |
43
+ | `env?` | `Environment` |
44
+
45
+ #### Returns
46
+
47
+ [`HFInterpreter`](HFInterpreter.md)
48
+
49
+ #### Defined in
50
+
51
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:375](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L375)
52
+
53
+ ## Properties
54
+
55
+ ### global
56
+
57
+ • **global**: `Environment`
58
+
59
+ #### Defined in
60
+
61
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:373](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L373)
62
+
63
+ ## Methods
64
+
65
+ ### evalProgram
66
+
67
+ ▸ **evalProgram**(`program`, `environment`): `StringValue`
68
+
69
+ #### Parameters
70
+
71
+ | Name | Type |
72
+ | :------ | :------ |
73
+ | `program` | `Program` |
74
+ | `environment` | `Environment` |
75
+
76
+ #### Returns
77
+
78
+ `StringValue`
79
+
80
+ #### Defined in
81
+
82
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:673](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L673)
83
+
84
+ ___
85
+
86
+ ### evaluate
87
+
88
+ ▸ **evaluate**(`statement`, `environment`): `AnyRuntimeValue`
89
+
90
+ #### Parameters
91
+
92
+ | Name | Type |
93
+ | :------ | :------ |
94
+ | `statement` | `undefined` \| `Statement` |
95
+ | `environment` | `Environment` |
96
+
97
+ #### Returns
98
+
99
+ `AnyRuntimeValue`
100
+
101
+ #### Defined in
102
+
103
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:881](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L881)
104
+
105
+ ___
106
+
107
+ ### evaluateBinaryExpression
108
+
109
+ ▸ **evaluateBinaryExpression**(`node`, `environment`): `AnyRuntimeValue`
110
+
111
+ Evaluates expressions following the binary operation type.
112
+
113
+ #### Parameters
114
+
115
+ | Name | Type |
116
+ | :------ | :------ |
117
+ | `node` | `BinaryExpression` |
118
+ | `environment` | `Environment` |
119
+
120
+ #### Returns
121
+
122
+ `AnyRuntimeValue`
123
+
124
+ #### Defined in
125
+
126
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:389](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L389)
127
+
128
+ ___
129
+
130
+ ### evaluateBlock
131
+
132
+ ▸ **evaluateBlock**(`statements`, `environment`): `StringValue`
133
+
134
+ #### Parameters
135
+
136
+ | Name | Type |
137
+ | :------ | :------ |
138
+ | `statements` | `Statement`[] |
139
+ | `environment` | `Environment` |
140
+
141
+ #### Returns
142
+
143
+ `StringValue`
144
+
145
+ #### Defined in
146
+
147
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:677](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L677)
148
+
149
+ ___
150
+
151
+ ### evaluateCallExpression
152
+
153
+ ▸ **evaluateCallExpression**(`expr`, `environment`): `AnyRuntimeValue`
154
+
155
+ #### Parameters
156
+
157
+ | Name | Type |
158
+ | :------ | :------ |
159
+ | `expr` | `CallExpression` |
160
+ | `environment` | `Environment` |
161
+
162
+ #### Returns
163
+
164
+ `AnyRuntimeValue`
165
+
166
+ #### Defined in
167
+
168
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:697](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L697)
169
+
170
+ ___
171
+
172
+ ### evaluateFilterExpression
173
+
174
+ ▸ **evaluateFilterExpression**(`node`, `environment`): `AnyRuntimeValue`
175
+
176
+ Evaluates expressions following the filter operation type.
177
+
178
+ #### Parameters
179
+
180
+ | Name | Type |
181
+ | :------ | :------ |
182
+ | `node` | `FilterExpression` |
183
+ | `environment` | `Environment` |
184
+
185
+ #### Returns
186
+
187
+ `AnyRuntimeValue`
188
+
189
+ #### Defined in
190
+
191
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:487](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L487)
192
+
193
+ ___
194
+
195
+ ### evaluateFor
196
+
197
+ ▸ **evaluateFor**(`node`, `environment`): `StringValue`
198
+
199
+ #### Parameters
200
+
201
+ | Name | Type |
202
+ | :------ | :------ |
203
+ | `node` | `For` |
204
+ | `environment` | `Environment` |
205
+
206
+ #### Returns
207
+
208
+ `StringValue`
209
+
210
+ #### Defined in
211
+
212
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:821](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L821)
213
+
214
+ ___
215
+
216
+ ### evaluateIdentifier
217
+
218
+ ▸ **evaluateIdentifier**(`node`, `environment`): `AnyRuntimeValue`
219
+
220
+ #### Parameters
221
+
222
+ | Name | Type |
223
+ | :------ | :------ |
224
+ | `node` | `Identifier` |
225
+ | `environment` | `Environment` |
226
+
227
+ #### Returns
228
+
229
+ `AnyRuntimeValue`
230
+
231
+ #### Defined in
232
+
233
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:693](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L693)
234
+
235
+ ___
236
+
237
+ ### evaluateIf
238
+
239
+ ▸ **evaluateIf**(`node`, `environment`): `StringValue`
240
+
241
+ #### Parameters
242
+
243
+ | Name | Type |
244
+ | :------ | :------ |
245
+ | `node` | `If` |
246
+ | `environment` | `Environment` |
247
+
248
+ #### Returns
249
+
250
+ `StringValue`
251
+
252
+ #### Defined in
253
+
254
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:816](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L816)
255
+
256
+ ___
257
+
258
+ ### evaluateMemberExpression
259
+
260
+ ▸ **evaluateMemberExpression**(`expr`, `environment`): `AnyRuntimeValue`
261
+
262
+ #### Parameters
263
+
264
+ | Name | Type |
265
+ | :------ | :------ |
266
+ | `expr` | `MemberExpression` |
267
+ | `environment` | `Environment` |
268
+
269
+ #### Returns
270
+
271
+ `AnyRuntimeValue`
272
+
273
+ #### Defined in
274
+
275
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:752](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L752)
276
+
277
+ ___
278
+
279
+ ### evaluateSet
280
+
281
+ ▸ **evaluateSet**(`node`, `environment`): `NullValue`
282
+
283
+ #### Parameters
284
+
285
+ | Name | Type |
286
+ | :------ | :------ |
287
+ | `node` | `SetStatement` |
288
+ | `environment` | `Environment` |
289
+
290
+ #### Returns
291
+
292
+ `NullValue`
293
+
294
+ #### Defined in
295
+
296
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:793](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L793)
297
+
298
+ ___
299
+
300
+ ### evaluateSliceExpression
301
+
302
+ ▸ **evaluateSliceExpression**(`object`, `expr`, `environment`): `StringValue` \| `ArrayValue`
303
+
304
+ #### Parameters
305
+
306
+ | Name | Type |
307
+ | :------ | :------ |
308
+ | `object` | `AnyRuntimeValue` |
309
+ | `expr` | `SliceExpression` |
310
+ | `environment` | `Environment` |
311
+
312
+ #### Returns
313
+
314
+ `StringValue` \| `ArrayValue`
315
+
316
+ #### Defined in
317
+
318
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:721](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L721)
319
+
320
+ ___
321
+
322
+ ### evaluateTestExpression
323
+
324
+ ▸ **evaluateTestExpression**(`node`, `environment`): `BooleanValue`
325
+
326
+ Evaluates expressions following the test operation type.
327
+
328
+ #### Parameters
329
+
330
+ | Name | Type |
331
+ | :------ | :------ |
332
+ | `node` | `TestExpression` |
333
+ | `environment` | `Environment` |
334
+
335
+ #### Returns
336
+
337
+ `BooleanValue`
338
+
339
+ #### Defined in
340
+
341
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:644](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L644)
342
+
343
+ ___
344
+
345
+ ### evaluateUnaryExpression
346
+
347
+ ▸ **evaluateUnaryExpression**(`node`, `environment`): `AnyRuntimeValue`
348
+
349
+ Evaluates expressions following the unary operation type.
350
+
351
+ #### Parameters
352
+
353
+ | Name | Type |
354
+ | :------ | :------ |
355
+ | `node` | `UnaryExpression` |
356
+ | `environment` | `Environment` |
357
+
358
+ #### Returns
359
+
360
+ `AnyRuntimeValue`
361
+
362
+ #### Defined in
363
+
364
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:662](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L662)
365
+
366
+ ___
367
+
368
+ ### run
369
+
370
+ ▸ **run**(`program`): `AnyRuntimeValue`
371
+
372
+ Run the program.
373
+
374
+ #### Parameters
375
+
376
+ | Name | Type |
377
+ | :------ | :------ |
378
+ | `program` | `Program` |
379
+
380
+ #### Returns
381
+
382
+ `AnyRuntimeValue`
383
+
384
+ #### Defined in
385
+
386
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/runtime.ts:382](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/runtime.ts#L382)
@@ -0,0 +1,79 @@
1
+ [@isdk/ai-tool](../README.md) / [Exports](../modules.md) / HFTemplate
2
+
3
+ # Class: HFTemplate
4
+
5
+ ## Table of contents
6
+
7
+ ### Constructors
8
+
9
+ - [constructor](HFTemplate.md#constructor)
10
+
11
+ ### Properties
12
+
13
+ - [parsed](HFTemplate.md#parsed)
14
+ - [global](HFTemplate.md#global)
15
+
16
+ ### Methods
17
+
18
+ - [render](HFTemplate.md#render)
19
+
20
+ ## Constructors
21
+
22
+ ### constructor
23
+
24
+ • **new HFTemplate**(`template`, `options?`): [`HFTemplate`](HFTemplate.md)
25
+
26
+ #### Parameters
27
+
28
+ | Name | Type | Description |
29
+ | :------ | :------ | :------ |
30
+ | `template` | `string` | The template string |
31
+ | `options` | `PreprocessOptions` | - |
32
+
33
+ #### Returns
34
+
35
+ [`HFTemplate`](HFTemplate.md)
36
+
37
+ #### Defined in
38
+
39
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/index.ts:45](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/index.ts#L45)
40
+
41
+ ## Properties
42
+
43
+ ### parsed
44
+
45
+ • **parsed**: `Program`
46
+
47
+ #### Defined in
48
+
49
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/index.ts:38](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/index.ts#L38)
50
+
51
+ ___
52
+
53
+ ### global
54
+
55
+ ▪ `Static` **global**: [`HFEnvironment`](HFEnvironment.md)
56
+
57
+ #### Defined in
58
+
59
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/index.ts:40](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/index.ts#L40)
60
+
61
+ ## Methods
62
+
63
+ ### render
64
+
65
+ ▸ **render**(`items`): `string`
66
+
67
+ #### Parameters
68
+
69
+ | Name | Type |
70
+ | :------ | :------ |
71
+ | `items` | `Record`\<`string`, `unknown`\> |
72
+
73
+ #### Returns
74
+
75
+ `string`
76
+
77
+ #### Defined in
78
+
79
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/index.ts:55](https://github.com/isdk/ai-tool.js/blob/e7fb80e8b32da0eb475b223017e88d973ef7af19/src/utils/prompt/template/jinja/src/index.ts#L55)