@zodic/shared 0.0.320 → 0.0.322

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/api/index.ts CHANGED
@@ -347,7 +347,7 @@ export const Api = (env: BackendBindings) => ({
347
347
  }
348
348
  },
349
349
 
350
- generatePresignedUrl: async (): Promise<{
350
+ generatePresignedUrl: async (extension: string): Promise<{
351
351
  id: string;
352
352
  fields: string;
353
353
  key: string;
@@ -358,14 +358,14 @@ export const Api = (env: BackendBindings) => ({
358
358
  Authorization: `Bearer ${env.LEONARDO_API_KEY}`,
359
359
  'Content-Type': 'application/json',
360
360
  };
361
-
361
+
362
362
  try {
363
363
  const response = await fetch(endpoint, {
364
364
  method: 'POST',
365
365
  headers,
366
- body: JSON.stringify({}),
366
+ body: JSON.stringify({ extension }), // Include the extension in the request body
367
367
  });
368
-
368
+
369
369
  if (!response.ok) {
370
370
  const error = await response.json();
371
371
  console.error(
@@ -374,10 +374,10 @@ export const Api = (env: BackendBindings) => ({
374
374
  );
375
375
  throw new Error(`Leonardo API Error: ${response.status}`);
376
376
  }
377
-
377
+
378
378
  const data = await response.json() as any;
379
379
  const result = data.uploadInitImage;
380
-
380
+
381
381
  if (
382
382
  !result ||
383
383
  !result.id ||
@@ -388,7 +388,7 @@ export const Api = (env: BackendBindings) => ({
388
388
  console.error('❌ Invalid response from Leonardo API:', data);
389
389
  throw new Error('Invalid response structure from Leonardo API');
390
390
  }
391
-
391
+
392
392
  return {
393
393
  id: result.id,
394
394
  fields: result.fields,
@@ -168,7 +168,7 @@ export class LeonardoService {
168
168
  try {
169
169
  const presignedUrlData = await this.context
170
170
  .api()
171
- .callLeonardo.generatePresignedUrl();
171
+ .callLeonardo.generatePresignedUrl(fileExtension);
172
172
  await this.context.api().callLeonardo.uploadImageToPresignedUrl(file, {
173
173
  fields: presignedUrlData.fields,
174
174
  url: presignedUrlData.url,
@@ -225,7 +225,7 @@ export class LeonardoService {
225
225
 
226
226
  const presignedUrlData = await this.context
227
227
  .api()
228
- .callLeonardo.generatePresignedUrl();
228
+ .callLeonardo.generatePresignedUrl(fileExtension);
229
229
  await this.context
230
230
  .api()
231
231
  .callLeonardo.uploadImageToPresignedUrl(file as File, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.320",
3
+ "version": "0.0.322",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -112,14 +112,16 @@ export const buildLLMMessages = (env: BackendBindings) => ({
112
112
  combination: string;
113
113
  }): ChatMessages => {
114
114
  const [sun, ascendant, moon] = combination.split('-');
115
-
115
+
116
116
  return [
117
117
  {
118
118
  role: 'system',
119
119
  content: `
120
120
  You are an expert in astrology and archetypal synthesis. Your task is to generate detailed **archetype content** based on a person's core archetype name, description, and Sun, Ascendant, and Moon signs.
121
121
 
122
- Your response must be insightful, symbolic, and poetic. Avoid direct mentions of zodiac signs or planets; instead, convey their **archetypal energy** through rich metaphors and evocative storytelling.
122
+ Your response must be insightful, symbolic, and restrained. Focus on personality traits, behaviors, and subtle symbolic elements inspired by the archetypal energies of the Sun, Ascendant, and Moon signs, conveyed through elegant metaphors and thoughtful storytelling. Avoid overly fantastical or magical imagery like glowing lights, ethereal realms, or supernatural abilities, and instead emphasize a grounded, sober tone while maintaining a mystical depth.
123
+
124
+ Do not include the archetype name in the content itself. Describe the archetype based on its description and the archetypal energies without repeating its name.
123
125
 
124
126
  Generate two versions of the content:
125
127
  - One in **English** (gender-neutral).