@adminforth/bulk-ai-flow 1.15.3 → 1.15.5

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 CHANGED
@@ -13,5 +13,5 @@ custom/package-lock.json
13
13
  custom/package.json
14
14
  custom/tsconfig.json
15
15
 
16
- sent 80,746 bytes received 172 bytes 161,836.00 bytes/sec
17
- total size is 80,105 speedup is 0.99
16
+ sent 80,887 bytes received 172 bytes 162,118.00 bytes/sec
17
+ total size is 80,246 speedup is 0.99
@@ -181,6 +181,11 @@ const popupMode = ref<'generation' | 'confirmation' | 'settings'>('confirmation'
181
181
  const generationPrompts = ref<any>({});
182
182
 
183
183
  const openDialog = async () => {
184
+ if (props.meta.askConfirmationBeforeGenerating) {
185
+ popupMode.value = 'confirmation';
186
+ } else {
187
+ popupMode.value = 'generation';
188
+ }
184
189
  isDialogOpen.value = true;
185
190
  confirmDialog.value.open();
186
191
  isFetchingRecords.value = true;
@@ -181,6 +181,11 @@ const popupMode = ref<'generation' | 'confirmation' | 'settings'>('confirmation'
181
181
  const generationPrompts = ref<any>({});
182
182
 
183
183
  const openDialog = async () => {
184
+ if (props.meta.askConfirmationBeforeGenerating) {
185
+ popupMode.value = 'confirmation';
186
+ } else {
187
+ popupMode.value = 'generation';
188
+ }
184
189
  isDialogOpen.value = true;
185
190
  confirmDialog.value.open();
186
191
  isFetchingRecords.value = true;
package/dist/index.js CHANGED
@@ -171,10 +171,10 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
171
171
  const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
172
172
  const record = yield this.adminforth.resource(this.resourceConfig.resourceId).get([Filters.EQ(primaryKeyColumn.name, selectedId)]);
173
173
  const compiledOutputFields = yield this.compileOutputFieldsTemplatesNoImage(record, customPrompt);
174
- const prompt = `Analyze the following fields and return a single JSON in format like: {'param1': 'value1', 'param2': 'value2'}.
175
- Do NOT return array of objects. Do NOT include any Markdown, code blocks, explanations, or extra text. Only return valid JSON.
176
- Each object must contain the following fields: ${JSON.stringify(compiledOutputFields)} Use the exact field names.
177
- If it's number field - return only number.`;
174
+ const prompt = `Generate the values of fields in object by using next prompts (key is field name, value is prompt):
175
+ ${JSON.stringify(compiledOutputFields)} In output object use the same field names (keys) as in input.
176
+ Return a single valid passable JSON object in format like: {'meta_title': 'generated_value'}.
177
+ Do NOT include any Markdown, code blocks, explanations, or extra text. Only return valid JSON.`;
178
178
  //send prompt to OpenAI and get response
179
179
  const numberOfTokens = this.options.fillPlainFieldsMaxTokens ? this.options.fillPlainFieldsMaxTokens : 1000;
180
180
  let resp;
package/index.ts CHANGED
@@ -165,10 +165,10 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
165
165
  const record = await this.adminforth.resource(this.resourceConfig.resourceId).get( [Filters.EQ(primaryKeyColumn.name, selectedId)] );
166
166
 
167
167
  const compiledOutputFields = await this.compileOutputFieldsTemplatesNoImage(record, customPrompt);
168
- const prompt = `Analyze the following fields and return a single JSON in format like: {'param1': 'value1', 'param2': 'value2'}.
169
- Do NOT return array of objects. Do NOT include any Markdown, code blocks, explanations, or extra text. Only return valid JSON.
170
- Each object must contain the following fields: ${JSON.stringify(compiledOutputFields)} Use the exact field names.
171
- If it's number field - return only number.`;
168
+ const prompt = `Generate the values of fields in object by using next prompts (key is field name, value is prompt):
169
+ ${JSON.stringify(compiledOutputFields)} In output object use the same field names (keys) as in input.
170
+ Return a single valid passable JSON object in format like: {'meta_title': 'generated_value'}.
171
+ Do NOT include any Markdown, code blocks, explanations, or extra text. Only return valid JSON.`;
172
172
  //send prompt to OpenAI and get response
173
173
  const numberOfTokens = this.options.fillPlainFieldsMaxTokens ? this.options.fillPlainFieldsMaxTokens : 1000;
174
174
  let resp: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/bulk-ai-flow",
3
- "version": "1.15.3",
3
+ "version": "1.15.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },