Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion vapi/agency-routing/src/clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion vapi/agency-routing/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading