@adminforth/bulk-ai-flow 1.15.4 → 1.15.6
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/dist/index.js +4 -4
- package/index.ts +4 -4
- package/package.json +1 -1
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 = `
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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 = `
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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;
|