@adminforth/bulk-ai-flow 1.18.10 → 1.18.12
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/.woodpecker/buildSlackNotify.sh +3 -1
- package/.woodpecker/release.yml +24 -7
- package/dist/index.js +3 -1
- package/index.ts +3 -1
- package/package.json +1 -1
|
@@ -4,8 +4,10 @@ set -x
|
|
|
4
4
|
|
|
5
5
|
COMMIT_SHORT_SHA=$(echo $CI_COMMIT_SHA | cut -c1-8)
|
|
6
6
|
|
|
7
|
+
STATUS=${1}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
if [ "$STATUS" = "success" ]; then
|
|
9
11
|
MESSAGE="Did a build without issues on \`$CI_REPO_NAME/$CI_COMMIT_BRANCH\`. Commit: _${CI_COMMIT_MESSAGE}_ (<$CI_COMMIT_URL|$COMMIT_SHORT_SHA>)"
|
|
10
12
|
|
|
11
13
|
curl -s -X POST -H "Content-Type: application/json" -d '{
|
package/.woodpecker/release.yml
CHANGED
|
@@ -16,25 +16,42 @@ steps:
|
|
|
16
16
|
commands:
|
|
17
17
|
- infisical export --domain https://vault.devforth.io/api --format=dotenv-export --env="prod" > /woodpecker/deploy.vault.env
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
build:
|
|
20
20
|
image: node:20
|
|
21
21
|
when:
|
|
22
22
|
- event: push
|
|
23
23
|
commands:
|
|
24
24
|
- apt update && apt install -y rsync
|
|
25
|
-
-
|
|
25
|
+
- . /woodpecker/deploy.vault.env
|
|
26
26
|
- npm clean-install
|
|
27
27
|
- /bin/bash ./.woodpecker/buildRelease.sh
|
|
28
28
|
- npm audit signatures
|
|
29
|
+
|
|
30
|
+
release:
|
|
31
|
+
image: node:20
|
|
32
|
+
when:
|
|
33
|
+
- event:
|
|
34
|
+
- push
|
|
35
|
+
branch:
|
|
36
|
+
- main
|
|
37
|
+
commands:
|
|
38
|
+
- . /woodpecker/deploy.vault.env
|
|
29
39
|
- npx semantic-release
|
|
30
40
|
|
|
31
41
|
slack-on-failure:
|
|
42
|
+
image: curlimages/curl
|
|
32
43
|
when:
|
|
33
44
|
- event: push
|
|
34
|
-
status: [failure
|
|
35
|
-
|
|
45
|
+
status: [failure]
|
|
46
|
+
commands:
|
|
47
|
+
- . /woodpecker/deploy.vault.env
|
|
48
|
+
- /bin/sh ./.woodpecker/buildSlackNotify.sh failure
|
|
49
|
+
|
|
50
|
+
slack-on-success:
|
|
36
51
|
image: curlimages/curl
|
|
52
|
+
when:
|
|
53
|
+
- event: push
|
|
54
|
+
status: [success]
|
|
37
55
|
commands:
|
|
38
|
-
-
|
|
39
|
-
- /bin/sh ./.woodpecker/buildSlackNotify.sh
|
|
40
|
-
|
|
56
|
+
- . /woodpecker/deploy.vault.env
|
|
57
|
+
- /bin/sh ./.woodpecker/buildSlackNotify.sh success
|
package/dist/index.js
CHANGED
|
@@ -80,6 +80,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
80
80
|
getPromptForImageAnalysis(compiledOutputFields) {
|
|
81
81
|
const prompt = `Analyze the following image(s) and return a single JSON in format like: {'param1': 'value1', 'param2': 'value2'}.
|
|
82
82
|
Do NOT return array of objects. Do NOT include any Markdown, code blocks, explanations, or extra text. Only return valid JSON.
|
|
83
|
+
Only return valid JSON. Do NOT wrap in \`\`\` or \`\`\`json. Do not add any extra text. Do not return prompt in response
|
|
83
84
|
Each object must contain the following fields: ${JSON.stringify(compiledOutputFields)} Use the exact field names. If it's number field - return only number.
|
|
84
85
|
Image URLs:`;
|
|
85
86
|
return prompt;
|
|
@@ -88,7 +89,8 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
88
89
|
const prompt = `Generate the values of fields in object by using next prompts (key is field name, value is prompt):
|
|
89
90
|
${JSON.stringify(compiledOutputFields)} In output object use the same field names (keys) as in input.
|
|
90
91
|
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`;
|
|
92
94
|
return prompt;
|
|
93
95
|
}
|
|
94
96
|
analyze_image(jobId, recordId, adminUser, headers, customPrompt) {
|
package/index.ts
CHANGED
|
@@ -79,6 +79,7 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
79
79
|
private getPromptForImageAnalysis(compiledOutputFields: Record<string, string>) {
|
|
80
80
|
const prompt = `Analyze the following image(s) and return a single JSON in format like: {'param1': 'value1', 'param2': 'value2'}.
|
|
81
81
|
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
|
|
82
83
|
Each object must contain the following fields: ${JSON.stringify(compiledOutputFields)} Use the exact field names. If it's number field - return only number.
|
|
83
84
|
Image URLs:`;
|
|
84
85
|
return prompt;
|
|
@@ -88,7 +89,8 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
|
|
|
88
89
|
const prompt = `Generate the values of fields in object by using next prompts (key is field name, value is prompt):
|
|
89
90
|
${JSON.stringify(compiledOutputFields)} In output object use the same field names (keys) as in input.
|
|
90
91
|
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`;
|
|
92
94
|
return prompt;
|
|
93
95
|
}
|
|
94
96
|
|