@taskmagic/apps-hugging-face 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/package.json +47 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +64 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/chat-completion.d.ts +18 -0
- package/src/lib/actions/chat-completion.js +537 -0
- package/src/lib/actions/chat-completion.js.map +1 -0
- package/src/lib/actions/create-image.d.ts +14 -0
- package/src/lib/actions/create-image.js +423 -0
- package/src/lib/actions/create-image.js.map +1 -0
- package/src/lib/actions/document-question-answering.d.ts +11 -0
- package/src/lib/actions/document-question-answering.js +140 -0
- package/src/lib/actions/document-question-answering.js.map +1 -0
- package/src/lib/actions/image-classification.d.ts +13 -0
- package/src/lib/actions/image-classification.js +592 -0
- package/src/lib/actions/image-classification.js.map +1 -0
- package/src/lib/actions/language-translation.d.ts +11 -0
- package/src/lib/actions/language-translation.js +222 -0
- package/src/lib/actions/language-translation.js.map +1 -0
- package/src/lib/actions/object-detection.d.ts +9 -0
- package/src/lib/actions/object-detection.js +464 -0
- package/src/lib/actions/object-detection.js.map +1 -0
- package/src/lib/actions/text-classification.d.ts +12 -0
- package/src/lib/actions/text-classification.js +344 -0
- package/src/lib/actions/text-classification.js.map +1 -0
- package/src/lib/actions/text-summarization.d.ts +12 -0
- package/src/lib/actions/text-summarization.js +420 -0
- package/src/lib/actions/text-summarization.js.map +1 -0
- package/src/lib/auth.d.ts +1 -0
- package/src/lib/auth.js +10 -0
- package/src/lib/auth.js.map +1 -0
- package/src/lib/common/index.d.ts +36 -0
- package/src/lib/common/index.js +78 -0
- package/src/lib/common/index.js.map +1 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textClassification = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@taskmagic/pieces-common");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.textClassification = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'text_classification',
|
|
11
|
+
auth: auth_1.huggingFaceAuth,
|
|
12
|
+
displayName: 'Text Classification',
|
|
13
|
+
description: 'Classify text into categories using Hugging Face models - includes zero-shot classification for custom categories',
|
|
14
|
+
props: {
|
|
15
|
+
classificationMode: pieces_framework_1.Property.StaticDropdown({
|
|
16
|
+
displayName: 'Classification Type',
|
|
17
|
+
description: 'Choose your classification approach',
|
|
18
|
+
required: true,
|
|
19
|
+
options: {
|
|
20
|
+
disabled: false,
|
|
21
|
+
options: [
|
|
22
|
+
{
|
|
23
|
+
label: '🎯 Zero-Shot (Custom Categories)',
|
|
24
|
+
value: 'zero-shot',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: '📊 Pre-trained Models',
|
|
28
|
+
value: 'pretrained',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: '🔍 Search All Models',
|
|
32
|
+
value: 'search',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
defaultValue: 'zero-shot',
|
|
37
|
+
}),
|
|
38
|
+
zeroShotModel: pieces_framework_1.Property.StaticDropdown({
|
|
39
|
+
displayName: 'Zero-Shot Model',
|
|
40
|
+
description: 'Model for classifying into your custom categories',
|
|
41
|
+
required: false,
|
|
42
|
+
options: {
|
|
43
|
+
disabled: false,
|
|
44
|
+
options: [
|
|
45
|
+
{
|
|
46
|
+
label: '🔥 Facebook BART-Large (5.4M downloads)',
|
|
47
|
+
value: 'facebook/bart-large-mnli',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: '🔥 DeBERTa TaskSource (904K downloads)',
|
|
51
|
+
value: 'sileod/deberta-v3-base-tasksource-nli',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: '🔥 DeBERTa MNLI-FEVER (668K downloads)',
|
|
55
|
+
value: 'MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: '🌍 DistilBERT Multilingual (520K downloads)',
|
|
59
|
+
value: 'lxyuan/distilbert-base-multilingual-cased-sentiments-student',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
defaultValue: 'facebook/bart-large-mnli',
|
|
64
|
+
}),
|
|
65
|
+
customLabels: pieces_framework_1.Property.LongText({
|
|
66
|
+
displayName: 'Custom Categories',
|
|
67
|
+
description: 'Enter categories separated by commas (e.g., "customer support, sales inquiry, spam, billing question")',
|
|
68
|
+
required: false,
|
|
69
|
+
}),
|
|
70
|
+
pretrainedModel: pieces_framework_1.Property.StaticDropdown({
|
|
71
|
+
displayName: 'Pre-trained Model',
|
|
72
|
+
description: 'Select a specialized pre-trained classification model',
|
|
73
|
+
required: false,
|
|
74
|
+
options: {
|
|
75
|
+
disabled: false,
|
|
76
|
+
options: [
|
|
77
|
+
// === SENTIMENT ANALYSIS ===
|
|
78
|
+
{
|
|
79
|
+
label: '😊 Sentiment: Twitter RoBERTa (3M downloads)',
|
|
80
|
+
value: 'cardiffnlp/twitter-roberta-base-sentiment-latest',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: '😊 Sentiment: DistilBERT SST-2 (2.9M downloads)',
|
|
84
|
+
value: 'distilbert/distilbert-base-uncased-finetuned-sst-2-english',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
label: '🌍 Sentiment: Multilingual BERT (1.7M downloads)',
|
|
88
|
+
value: 'nlptown/bert-base-multilingual-uncased-sentiment',
|
|
89
|
+
},
|
|
90
|
+
// === BUSINESS & FINANCE ===
|
|
91
|
+
{
|
|
92
|
+
label: '💰 Finance: FinBERT Sentiment (1.5M downloads)',
|
|
93
|
+
value: 'ProsusAI/finbert',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
label: '💰 Finance: FinBERT Tone (1.4M downloads)',
|
|
97
|
+
value: 'yiyanghkust/finbert-tone',
|
|
98
|
+
},
|
|
99
|
+
// === CONTENT MODERATION ===
|
|
100
|
+
{
|
|
101
|
+
label: '🛡️ Hate Speech: RoBERTa (2M downloads)',
|
|
102
|
+
value: 'facebook/roberta-hate-speech-dynabench-r4-target',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
label: '🛡️ Toxicity: HateBERT (1.1M downloads)',
|
|
106
|
+
value: 'tomh/toxigen_hatebert',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
label: '🛡️ Toxicity: ToxDect RoBERTa (1.1M downloads)',
|
|
110
|
+
value: 'Xuhui/ToxDect-roberta-large',
|
|
111
|
+
},
|
|
112
|
+
// === CUSTOMER SERVICE ===
|
|
113
|
+
{
|
|
114
|
+
label: '🎧 Customer Service: Banking Intent',
|
|
115
|
+
value: 'atulgupta002/banking_customer_service_query_intent_classifier',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: '📧 Spam: SMS Classification',
|
|
119
|
+
value: 'wesleyacheng/sms-spam-classification-with-bert',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
defaultValue: 'cardiffnlp/twitter-roberta-base-sentiment-latest',
|
|
124
|
+
}),
|
|
125
|
+
searchModel: pieces_framework_1.Property.Dropdown({
|
|
126
|
+
displayName: 'Search Models',
|
|
127
|
+
description: 'Search from all available text classification models',
|
|
128
|
+
required: false,
|
|
129
|
+
refreshers: [],
|
|
130
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
131
|
+
const popularModels = [
|
|
132
|
+
{
|
|
133
|
+
label: '🔥 Facebook BART Zero-Shot (5.4M downloads)',
|
|
134
|
+
value: 'facebook/bart-large-mnli',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: '🔥 Twitter Sentiment RoBERTa (3M downloads)',
|
|
138
|
+
value: 'cardiffnlp/twitter-roberta-base-sentiment-latest',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
label: '🔥 DistilBERT Sentiment (2.9M downloads)',
|
|
142
|
+
value: 'distilbert/distilbert-base-uncased-finetuned-sst-2-english',
|
|
143
|
+
},
|
|
144
|
+
];
|
|
145
|
+
if (!auth) {
|
|
146
|
+
return {
|
|
147
|
+
disabled: false,
|
|
148
|
+
options: popularModels,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
153
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
154
|
+
url: 'https://huggingface.co/api/models',
|
|
155
|
+
queryParams: {
|
|
156
|
+
filter: 'text-classification',
|
|
157
|
+
sort: 'downloads',
|
|
158
|
+
direction: '-1',
|
|
159
|
+
limit: '100',
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
const models = response.body;
|
|
163
|
+
const classificationModels = models
|
|
164
|
+
.filter((model) => model.pipeline_tag === 'text-classification' ||
|
|
165
|
+
model.pipeline_tag === 'zero-shot-classification')
|
|
166
|
+
.map((model) => {
|
|
167
|
+
var _a;
|
|
168
|
+
return ({
|
|
169
|
+
label: `${model.id} (${((_a = model.downloads) === null || _a === void 0 ? void 0 : _a.toLocaleString()) || 0} downloads)`,
|
|
170
|
+
value: model.id,
|
|
171
|
+
});
|
|
172
|
+
})
|
|
173
|
+
.slice(0, 50);
|
|
174
|
+
const allOptions = [
|
|
175
|
+
...popularModels,
|
|
176
|
+
...classificationModels.filter((model) => !popularModels.some((popular) => popular.value === model.value)),
|
|
177
|
+
];
|
|
178
|
+
return {
|
|
179
|
+
disabled: false,
|
|
180
|
+
options: allOptions,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
return {
|
|
185
|
+
disabled: false,
|
|
186
|
+
options: popularModels,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
}),
|
|
190
|
+
}),
|
|
191
|
+
text: pieces_framework_1.Property.LongText({
|
|
192
|
+
displayName: 'Text to Classify',
|
|
193
|
+
description: 'The text content you want to classify',
|
|
194
|
+
required: true,
|
|
195
|
+
}),
|
|
196
|
+
topK: pieces_framework_1.Property.Number({
|
|
197
|
+
displayName: 'Number of Results',
|
|
198
|
+
description: 'Number of top predictions to return',
|
|
199
|
+
required: false,
|
|
200
|
+
defaultValue: 3,
|
|
201
|
+
}),
|
|
202
|
+
functionToApply: pieces_framework_1.Property.StaticDropdown({
|
|
203
|
+
displayName: 'Output Function',
|
|
204
|
+
description: 'How to calculate confidence scores',
|
|
205
|
+
required: false,
|
|
206
|
+
options: {
|
|
207
|
+
disabled: false,
|
|
208
|
+
options: [
|
|
209
|
+
{ label: 'Softmax (Recommended)', value: 'softmax' },
|
|
210
|
+
{ label: 'Sigmoid', value: 'sigmoid' },
|
|
211
|
+
{ label: 'None (Raw Scores)', value: 'none' },
|
|
212
|
+
],
|
|
213
|
+
},
|
|
214
|
+
defaultValue: 'softmax',
|
|
215
|
+
}),
|
|
216
|
+
useCache: pieces_framework_1.Property.Checkbox({
|
|
217
|
+
displayName: 'Use Cache',
|
|
218
|
+
description: 'Use cached results for faster responses',
|
|
219
|
+
required: false,
|
|
220
|
+
defaultValue: true,
|
|
221
|
+
}),
|
|
222
|
+
waitForModel: pieces_framework_1.Property.Checkbox({
|
|
223
|
+
displayName: 'Wait for Model',
|
|
224
|
+
description: 'Wait for model to load if not immediately available',
|
|
225
|
+
required: false,
|
|
226
|
+
defaultValue: false,
|
|
227
|
+
}),
|
|
228
|
+
},
|
|
229
|
+
run(context) {
|
|
230
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
231
|
+
const { classificationMode, zeroShotModel, customLabels, pretrainedModel, searchModel, text, topK, functionToApply, useCache, waitForModel, } = context.propsValue;
|
|
232
|
+
// Determine which model to use
|
|
233
|
+
let modelToUse;
|
|
234
|
+
let isZeroShot = false;
|
|
235
|
+
switch (classificationMode) {
|
|
236
|
+
case 'zero-shot':
|
|
237
|
+
if (!(customLabels === null || customLabels === void 0 ? void 0 : customLabels.trim())) {
|
|
238
|
+
throw new Error('Please provide custom categories for zero-shot classification (e.g., "positive, negative, neutral")');
|
|
239
|
+
}
|
|
240
|
+
modelToUse = zeroShotModel || 'facebook/bart-large-mnli';
|
|
241
|
+
isZeroShot = true;
|
|
242
|
+
break;
|
|
243
|
+
case 'pretrained':
|
|
244
|
+
modelToUse =
|
|
245
|
+
pretrainedModel || 'cardiffnlp/twitter-roberta-base-sentiment-latest';
|
|
246
|
+
break;
|
|
247
|
+
case 'search':
|
|
248
|
+
if (!searchModel) {
|
|
249
|
+
throw new Error('Please select a model from the search dropdown');
|
|
250
|
+
}
|
|
251
|
+
modelToUse = searchModel;
|
|
252
|
+
break;
|
|
253
|
+
default:
|
|
254
|
+
modelToUse = zeroShotModel || 'facebook/bart-large-mnli';
|
|
255
|
+
isZeroShot = true;
|
|
256
|
+
}
|
|
257
|
+
const options = {
|
|
258
|
+
use_cache: useCache !== null && useCache !== void 0 ? useCache : true,
|
|
259
|
+
wait_for_model: waitForModel !== null && waitForModel !== void 0 ? waitForModel : false,
|
|
260
|
+
};
|
|
261
|
+
if (isZeroShot) {
|
|
262
|
+
// Handle zero-shot classification
|
|
263
|
+
const labels = (customLabels || '')
|
|
264
|
+
.split(',')
|
|
265
|
+
.map((label) => label.trim())
|
|
266
|
+
.filter((label) => label.length > 0);
|
|
267
|
+
if (labels.length === 0) {
|
|
268
|
+
throw new Error('Please provide at least one category for zero-shot classification');
|
|
269
|
+
}
|
|
270
|
+
const zeroShotRaw = yield (0, common_1.callPipelineTask)({
|
|
271
|
+
auth: context.auth,
|
|
272
|
+
model: modelToUse,
|
|
273
|
+
body: {
|
|
274
|
+
inputs: text,
|
|
275
|
+
parameters: {
|
|
276
|
+
candidate_labels: labels,
|
|
277
|
+
},
|
|
278
|
+
options,
|
|
279
|
+
},
|
|
280
|
+
});
|
|
281
|
+
// Normalize into an array of {label, score} objects
|
|
282
|
+
const classifications = zeroShotRaw.labels.map((label, index) => ({
|
|
283
|
+
label,
|
|
284
|
+
score: zeroShotRaw.scores[index],
|
|
285
|
+
}));
|
|
286
|
+
// Sort by score and limit to topK
|
|
287
|
+
const sortedResults = classifications
|
|
288
|
+
.sort((a, b) => b.score - a.score)
|
|
289
|
+
.slice(0, topK || 3);
|
|
290
|
+
return {
|
|
291
|
+
predictions: sortedResults,
|
|
292
|
+
topPrediction: sortedResults[0],
|
|
293
|
+
text: text,
|
|
294
|
+
model: modelToUse,
|
|
295
|
+
classificationMode: 'zero-shot',
|
|
296
|
+
customCategories: labels,
|
|
297
|
+
confidenceThreshold: 0.5,
|
|
298
|
+
highConfidencePredictions: sortedResults.filter((r) => r.score > 0.5),
|
|
299
|
+
rawResult: zeroShotRaw,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
// Handle regular text classification
|
|
304
|
+
const parameters = {};
|
|
305
|
+
if (topK !== undefined && topK > 0) {
|
|
306
|
+
parameters.top_k = topK;
|
|
307
|
+
}
|
|
308
|
+
if (functionToApply &&
|
|
309
|
+
(functionToApply === 'softmax' ||
|
|
310
|
+
functionToApply === 'sigmoid' ||
|
|
311
|
+
functionToApply === 'none')) {
|
|
312
|
+
parameters.function_to_apply = functionToApply;
|
|
313
|
+
}
|
|
314
|
+
const body = {
|
|
315
|
+
inputs: text,
|
|
316
|
+
options,
|
|
317
|
+
};
|
|
318
|
+
if (Object.keys(parameters).length > 0) {
|
|
319
|
+
body['parameters'] = parameters;
|
|
320
|
+
}
|
|
321
|
+
const classificationResult = yield (0, common_1.callPipelineTask)({
|
|
322
|
+
auth: context.auth,
|
|
323
|
+
model: modelToUse,
|
|
324
|
+
body,
|
|
325
|
+
});
|
|
326
|
+
// The API may return either an array of {label, score} or a nested array
|
|
327
|
+
const results = Array.isArray(classificationResult[0])
|
|
328
|
+
? classificationResult[0]
|
|
329
|
+
: classificationResult;
|
|
330
|
+
return {
|
|
331
|
+
predictions: results,
|
|
332
|
+
topPrediction: results[0],
|
|
333
|
+
text: text,
|
|
334
|
+
model: modelToUse,
|
|
335
|
+
classificationMode: 'pretrained',
|
|
336
|
+
confidenceThreshold: 0.5,
|
|
337
|
+
highConfidencePredictions: results.filter((r) => r.score > 0.5),
|
|
338
|
+
rawResult: classificationResult,
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
},
|
|
343
|
+
});
|
|
344
|
+
//# sourceMappingURL=text-classification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-classification.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/hugging-face/src/lib/actions/text-classification.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAkE;AAClE,kCAA0C;AAC1C,sCAA6C;AAShC,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,sBAAe;IACrB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EACT,mHAAmH;IACrH,KAAK,EAAE;QACL,kBAAkB,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC1C,WAAW,EAAE,qBAAqB;YAClC,WAAW,EAAE,qCAAqC;YAClD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,kCAAkC;wBACzC,KAAK,EAAE,WAAW;qBACnB;oBACD;wBACE,KAAK,EAAE,uBAAuB;wBAC9B,KAAK,EAAE,YAAY;qBACpB;oBACD;wBACE,KAAK,EAAE,sBAAsB;wBAC7B,KAAK,EAAE,QAAQ;qBAChB;iBACF;aACF;YACD,YAAY,EAAE,WAAW;SAC1B,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,cAAc,C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A4B;oBACpC,MAAM,EAAE,IAAI;oBACZ,OAAO;iBACR,CAAC;gBAEF,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACvC,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;gBAClC,CAAC;gBAED,MAAM,oBAAoB,GAAG,MAAM,IAAA,yBAAgB,EAEjD;oBACA,IAAI,EAAE,OAAO,CAAC,IAAc;oBAC5B,KAAK,EAAE,UAAU;oBACjB,IAAI;iBACL,CAAC,CAAC;gBAEH,yEAAyE;gBACzE,MAAM,OAAO,GAAiB,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;oBAClE,CAAC,CAAE,oBAAoB,CAAC,CAAC,CAAkB;oBAC3C,CAAC,CAAE,oBAAqC,CAAC;gBAE3C,OAAO;oBACL,WAAW,EAAE,OAAO;oBACpB,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;oBACzB,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,UAAU;oBACjB,kBAAkB,EAAE,YAAY;oBAChC,mBAAmB,EAAE,GAAG;oBACxB,yBAAyB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC;oBAC/D,SAAS,EAAE,oBAAoB;iBAChC,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const textSummarization: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
contentType: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
|
|
3
|
+
model: import("@taskmagic/pieces-framework").DropdownProperty<string, true>;
|
|
4
|
+
text: import("@taskmagic/pieces-framework").LongTextProperty<true>;
|
|
5
|
+
summaryLength: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
|
|
6
|
+
customMinLength: import("@taskmagic/pieces-framework").NumberProperty<false>;
|
|
7
|
+
customMaxLength: import("@taskmagic/pieces-framework").NumberProperty<false>;
|
|
8
|
+
cleanUpSpaces: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
|
|
9
|
+
truncationStrategy: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, false>;
|
|
10
|
+
useCache: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
|
|
11
|
+
waitForModel: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
|
|
12
|
+
}>;
|