@adminforth/bulk-ai-flow 1.23.11 → 1.23.13
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/build.log +2 -2
- package/custom/VisionAction.vue +8 -2
- package/dist/custom/VisionAction.vue +8 -2
- package/dist/index.js +3 -3
- package/index.ts +3 -3
- package/package.json +1 -1
package/build.log
CHANGED
|
@@ -14,5 +14,5 @@ custom/package.json
|
|
|
14
14
|
custom/pnpm-lock.yaml
|
|
15
15
|
custom/tsconfig.json
|
|
16
16
|
|
|
17
|
-
sent 111,
|
|
18
|
-
total size is
|
|
17
|
+
sent 111,824 bytes received 191 bytes 224,030.00 bytes/sec
|
|
18
|
+
total size is 111,108 speedup is 0.99
|
package/custom/VisionAction.vue
CHANGED
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
{
|
|
68
68
|
label: t('Start generation'),
|
|
69
69
|
options: {
|
|
70
|
-
class: 'w-3/5 px-5 py-2.5 bg-gradient-to-r from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-purple-300 dark:focus:ring-purple-800 rounded-md text-white border-none'
|
|
70
|
+
class: 'w-3/5 px-5 py-2.5 bg-gradient-to-r from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-purple-300 dark:focus:ring-purple-800 rounded-md text-white border-none',
|
|
71
|
+
loader: isCheckingRateLimits
|
|
71
72
|
},
|
|
72
73
|
onclick: (dialog) => { runAiActions(); }
|
|
73
74
|
}
|
|
@@ -198,6 +199,7 @@
|
|
|
198
199
|
</Dialog>
|
|
199
200
|
</template>
|
|
200
201
|
|
|
202
|
+
|
|
201
203
|
<script lang="ts" setup>
|
|
202
204
|
import { callAdminForthApi } from '@/utils';
|
|
203
205
|
import { ref, computed, nextTick } from 'vue'
|
|
@@ -283,6 +285,7 @@ const completedRecordIds = ref<Set<string>>(new Set());
|
|
|
283
285
|
const isActiveGeneration = ref(false);
|
|
284
286
|
const pauseBreakpoints = computed(() => props.meta.askConfirmation || []);
|
|
285
287
|
const startedRecordCount = ref(0);
|
|
288
|
+
const isCheckingRateLimits = ref(false);
|
|
286
289
|
let startGate = Promise.resolve();
|
|
287
290
|
const tableRef = ref<any>(null);
|
|
288
291
|
const processedCount = computed(() => {
|
|
@@ -383,11 +386,11 @@ async function getListOfIds() {
|
|
|
383
386
|
|
|
384
387
|
|
|
385
388
|
async function runAiActions() {
|
|
386
|
-
popupMode.value = 'generation';
|
|
387
389
|
if (!await checkRateLimits()) {
|
|
388
390
|
confirmDialog.value.close();
|
|
389
391
|
return;
|
|
390
392
|
}
|
|
393
|
+
popupMode.value = 'generation';
|
|
391
394
|
isGenerationCancelled.value = false;
|
|
392
395
|
isGenerationPaused.value = false;
|
|
393
396
|
isActiveGeneration.value = true;
|
|
@@ -639,6 +642,7 @@ async function processOneRecord(recordId: string) {
|
|
|
639
642
|
}
|
|
640
643
|
|
|
641
644
|
async function checkRateLimits() {
|
|
645
|
+
isCheckingRateLimits.value = true;
|
|
642
646
|
const actionsToCheck: Array<'generate_images' | 'analyze' | 'analyze_no_images'> = [];
|
|
643
647
|
if (props.meta.isImageGeneration) {
|
|
644
648
|
actionsToCheck.push('generate_images');
|
|
@@ -670,9 +674,11 @@ async function checkRateLimits() {
|
|
|
670
674
|
variant: 'danger',
|
|
671
675
|
timeout: 'unlimited',
|
|
672
676
|
});
|
|
677
|
+
isCheckingRateLimits.value = false;
|
|
673
678
|
return false;
|
|
674
679
|
}
|
|
675
680
|
}
|
|
681
|
+
isCheckingRateLimits.value = false;
|
|
676
682
|
return true;
|
|
677
683
|
}
|
|
678
684
|
|
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
{
|
|
68
68
|
label: t('Start generation'),
|
|
69
69
|
options: {
|
|
70
|
-
class: 'w-3/5 px-5 py-2.5 bg-gradient-to-r from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-purple-300 dark:focus:ring-purple-800 rounded-md text-white border-none'
|
|
70
|
+
class: 'w-3/5 px-5 py-2.5 bg-gradient-to-r from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-purple-300 dark:focus:ring-purple-800 rounded-md text-white border-none',
|
|
71
|
+
loader: isCheckingRateLimits
|
|
71
72
|
},
|
|
72
73
|
onclick: (dialog) => { runAiActions(); }
|
|
73
74
|
}
|
|
@@ -198,6 +199,7 @@
|
|
|
198
199
|
</Dialog>
|
|
199
200
|
</template>
|
|
200
201
|
|
|
202
|
+
|
|
201
203
|
<script lang="ts" setup>
|
|
202
204
|
import { callAdminForthApi } from '@/utils';
|
|
203
205
|
import { ref, computed, nextTick } from 'vue'
|
|
@@ -283,6 +285,7 @@ const completedRecordIds = ref<Set<string>>(new Set());
|
|
|
283
285
|
const isActiveGeneration = ref(false);
|
|
284
286
|
const pauseBreakpoints = computed(() => props.meta.askConfirmation || []);
|
|
285
287
|
const startedRecordCount = ref(0);
|
|
288
|
+
const isCheckingRateLimits = ref(false);
|
|
286
289
|
let startGate = Promise.resolve();
|
|
287
290
|
const tableRef = ref<any>(null);
|
|
288
291
|
const processedCount = computed(() => {
|
|
@@ -383,11 +386,11 @@ async function getListOfIds() {
|
|
|
383
386
|
|
|
384
387
|
|
|
385
388
|
async function runAiActions() {
|
|
386
|
-
popupMode.value = 'generation';
|
|
387
389
|
if (!await checkRateLimits()) {
|
|
388
390
|
confirmDialog.value.close();
|
|
389
391
|
return;
|
|
390
392
|
}
|
|
393
|
+
popupMode.value = 'generation';
|
|
391
394
|
isGenerationCancelled.value = false;
|
|
392
395
|
isGenerationPaused.value = false;
|
|
393
396
|
isActiveGeneration.value = true;
|
|
@@ -639,6 +642,7 @@ async function processOneRecord(recordId: string) {
|
|
|
639
642
|
}
|
|
640
643
|
|
|
641
644
|
async function checkRateLimits() {
|
|
645
|
+
isCheckingRateLimits.value = true;
|
|
642
646
|
const actionsToCheck: Array<'generate_images' | 'analyze' | 'analyze_no_images'> = [];
|
|
643
647
|
if (props.meta.isImageGeneration) {
|
|
644
648
|
actionsToCheck.push('generate_images');
|
|
@@ -670,9 +674,11 @@ async function checkRateLimits() {
|
|
|
670
674
|
variant: 'danger',
|
|
671
675
|
timeout: 'unlimited',
|
|
672
676
|
});
|
|
677
|
+
isCheckingRateLimits.value = false;
|
|
673
678
|
return false;
|
|
674
679
|
}
|
|
675
680
|
}
|
|
681
|
+
isCheckingRateLimits.value = false;
|
|
676
682
|
return true;
|
|
677
683
|
}
|
|
678
684
|
|
package/dist/index.js
CHANGED
|
@@ -108,7 +108,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
108
108
|
analyze_image(jobId_1, recordId_1, adminUser_1, headers_1, customPrompt_1) {
|
|
109
109
|
return __awaiter(this, arguments, void 0, function* (jobId, recordId, adminUser, headers, customPrompt, filterFilledFields = true) {
|
|
110
110
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
111
|
-
if (yield this.checkRateLimit("fillFieldsFromImages", this.options.rateLimits.fillFieldsFromImages, headers)) {
|
|
111
|
+
if (this.options.rateLimits && this.options.rateLimits.fillFieldsFromImages && (yield this.checkRateLimit("fillFieldsFromImages", this.options.rateLimits.fillFieldsFromImages, headers))) {
|
|
112
112
|
jobs.set(jobId, { status: 'failed', error: "Rate limit exceeded" });
|
|
113
113
|
return { error: "Rate limit exceeded" };
|
|
114
114
|
}
|
|
@@ -194,7 +194,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
194
194
|
}
|
|
195
195
|
analyzeNoImages(jobId_1, recordId_1, adminUser_1, headers_1, customPrompt_1) {
|
|
196
196
|
return __awaiter(this, arguments, void 0, function* (jobId, recordId, adminUser, headers, customPrompt, filterFilledFields = true) {
|
|
197
|
-
if (yield this.checkRateLimit("fillPlainFields", this.options.rateLimits.fillPlainFields, headers)) {
|
|
197
|
+
if (this.options.rateLimits && this.options.rateLimits.fillPlainFields && (yield this.checkRateLimit("fillPlainFields", this.options.rateLimits.fillPlainFields, headers))) {
|
|
198
198
|
jobs.set(jobId, { status: 'failed', error: "Rate limit exceeded" });
|
|
199
199
|
return { error: "Rate limit exceeded" };
|
|
200
200
|
}
|
|
@@ -257,7 +257,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
257
257
|
initialImageGenerate(jobId_1, recordId_1, adminUser_1, headers_1, customPrompt_1) {
|
|
258
258
|
return __awaiter(this, arguments, void 0, function* (jobId, recordId, adminUser, headers, customPrompt, filterFilledFields = true) {
|
|
259
259
|
var _a, _b;
|
|
260
|
-
if (yield this.checkRateLimit("generateImages", this.options.rateLimits.generateImages, headers)) {
|
|
260
|
+
if (this.options.rateLimits && this.options.rateLimits.generateImages && (yield this.checkRateLimit("generateImages", this.options.rateLimits.generateImages, headers))) {
|
|
261
261
|
jobs.set(jobId, { status: 'failed', error: "Rate limit exceeded" });
|
|
262
262
|
return { error: "Rate limit exceeded" };
|
|
263
263
|
}
|
package/index.ts
CHANGED
|
@@ -109,7 +109,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
private async analyze_image(jobId: string, recordId: string, adminUser: any, headers: Record<string, string | string[] | undefined>, customPrompt? : string, filterFilledFields: boolean = true) {
|
|
112
|
-
if (await this.checkRateLimit("fillFieldsFromImages" ,this.options.rateLimits.fillFieldsFromImages, headers)) {
|
|
112
|
+
if (this.options.rateLimits && this.options.rateLimits.fillFieldsFromImages && await this.checkRateLimit("fillFieldsFromImages" ,this.options.rateLimits.fillFieldsFromImages, headers)) {
|
|
113
113
|
jobs.set(jobId, { status: 'failed', error: "Rate limit exceeded" });
|
|
114
114
|
return { error: "Rate limit exceeded" };
|
|
115
115
|
}
|
|
@@ -193,7 +193,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
private async analyzeNoImages(jobId: string, recordId: string, adminUser: any, headers: Record<string, string | string[] | undefined>, customPrompt? : string, filterFilledFields: boolean = true) {
|
|
196
|
-
if (await this.checkRateLimit("fillPlainFields" ,this.options.rateLimits.fillPlainFields, headers)) {
|
|
196
|
+
if (this.options.rateLimits && this.options.rateLimits.fillPlainFields && await this.checkRateLimit("fillPlainFields" ,this.options.rateLimits.fillPlainFields, headers)) {
|
|
197
197
|
jobs.set(jobId, { status: 'failed', error: "Rate limit exceeded" });
|
|
198
198
|
return { error: "Rate limit exceeded" };
|
|
199
199
|
}
|
|
@@ -253,7 +253,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
private async initialImageGenerate(jobId: string, recordId: string, adminUser: any, headers: Record<string, string | string[] | undefined>, customPrompt? : string, filterFilledFields: boolean = true) {
|
|
256
|
-
if (await this.checkRateLimit("generateImages" ,this.options.rateLimits.generateImages, headers)) {
|
|
256
|
+
if (this.options.rateLimits && this.options.rateLimits.generateImages && await this.checkRateLimit("generateImages" ,this.options.rateLimits.generateImages, headers)) {
|
|
257
257
|
jobs.set(jobId, { status: 'failed', error: "Rate limit exceeded" });
|
|
258
258
|
return { error: "Rate limit exceeded" };
|
|
259
259
|
}
|