@zodic/shared 0.0.48 → 0.0.50
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/app/base/AppContext.ts
CHANGED
|
@@ -61,6 +61,13 @@ export class AppContext {
|
|
|
61
61
|
return this.env.KV_USER_PRODUCT_STATUS;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
kvConceptsManagementStore() {
|
|
65
|
+
if (!this.env.KV_CONCEPTS_MANAGEMENT) {
|
|
66
|
+
throw new Error('KV_LEONARDO_PROMPTS is not defined in the environment.');
|
|
67
|
+
}
|
|
68
|
+
return this.env.KV_CONCEPTS_MANAGEMENT;
|
|
69
|
+
}
|
|
70
|
+
|
|
64
71
|
api() {
|
|
65
72
|
return Api(this.env);
|
|
66
73
|
}
|
|
@@ -26,7 +26,7 @@ export class ConceptService {
|
|
|
26
26
|
conceptSlug,
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
const response = await this.context.api().callChatGPT(messages, {});
|
|
29
|
+
const response = await this.context.api().callChatGPT.single(messages, {});
|
|
30
30
|
if (!response) {
|
|
31
31
|
throw new Error(
|
|
32
32
|
`Failed to generate basic info for concept: ${conceptSlug}`
|
|
@@ -92,7 +92,7 @@ export class ConceptService {
|
|
|
92
92
|
combination: combinationString,
|
|
93
93
|
});
|
|
94
94
|
|
|
95
|
-
const response = await this.context.api().callChatGPT(messages, {});
|
|
95
|
+
const response = await this.context.api().callChatGPT.single(messages, {});
|
|
96
96
|
if (!response) {
|
|
97
97
|
throw new Error(
|
|
98
98
|
`Failed to generate Leonardo prompt for concept: ${conceptSlug}`
|
|
@@ -135,7 +135,7 @@ export class ConceptService {
|
|
|
135
135
|
poem: concept.poem,
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
const response = await this.context.api().callChatGPT(messages, {});
|
|
138
|
+
const response = await this.context.api().callChatGPT.single(messages, {});
|
|
139
139
|
if (!response) {
|
|
140
140
|
throw new Error(`Failed to generate content for concept: ${conceptSlug}`);
|
|
141
141
|
}
|
package/package.json
CHANGED
package/types/scopes/generic.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { ConceptPhase } from "./legacy";
|
|
2
|
-
|
|
3
1
|
export type Provider = 'google' | 'facebook';
|
|
4
2
|
|
|
5
3
|
export type ProviderInfo = {
|
|
@@ -167,14 +165,14 @@ export type ChatGPTBatchResponse = {
|
|
|
167
165
|
input_file_id: string; // ID of the input file
|
|
168
166
|
completion_window: string; // Time window for completions (e.g., "24h")
|
|
169
167
|
status:
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
168
|
+
| 'validating'
|
|
169
|
+
| 'in_progress'
|
|
170
|
+
| 'finalizing'
|
|
171
|
+
| 'completed'
|
|
172
|
+
| 'failed'
|
|
173
|
+
| 'expired'
|
|
174
|
+
| 'cancelling'
|
|
175
|
+
| 'cancelled'; // Current status of the batch
|
|
178
176
|
output_file_id: string | null; // ID of the output file, if available
|
|
179
177
|
error_file_id: string | null; // ID of the error file, if available
|
|
180
178
|
created_at: number; // Timestamp when the batch was created
|
|
@@ -218,4 +216,17 @@ export type ChatGPTFileUploadResponse = {
|
|
|
218
216
|
created_at: number; // Timestamp when the file was created
|
|
219
217
|
filename: string; // Name of the uploaded file
|
|
220
218
|
purpose: string; // Purpose of the file, e.g., "fine-tune"
|
|
221
|
-
};
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export type ConceptPhase =
|
|
222
|
+
| 'basic-info'
|
|
223
|
+
| 'leonardo-prompt'
|
|
224
|
+
| 'content'
|
|
225
|
+
| 'images';
|
|
226
|
+
|
|
227
|
+
export const ConceptPhases: Record<string, ConceptPhase> = {
|
|
228
|
+
BASIC_INFO: 'basic-info',
|
|
229
|
+
LEONARDO_PROMPT: 'leonardo-prompt',
|
|
230
|
+
CONTENT: 'content',
|
|
231
|
+
IMAGES: 'images',
|
|
232
|
+
};
|
package/types/scopes/legacy.ts
CHANGED