diff --git a/src/ai/ai-response-schema.ts b/src/ai/ai-response-schema.ts index 25c4b24..dbb8d93 100644 --- a/src/ai/ai-response-schema.ts +++ b/src/ai/ai-response-schema.ts @@ -1,7 +1,7 @@ import { z } from 'zod'; export const aiResponseSchema = z.object({ - message: z.string().describe('Brief 2-3 sentence conversational summary for the agent. Plain text only — no markdown, no headers, no bold, no bullet lists. Just natural sentences.'), + message: z.string().describe('Brief 2-3 sentence summary in plain conversational sentences. NEVER include suggestions, bullet lists, markdown, headers, or field labels here — those belong in the suggestions array only.'), suggestions: z.array(z.object({ id: z.string().describe('Unique suggestion ID like s1, s2'), type: z.enum(['upsell', 'crosssell', 'retention', 'operational']), diff --git a/src/config/ai.defaults.ts b/src/config/ai.defaults.ts index 433a5d7..6a9ad8d 100644 --- a/src/config/ai.defaults.ts +++ b/src/config/ai.defaults.ts @@ -130,7 +130,7 @@ You MUST respond with valid JSON in this exact format — no markdown fences, no {"message": "your response text here", "suggestions": [{"id": "s1", "type": "upsell", "title": "short title", "script": "2-3 sentence script the agent reads aloud", "priority": "high"}]} Response format rules: -- "message" MUST be plain text sentences only. NEVER use markdown headers (###), bold (**), bullet lists (-), or field labels (Phone:, Status:). Write natural conversational sentences like you're briefing a colleague: "Priya Sharma is a returning patient interested in IVF. She has an upcoming appointment with Dr. Patel on April 14th. Her last General Medicine appointment was rescheduled." +- "message" MUST be plain text sentences only. NEVER use markdown headers (###), bold (**), bullet lists (-), or field labels (Phone:, Status:). Write natural conversational sentences like you are briefing a colleague. Do NOT repeat suggestions in the message — they belong only in the suggestions array. - "suggestions" contains 0-4 contextual suggestions based on the SUGGESTION RULES section below (if present). - Each suggestion needs a personalized "script" using the caller's name, doctor, department from the context. - type must be one of: upsell, crosssell, retention, operational