@zodic/shared 0.0.378 → 0.0.379
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.
|
@@ -924,11 +924,22 @@ export class ArchetypeService {
|
|
|
924
924
|
private parseContentResponse(response: string, section: string) {
|
|
925
925
|
this.log('debug', 'Starting parseContentResponse', { responseLength: response.length, section });
|
|
926
926
|
|
|
927
|
-
const lines = response.split('\n').
|
|
927
|
+
const lines = response.split('\n').map(line => line.trim()); // Trim each line
|
|
928
928
|
this.log('debug', 'Split response into lines', { linesCount: lines.length, lines });
|
|
929
929
|
|
|
930
|
+
// Skip initial --- and any empty lines
|
|
931
|
+
let startIndex = 0;
|
|
932
|
+
while (startIndex < lines.length && (lines[startIndex] === '---' || lines[startIndex] === '')) {
|
|
933
|
+
startIndex++;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
if (startIndex >= lines.length) {
|
|
937
|
+
this.log('error', `No content found after skipping delimiters for ${section}`, { response });
|
|
938
|
+
throw new Error(`No content found after skipping delimiters for ${section}`);
|
|
939
|
+
}
|
|
940
|
+
|
|
930
941
|
const expectedHeader = `${section}:`;
|
|
931
|
-
const actualHeader = lines[
|
|
942
|
+
const actualHeader = lines[startIndex];
|
|
932
943
|
if (!actualHeader.startsWith(expectedHeader)) {
|
|
933
944
|
this.log('error', `Invalid language header for ${section}`, {
|
|
934
945
|
expected: expectedHeader,
|
|
@@ -941,7 +952,7 @@ export class ArchetypeService {
|
|
|
941
952
|
let currentSection = '';
|
|
942
953
|
let currentText: string[] = [];
|
|
943
954
|
|
|
944
|
-
for (const line of lines.slice(1)) {
|
|
955
|
+
for (const line of lines.slice(startIndex + 1)) {
|
|
945
956
|
if (line.startsWith('#')) {
|
|
946
957
|
if (currentSection && currentText.length > 0) {
|
|
947
958
|
const key = currentSection.toLowerCase().replace(/\s+/g, '').replace(/([A-Z])/g, (match) => match.toLowerCase());
|
|
@@ -954,7 +965,7 @@ export class ArchetypeService {
|
|
|
954
965
|
currentSection = line.replace('# ', '');
|
|
955
966
|
currentText = [];
|
|
956
967
|
this.log('debug', `Starting new section ${currentSection} for ${section}`);
|
|
957
|
-
} else {
|
|
968
|
+
} else if (line) { // Ignore empty lines
|
|
958
969
|
currentText.push(line);
|
|
959
970
|
}
|
|
960
971
|
}
|
package/package.json
CHANGED
package/utils/buildMessages.ts
CHANGED
|
@@ -240,7 +240,7 @@ export const buildLLMMessages = (env: BackendBindings) => ({
|
|
|
240
240
|
|
|
241
241
|
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.
|
|
242
242
|
|
|
243
|
-
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.
|
|
243
|
+
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. Also, do not use the character "—" in the text.
|
|
244
244
|
|
|
245
245
|
Generate content in **English** (gender-neutral).
|
|
246
246
|
|
|
@@ -315,7 +315,7 @@ export const buildLLMMessages = (env: BackendBindings) => ({
|
|
|
315
315
|
|
|
316
316
|
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.
|
|
317
317
|
|
|
318
|
-
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.
|
|
318
|
+
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. Also, do not use the character "—" in the text.
|
|
319
319
|
|
|
320
320
|
Generate content in **Brazilian Portuguese**, with both **masculine and feminine** phrasing. Content and metaphors should remain identical; only adapt gendered language.
|
|
321
321
|
|