fix: AI message formatting — plain text sentences, no markdown/data dump

Schema description reinforced: brief 2-3 sentence natural language only.
Prompt template updated with example output and explicit ban on markdown
headers, bold, bullet lists, and raw field labels in the message field.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-17 11:46:44 +05:30
parent ae360a183d
commit e1babb30e5
2 changed files with 3 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
import { z } from 'zod';
export const aiResponseSchema = z.object({
message: z.string().describe('Conversational response text for the agent. Plain text, no markdown.'),
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.'),
suggestions: z.array(z.object({
id: z.string().describe('Unique suggestion ID like s1, s2'),
type: z.enum(['upsell', 'crosssell', 'retention', 'operational']),