@zodic/shared 0.0.90 → 0.0.91
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.
|
@@ -54,20 +54,24 @@ export class ConceptService {
|
|
|
54
54
|
description: string;
|
|
55
55
|
poem: string;
|
|
56
56
|
} {
|
|
57
|
-
console.log('Parsing basic info response from ChatGPT');
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
const
|
|
57
|
+
console.log('📌 Parsing basic info response from ChatGPT:', response);
|
|
58
|
+
|
|
59
|
+
const nameMatch = response.match(/1\.\s*Name:\s*(.+)/);
|
|
60
|
+
const descriptionMatch = response.match(/2\.\s*Description:\s*([\s\S]+?)\s*3\./);
|
|
61
|
+
const poemMatch = response.match(/3\.\s*Poem\/Quote:\s*([\s\S]+)/);
|
|
61
62
|
|
|
62
63
|
if (!nameMatch || !descriptionMatch || !poemMatch) {
|
|
64
|
+
console.error('❌ Invalid basic info response format:', response);
|
|
63
65
|
throw new Error('Invalid basic info response format');
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
68
|
+
const name = nameMatch[1].trim();
|
|
69
|
+
const description = descriptionMatch[1].trim();
|
|
70
|
+
const poem = poemMatch[1].trim();
|
|
71
|
+
|
|
72
|
+
console.log('✅ Parsed basic info:', { name, description, poem });
|
|
73
|
+
|
|
74
|
+
return { name, description, poem };
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
/**
|