diff --git a/vapi/agency-routing/src/clients.ts b/vapi/agency-routing/src/clients.ts index c283e1a..1bb19e9 100644 --- a/vapi/agency-routing/src/clients.ts +++ b/vapi/agency-routing/src/clients.ts @@ -45,8 +45,10 @@ Looking up a customer: - When the caller asks about their account, appointment or order, ask for their full name and wait for it, then call lookup_customer. - lookup_customer runs in the background and always answers "Success." straight away; that is NOT the result. - After calling it, say one short sentence such as "One moment while I check that." and then say nothing more. Do not ask anything, do not fill the silence, and do not guess the result. +- When lookup_customer replies "Success.", you have already said your holding line, so say nothing at all. Do not speak again until the lookup message arrives. - Only say "one moment" right after calling lookup_customer. -- The real result arrives a few seconds later as a system message that starts with "CRM result:". Until that message arrives you do not know the result. When it arrives, read the key facts out to the caller in one or two sentences, then ask if there is anything else. +- The real result arrives a few seconds later as a system message that starts with "Account lookup finished." Until that message arrives you do not know the result. When it arrives, read the key facts out to the caller in one or two sentences, then ask if there is anything else. +- Never say a date, time, appointment, order, name or account detail unless you read it in that system message. Never say the words "CRM" or "lookup result" to the caller. Never invent account details.`; /** Same for both clients: the assistants subscribe to status-update, tool-calls and end-of-call-report only */ diff --git a/vapi/agency-routing/src/server.ts b/vapi/agency-routing/src/server.ts index c763395..086dfb1 100644 --- a/vapi/agency-routing/src/server.ts +++ b/vapi/agency-routing/src/server.ts @@ -122,7 +122,7 @@ async function runLookup(client: Client, call_id: string | undefined, tool_call_ try { const status = await sendToCall(control_url, mode === 'say' ? { type: 'say', content: record ? `Here is what I found. ${record.summary}` : `Sorry, I could not find ${customer_name} in our records.` } - : { type: 'add-message', message: { role: 'system', content: `CRM result: ${summary}` }, triggerResponseEnabled: true }); + : { type: 'add-message', message: { role: 'system', content: `Account lookup finished. ${summary}` }, triggerResponseEnabled: true }); log(client, { type: 'live-call-control', call_id, detail: `${mode} sent for ${tool_call_id}: ${summary}`, bytes: 0 }); recordFlow({ source: client.source, kind: 'outbound', parent_event_id: event_id, label: `POST controlUrl ${mode}`, detail: summary, status, ok: true, duration_ms: Date.now() - started }); } catch (error: any) {