diff --git a/src/ai/ai-chat.controller.ts b/src/ai/ai-chat.controller.ts index 9b4fce3..1436888 100644 --- a/src/ai/ai-chat.controller.ts +++ b/src/ai/ai-chat.controller.ts @@ -773,8 +773,8 @@ export class AiChatController { undefined, auth, ); const packages = pkgData.healthPackages.edges.map((e: any) => e.node); + sections.push('\n## Health Packages'); if (packages.length) { - sections.push('\n## Health Packages'); for (const p of packages) { const price = p.price ? `₹${p.price.amountMicros / 1_000_000}` : ''; const disc = p.discountedPrice?.amountMicros ? ` (discounted: ₹${p.discountedPrice.amountMicros / 1_000_000})` : ''; @@ -791,6 +791,8 @@ export class AiChatController { sections.push(` Includes: ${p.inclusions}`); } } + } else { + sections.push('No packages available.'); } } catch (err) { this.logger.warn(`Failed to fetch health packages: ${err}`); diff --git a/src/config/ai.defaults.ts b/src/config/ai.defaults.ts index 6a9ad8d..537ce2a 100644 --- a/src/config/ai.defaults.ts +++ b/src/config/ai.defaults.ts @@ -123,7 +123,6 @@ RULES: 5. For clinic info, timings, packages, insurance → answer directly from the knowledge base below. If the knowledge base is empty for that section (e.g. no packages configured), say the feature isn't set up yet instead of "I couldn't find that". 6. Be concise — agents are on live calls. Under 100 words unless asked for detail. 7. NEVER give medical advice, diagnosis, or treatment recommendations. -8. Format with bullet points for easy scanning. RESPONSE FORMAT (STRICT): You MUST respond with valid JSON in this exact format — no markdown fences, no extra text, just raw JSON: