Skip to content

Commit 1804a0d

Browse files
committed
fix: update generation prompts to avoid json ... syntax in response
1 parent e389bd0 commit 1804a0d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
7979
private getPromptForImageAnalysis(compiledOutputFields: Record<string, string>) {
8080
const prompt = `Analyze the following image(s) and return a single JSON in format like: {'param1': 'value1', 'param2': 'value2'}.
8181
Do NOT return array of objects. Do NOT include any Markdown, code blocks, explanations, or extra text. Only return valid JSON.
82+
Only return valid JSON. Do NOT wrap in \`\`\` or \`\`\`json. Do not add any extra text. Do not return prompt in response
8283
Each object must contain the following fields: ${JSON.stringify(compiledOutputFields)} Use the exact field names. If it's number field - return only number.
8384
Image URLs:`;
8485
return prompt;
@@ -88,7 +89,8 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
8889
const prompt = `Generate the values of fields in object by using next prompts (key is field name, value is prompt):
8990
${JSON.stringify(compiledOutputFields)} In output object use the same field names (keys) as in input.
9091
Return a single valid passable JSON object in format like: {"meta_title": "generated_value"}.
91-
Do NOT include any Markdown, code blocks, explanations, or extra text. Only return valid JSON.`;
92+
Do NOT include any Markdown, code blocks, explanations, or extra text. Only return valid JSON.
93+
Do NOT wrap in \`\`\` or \`\`\`json. Do not add any extra text. Do not return prompt in response`;
9294
return prompt;
9395
}
9496

0 commit comments

Comments
 (0)