@yrpri/api 9.0.97 → 9.0.99
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.
|
@@ -14,7 +14,7 @@ const dbModels = models;
|
|
|
14
14
|
const Image = dbModels.Image;
|
|
15
15
|
const AcBackgroundJob = dbModels.AcBackgroundJob;
|
|
16
16
|
const disableFlux = false;
|
|
17
|
-
const useImagen =
|
|
17
|
+
const useImagen = false;
|
|
18
18
|
export class CollectionImageGenerator {
|
|
19
19
|
constructor() {
|
|
20
20
|
this.s3Service = new S3Service(process.env.CLOUDFLARE_API_KEY, process.env.CLOUDFLARE_ZONE_ID);
|
|
@@ -35,6 +35,7 @@ export class DalleImageGenerator {
|
|
|
35
35
|
else if (type === "icon") {
|
|
36
36
|
size = "1024x1024";
|
|
37
37
|
}
|
|
38
|
+
const modelQuality = "standard";
|
|
38
39
|
while (retrying && retryCount < this.maxRetryCount) {
|
|
39
40
|
try {
|
|
40
41
|
// If using Azure OpenAI
|
|
@@ -43,7 +44,7 @@ export class DalleImageGenerator {
|
|
|
43
44
|
prompt,
|
|
44
45
|
n: 1,
|
|
45
46
|
size,
|
|
46
|
-
quality:
|
|
47
|
+
quality: modelQuality,
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
50
|
else {
|
|
@@ -53,7 +54,7 @@ export class DalleImageGenerator {
|
|
|
53
54
|
prompt,
|
|
54
55
|
n: 1,
|
|
55
56
|
size,
|
|
56
|
-
quality:
|
|
57
|
+
quality: modelQuality,
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
60
|
if (result) {
|
|
@@ -28,11 +28,11 @@ export class AgentModels {
|
|
|
28
28
|
}
|
|
29
29
|
convertToUnderscoresWithMaxLength(str) {
|
|
30
30
|
const converted = str
|
|
31
|
-
.replace(/\s+/g,
|
|
32
|
-
.replace(/([A-Z])/g,
|
|
33
|
-
.replace(/^_/,
|
|
34
|
-
.replace(/-/g,
|
|
35
|
-
.replace(/_+/g,
|
|
31
|
+
.replace(/\s+/g, "_") // Replace spaces with underscores
|
|
32
|
+
.replace(/([A-Z])/g, "_$1") // Add underscore before capital letters
|
|
33
|
+
.replace(/^_/, "") // Remove leading underscore
|
|
34
|
+
.replace(/-/g, "_") // Replace hyphens with underscores
|
|
35
|
+
.replace(/_+/g, "_") // Replace multiple underscores with single
|
|
36
36
|
.toLowerCase();
|
|
37
37
|
return converted.length > 34 ? converted.slice(0, 34) : converted;
|
|
38
38
|
}
|
|
@@ -76,6 +76,8 @@ export class AgentModels {
|
|
|
76
76
|
await agentRunToUpdate.save();
|
|
77
77
|
return {
|
|
78
78
|
agentRun: agentRunToUpdate,
|
|
79
|
+
previousStep: currentStep,
|
|
80
|
+
currentStep: workflow.steps[currentStepIndex],
|
|
79
81
|
message: "Agent workflow started successfully",
|
|
80
82
|
};
|
|
81
83
|
}
|
|
@@ -97,7 +99,8 @@ export class AgentModels {
|
|
|
97
99
|
if (agentRun.run.workflow.currentStepIndex === 0) {
|
|
98
100
|
return agentRun.run.workflow.steps[0];
|
|
99
101
|
}
|
|
100
|
-
if (agentRun.run.workflow.currentStepIndex >=
|
|
102
|
+
if (agentRun.run.workflow.currentStepIndex >=
|
|
103
|
+
agentRun.run.workflow.steps.length - 1) {
|
|
101
104
|
return undefined;
|
|
102
105
|
}
|
|
103
106
|
return agentRun.run.workflow.steps[agentRun.run.workflow.currentStepIndex + 1];
|