DomnulZeu
05/15/2024, 10:24 AMVapi Support
05/15/2024, 10:24 AMVapi Support
05/15/2024, 10:25 AMjavascript
function cleanText(text) {
// Remove unwanted artifacts such as hashtags and asterisks
return text.replace(/[#*]+/g, '');
}
const assistantOptions = {
name: "Vapi’s Pizza Front Desk",
firstMessage: "Vappy’s Pizzeria speaking, how can I help you?",
transcriber: {
provider: "deepgram",
model: "nova-2",
language: "en-US",
},
voice: {
provider: "playht",
voiceId: "jennifer",
},
model: {
provider: "openai",
model: "gpt-4",
messages: [
{
role: "system",
content: `You are a voice assistant for Vappy’s Pizzeria, a pizza shop located on the Internet.
Your job is to take the order of customers calling in. The menu has only 3 types
of items: pizza, sides, and drinks. Be sure to introduce the menu items, don't assume that the caller knows what
is on the menu. Once you have all the information you need pertaining to their order, you can
end the conversation. Use casual and short responses.`,
},
],
},
};
// Clean the system prompt
assistantOptions.model.messages[0].content = cleanText(assistantOptions.model.messages[0].content);
vapi.start(assistantOptions);
This script cleans the text before it is processed by the TTS engine [(1)]() . For more detailed configurations, refer to Vapi’s [Quickstart Documentation]().Sahil
05/16/2024, 10:32 AMluke199335
05/16/2024, 6:50 PMSahil
05/16/2024, 7:04 PMluke199335
05/16/2024, 7:31 PMSahil
05/16/2024, 7:34 PMluke199335
05/16/2024, 7:59 PMSahil
05/16/2024, 8:08 PMluke199335
05/16/2024, 8:16 PMKH
05/16/2024, 8:22 PMSahil
05/16/2024, 8:22 PMSahil
05/16/2024, 8:22 PMKH
05/16/2024, 8:32 PMSahil
05/16/2024, 8:34 PMluke199335
05/16/2024, 8:40 PMSam
05/16/2024, 8:45 PMluke199335
05/16/2024, 9:06 PMSam
05/16/2024, 9:12 PMSam
05/16/2024, 9:15 PMSam
05/17/2024, 12:49 PMSahil
05/17/2024, 1:06 PMluke199335
05/17/2024, 7:32 PMSahil
05/18/2024, 9:30 AMluke199335
05/18/2024, 12:36 PMSahil
05/18/2024, 12:55 PMSahil
05/18/2024, 5:19 PMSahil
05/19/2024, 2:44 AMluke199335
05/19/2024, 7:27 AMSahil
05/19/2024, 7:33 AMluke199335
05/19/2024, 5:01 PMluke199335
05/21/2024, 10:10 AMSahil
05/21/2024, 12:02 PMluke199335
05/21/2024, 1:02 PMSahil
05/21/2024, 1:41 PMluke199335
05/21/2024, 4:30 PMSahil
05/21/2024, 5:34 PMSahil
05/21/2024, 5:34 PM