@diegoaltoworks/talker 0.10.0 → 0.12.0
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.
- package/dist/adapters/twilio.d.ts +13 -1
- package/dist/adapters/twilio.d.ts.map +1 -1
- package/dist/adapters/twilio.test.d.ts +7 -0
- package/dist/adapters/twilio.test.d.ts.map +1 -0
- package/dist/core/phrases.d.ts +5 -0
- package/dist/core/phrases.d.ts.map +1 -1
- package/dist/core/processing/prompts.d.ts +1 -1
- package/dist/core/processing/prompts.d.ts.map +1 -1
- package/dist/db/migrate.d.ts +1 -1
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +381 -97
- package/dist/index.mjs +368 -88
- package/dist/plugin.d.ts.map +1 -1
- package/dist/routes/call/handle-answer.test.d.ts +7 -0
- package/dist/routes/call/handle-answer.test.d.ts.map +1 -0
- package/dist/routes/call/handle-initial.test.d.ts +7 -0
- package/dist/routes/call/handle-initial.test.d.ts.map +1 -0
- package/dist/routes/call/handle-nospeech.test.d.ts +7 -0
- package/dist/routes/call/handle-nospeech.test.d.ts.map +1 -0
- package/dist/routes/call/handle-respond.test.d.ts +7 -0
- package/dist/routes/call/handle-respond.test.d.ts.map +1 -0
- package/dist/routes/call/handle-status.test.d.ts +7 -0
- package/dist/routes/call/handle-status.test.d.ts.map +1 -0
- package/dist/routes/call/pending.test.d.ts +7 -0
- package/dist/routes/call/pending.test.d.ts.map +1 -0
- package/dist/routes/sms/handle-incoming.test.d.ts +7 -0
- package/dist/routes/sms/handle-incoming.test.d.ts.map +1 -0
- package/dist/routes/whatsapp/handle-incoming.d.ts +12 -0
- package/dist/routes/whatsapp/handle-incoming.d.ts.map +1 -0
- package/dist/routes/whatsapp/handle-incoming.test.d.ts +7 -0
- package/dist/routes/whatsapp/handle-incoming.test.d.ts.map +1 -0
- package/dist/routes/whatsapp/index.d.ts +14 -0
- package/dist/routes/whatsapp/index.d.ts.map +1 -0
- package/dist/routes/whatsapp/processor.d.ts +14 -0
- package/dist/routes/whatsapp/processor.d.ts.map +1 -0
- package/dist/standalone.d.ts.map +1 -1
- package/dist/types.d.ts +11 -2
- package/dist/types.d.ts.map +1 -1
- package/language/de.json +7 -0
- package/language/en.json +7 -0
- package/language/es.json +7 -0
- package/language/fr.json +7 -0
- package/language/nl.json +7 -0
- package/language/pt.json +7 -0
- package/package.json +1 -1
- package/prompts/outgoing.md +16 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-status.test.d.ts","sourceRoot":"","sources":["../../../src/routes/call/handle-status.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending.test.d.ts","sourceRoot":"","sources":["../../../src/routes/call/pending.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-incoming.test.d.ts","sourceRoot":"","sources":["../../../src/routes/sms/handle-incoming.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Incoming WhatsApp Handler
|
|
3
|
+
*
|
|
4
|
+
* Handles POST /whatsapp — called by Twilio when a WhatsApp message arrives.
|
|
5
|
+
* Twilio sends the same webhook format as SMS, but with `whatsapp:` prefixed
|
|
6
|
+
* phone numbers in the From/To fields.
|
|
7
|
+
*/
|
|
8
|
+
import type { Context } from "hono";
|
|
9
|
+
import type { FlowRegistry } from "../../flows/registry";
|
|
10
|
+
import type { TalkerDependencies } from "../../types";
|
|
11
|
+
export declare function handleIncomingWhatsApp(c: Context, deps: TalkerDependencies, registry: FlowRegistry): Promise<Response>;
|
|
12
|
+
//# sourceMappingURL=handle-incoming.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-incoming.d.ts","sourceRoot":"","sources":["../../../src/routes/whatsapp/handle-incoming.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAOpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtD,wBAAsB,sBAAsB,CAC1C,CAAC,EAAE,OAAO,EACV,IAAI,EAAE,kBAAkB,EACxB,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,QAAQ,CAAC,CA6BnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-incoming.test.d.ts","sourceRoot":"","sources":["../../../src/routes/whatsapp/handle-incoming.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WhatsApp Routes
|
|
3
|
+
*
|
|
4
|
+
* Hono route factory for WhatsApp webhooks.
|
|
5
|
+
* Twilio uses the same TwiML response format for WhatsApp as it does for SMS.
|
|
6
|
+
*/
|
|
7
|
+
import { Hono } from "hono";
|
|
8
|
+
import type { FlowRegistry } from "../../flows/registry";
|
|
9
|
+
import type { TalkerDependencies } from "../../types";
|
|
10
|
+
/**
|
|
11
|
+
* Create WhatsApp routes
|
|
12
|
+
*/
|
|
13
|
+
export declare function whatsappRoutes(deps: TalkerDependencies, registry: FlowRegistry): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/whatsapp/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtD;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,YAAY,8EAO9E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WhatsApp Processor
|
|
3
|
+
*
|
|
4
|
+
* End-to-end processing pipeline for a single WhatsApp interaction.
|
|
5
|
+
* Mirrors the SMS processor but uses the "whatsapp" channel for
|
|
6
|
+
* channel-aware formatting (richer content, longer messages).
|
|
7
|
+
*/
|
|
8
|
+
import type { FlowRegistry } from "../../flows/registry";
|
|
9
|
+
import type { TalkerDependencies } from "../../types";
|
|
10
|
+
/**
|
|
11
|
+
* Process a WhatsApp interaction and generate TwiML response
|
|
12
|
+
*/
|
|
13
|
+
export declare function processWhatsApp(deps: TalkerDependencies, registry: FlowRegistry, phoneNumber: string, messageBody: string): Promise<string>;
|
|
14
|
+
//# sourceMappingURL=processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../../src/routes/whatsapp/processor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD;;GAEG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,kBAAkB,EACxB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CAuCjB"}
|
package/dist/standalone.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standalone.d.ts","sourceRoot":"","sources":["../src/standalone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"standalone.d.ts","sourceRoot":"","sources":["../src/standalone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAS5B,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,SAAS,CAAC;AAMhE,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,mDAAmD;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,uFA2DpE"}
|
package/dist/types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { ServerDependencies } from "@diegoaltoworks/chatter";
|
|
|
8
8
|
/**
|
|
9
9
|
* Channel type for telephony interactions
|
|
10
10
|
*/
|
|
11
|
-
export type Channel = "call" | "sms";
|
|
11
|
+
export type Channel = "call" | "sms" | "whatsapp";
|
|
12
12
|
/**
|
|
13
13
|
* Voice configuration for text-to-speech
|
|
14
14
|
*/
|
|
@@ -90,7 +90,7 @@ export interface TalkerConfig {
|
|
|
90
90
|
};
|
|
91
91
|
/** OpenAI API key for the pre/post-processing pipeline. Falls back to chatter's OpenAI client */
|
|
92
92
|
openaiApiKey?: string;
|
|
93
|
-
/** Route prefix for telephony endpoints. Default: "" (mounts at /call and /
|
|
93
|
+
/** Route prefix for telephony endpoints. Default: "" (mounts at /call, /sms, and /whatsapp) */
|
|
94
94
|
routePrefix?: string;
|
|
95
95
|
/** Conversation context TTL in milliseconds. Default: 1800000 (30 minutes) */
|
|
96
96
|
contextTtlMs?: number;
|
|
@@ -168,6 +168,8 @@ export interface FlowHandlerResult {
|
|
|
168
168
|
say: string;
|
|
169
169
|
/** Optional: different content for SMS */
|
|
170
170
|
sms?: string;
|
|
171
|
+
/** Optional: different content for WhatsApp */
|
|
172
|
+
whatsapp?: string;
|
|
171
173
|
}
|
|
172
174
|
export interface FlowHandlerContext {
|
|
173
175
|
phoneNumber: string;
|
|
@@ -245,5 +247,12 @@ export interface Phrases {
|
|
|
245
247
|
processingError: string;
|
|
246
248
|
genericError: string;
|
|
247
249
|
};
|
|
250
|
+
whatsapp: {
|
|
251
|
+
greeting: string;
|
|
252
|
+
greetingShort: string;
|
|
253
|
+
callForHelp: string;
|
|
254
|
+
processingError: string;
|
|
255
|
+
genericError: string;
|
|
256
|
+
};
|
|
248
257
|
}
|
|
249
258
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAIlE;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAIlE;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB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AAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,GAAG,EAAE;QACH,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH"}
|
package/language/de.json
CHANGED
|
@@ -23,5 +23,12 @@
|
|
|
23
23
|
"callForHelp": "Fuer komplexe Fragen rufen Sie uns direkt an.",
|
|
24
24
|
"processingError": "Ich habe Schwierigkeiten, das zu verarbeiten. Bitte versuchen Sie es erneut oder rufen Sie uns an.",
|
|
25
25
|
"genericError": "Entschuldigung, etwas ist schief gelaufen. Bitte versuchen Sie es erneut."
|
|
26
|
+
},
|
|
27
|
+
"whatsapp": {
|
|
28
|
+
"greeting": "Hallo! Ich bin Ihr Assistent. Senden Sie mir eine Nachricht und ich helfe Ihnen gerne!",
|
|
29
|
+
"greetingShort": "Hallo! Wie kann ich helfen?",
|
|
30
|
+
"callForHelp": "Fuer komplexe Fragen rufen Sie uns an oder antworten Sie hier mit mehr Details.",
|
|
31
|
+
"processingError": "Ich habe Schwierigkeiten, das zu verarbeiten. Bitte senden Sie Ihre Nachricht erneut.",
|
|
32
|
+
"genericError": "Entschuldigung, etwas ist schief gelaufen. Bitte versuchen Sie es erneut."
|
|
26
33
|
}
|
|
27
34
|
}
|
package/language/en.json
CHANGED
|
@@ -23,5 +23,12 @@
|
|
|
23
23
|
"callForHelp": "For more complex questions, feel free to call back or reach us directly.",
|
|
24
24
|
"processingError": "I'm having trouble processing that. Please try texting again or call back.",
|
|
25
25
|
"genericError": "Sorry, something went wrong. Please try again."
|
|
26
|
+
},
|
|
27
|
+
"whatsapp": {
|
|
28
|
+
"greeting": "Hi! I'm your assistant. Send me a message and I'll help you out!",
|
|
29
|
+
"greetingShort": "Hi! How can I help?",
|
|
30
|
+
"callForHelp": "For more complex questions, feel free to call us directly or reply here with more details.",
|
|
31
|
+
"processingError": "I'm having trouble processing that. Please try sending your message again.",
|
|
32
|
+
"genericError": "Sorry, something went wrong. Please try again."
|
|
26
33
|
}
|
|
27
34
|
}
|
package/language/es.json
CHANGED
|
@@ -23,5 +23,12 @@
|
|
|
23
23
|
"callForHelp": "Para consultas complejas, llamenos directamente.",
|
|
24
24
|
"processingError": "Tengo problemas para procesar eso. Por favor intentelo de nuevo o llamenos.",
|
|
25
25
|
"genericError": "Lo siento, algo salio mal. Por favor intente de nuevo."
|
|
26
|
+
},
|
|
27
|
+
"whatsapp": {
|
|
28
|
+
"greeting": "Hola! Soy su asistente. Envieme un mensaje y le ayudare!",
|
|
29
|
+
"greetingShort": "Hola! Como puedo ayudarle?",
|
|
30
|
+
"callForHelp": "Para consultas complejas, llamenos o responda aqui con mas detalles.",
|
|
31
|
+
"processingError": "Tengo problemas para procesar eso. Por favor envie su mensaje de nuevo.",
|
|
32
|
+
"genericError": "Lo siento, algo salio mal. Por favor intente de nuevo."
|
|
26
33
|
}
|
|
27
34
|
}
|
package/language/fr.json
CHANGED
|
@@ -23,5 +23,12 @@
|
|
|
23
23
|
"callForHelp": "Pour des questions complexes, appelez-nous directement.",
|
|
24
24
|
"processingError": "J'ai du mal a traiter cela. Veuillez reessayer ou nous appeler.",
|
|
25
25
|
"genericError": "Desole, quelque chose s'est mal passe. Veuillez reessayer."
|
|
26
|
+
},
|
|
27
|
+
"whatsapp": {
|
|
28
|
+
"greeting": "Bonjour! Je suis votre assistant. Envoyez-moi un message et je vous aiderai!",
|
|
29
|
+
"greetingShort": "Bonjour! Comment puis-je vous aider?",
|
|
30
|
+
"callForHelp": "Pour des questions complexes, appelez-nous ou repondez ici avec plus de details.",
|
|
31
|
+
"processingError": "J'ai du mal a traiter cela. Veuillez renvoyer votre message.",
|
|
32
|
+
"genericError": "Desole, quelque chose s'est mal passe. Veuillez reessayer."
|
|
26
33
|
}
|
|
27
34
|
}
|
package/language/nl.json
CHANGED
|
@@ -23,5 +23,12 @@
|
|
|
23
23
|
"callForHelp": "Voor complexe vragen, bel ons direct.",
|
|
24
24
|
"processingError": "Ik heb moeite om dat te verwerken. Probeer het opnieuw of bel ons.",
|
|
25
25
|
"genericError": "Sorry, er ging iets mis. Probeer het opnieuw."
|
|
26
|
+
},
|
|
27
|
+
"whatsapp": {
|
|
28
|
+
"greeting": "Hallo! Ik ben uw assistent. Stuur me een bericht en ik help u graag!",
|
|
29
|
+
"greetingShort": "Hallo! Hoe kan ik helpen?",
|
|
30
|
+
"callForHelp": "Voor complexe vragen, bel ons of stuur hier meer details.",
|
|
31
|
+
"processingError": "Ik heb moeite om dat te verwerken. Probeer uw bericht opnieuw te sturen.",
|
|
32
|
+
"genericError": "Sorry, er ging iets mis. Probeer het opnieuw."
|
|
26
33
|
}
|
|
27
34
|
}
|
package/language/pt.json
CHANGED
|
@@ -23,5 +23,12 @@
|
|
|
23
23
|
"callForHelp": "Para questoes complexas, ligue diretamente.",
|
|
24
24
|
"processingError": "Estou tendo dificuldades para processar isso. Por favor, tente novamente ou nos ligue.",
|
|
25
25
|
"genericError": "Desculpe, algo deu errado. Por favor, tente novamente."
|
|
26
|
+
},
|
|
27
|
+
"whatsapp": {
|
|
28
|
+
"greeting": "Ola! Sou seu assistente. Envie-me uma mensagem e eu ajudo voce!",
|
|
29
|
+
"greetingShort": "Ola! Como posso ajudar?",
|
|
30
|
+
"callForHelp": "Para questoes complexas, ligue para nos ou responda aqui com mais detalhes.",
|
|
31
|
+
"processingError": "Estou tendo dificuldades para processar isso. Por favor, envie sua mensagem novamente.",
|
|
32
|
+
"genericError": "Desculpe, algo deu errado. Por favor, tente novamente."
|
|
26
33
|
}
|
|
27
34
|
}
|
package/package.json
CHANGED
package/prompts/outgoing.md
CHANGED
|
@@ -4,7 +4,7 @@ You are a post-processor for a voice assistant. Your job is to transform knowled
|
|
|
4
4
|
|
|
5
5
|
## Channel Type
|
|
6
6
|
|
|
7
|
-
You will be told the channel:
|
|
7
|
+
You will be told the channel: "call" (phone), "sms" (text message), or "whatsapp".
|
|
8
8
|
|
|
9
9
|
**For CALL (phone):**
|
|
10
10
|
- Response will be SPOKEN aloud by text-to-speech
|
|
@@ -19,6 +19,15 @@ You will be told the channel: either "call" (phone) or "sms" (text message).
|
|
|
19
19
|
- Maximum 160 characters ideal (1 SMS segment)
|
|
20
20
|
- No markdown formatting
|
|
21
21
|
|
|
22
|
+
**For WHATSAPP:**
|
|
23
|
+
- Response will be READ in a WhatsApp chat
|
|
24
|
+
- Keep numbers as digits
|
|
25
|
+
- Can include full URLs
|
|
26
|
+
- Can use WhatsApp formatting: *bold*, _italic_, ~strikethrough~
|
|
27
|
+
- Longer responses are fine (up to 500 characters)
|
|
28
|
+
- Can use line breaks for readability
|
|
29
|
+
- No markdown headers or lists — use simple text with line breaks
|
|
30
|
+
|
|
22
31
|
## Language Requirement
|
|
23
32
|
|
|
24
33
|
**CRITICAL**: You will be told which language to respond in. You MUST translate and respond in that language.
|
|
@@ -53,6 +62,12 @@ You will be told the channel: either "call" (phone) or "sms" (text message).
|
|
|
53
62
|
- Numbers -> keep as digits
|
|
54
63
|
- URLs -> keep short URLs
|
|
55
64
|
|
|
65
|
+
### For WHATSAPP:
|
|
66
|
+
- Numbers -> keep as digits
|
|
67
|
+
- URLs -> keep full URLs
|
|
68
|
+
- Use *bold* for emphasis (WhatsApp native formatting)
|
|
69
|
+
- Can use line breaks between logical sections
|
|
70
|
+
|
|
56
71
|
## Response Format
|
|
57
72
|
|
|
58
73
|
Return ONLY the transformed text. No JSON, no explanations.
|