like-gold
like-gold16mo ago

Dynamic Assistant Prompts

Hi everyone, I'm exploring VAPI and have a couple of questions: 1. Does VAPI support creating dynamic assistant prompts? For example, can I have a single assistant, but via the API, pass a dynamic prompt to give a personalized experience? A use case would be an interview assistant where I pass custom prompts with unique questions for each candidate. 2. Is it possible to share the URL of the assistant with a custom prompt? For instance, if I have 10 applicants with separate sets of questions, can I send each applicant a unique URL with their respective prompts/questions? (something like that DEMO LINK url) Or, if this isn't possible, does it mean I need to create a new/individual assistant for each applicant? Thanks for your help! Tested the playground and it's pretty good.
4 Replies
Ask Inkeep
Ask Inkeep16mo ago
Hi @zpayab, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly. ----------------------------- While I generate an answer, here are some sources that might be helpful: * Dynamic Variables * Create Assistant * Web Calling * Get Assistant -----------------------------
Ask Inkeep
Ask Inkeep16mo ago
Answer 1. Dynamic Assistant Prompts: Yes, Vapi supports creating dynamic assistant prompts. You can personalize an assistant’s messages and prompts using variables, allowing each call to be customized. This is done through assistantOverrides with variableValues passed to the API or SDK. For example:
{
"variableValues": {
"name": "John"
}
}

{
"variableValues": {
"name": "John"
}
}

In your prompt templates, you can use variables like {{name}} which will be replaced dynamically during the call (1) . 2. Sharing Assistant URL with Custom Prompt: Vapi allows creating temporary assistants with custom configurations on the fly via the Web SDK. You can customize properties from the frontend dynamically without creating new assistants for each applicant. Here is a brief example:
const assistantOptions = {
name: "Interview Assistant",
firstMessage: "Hello, let's start your interview.",
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 an interview assistant. The candidate is {{name}}.`,
},
],
},
};
vapi.start(assistantOptions);

const assistantOptions = {
name: "Interview Assistant",
firstMessage: "Hello, let's start your interview.",
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 an interview assistant. The candidate is {{name}}.`,
},
],
},
};
vapi.start(assistantOptions);

This allows you to send a unique URL for each applicant with their respective prompts/questions without needing to create a new assistant each time (2) .
Ask Inkeep
Ask Inkeep16mo ago
Got it. Tagging @Vapi Team for additional help.
foreign-sapphire
foreign-sapphire16mo ago
It is possible to have dynamic assistant prompts you can checkout the community video section it contains bunch of examples of it. https://docs.vapi.ai/community/videos
Vapi
Community Videos - Vapi
Videos showcasing Vapi out in the wild.

Did you find this page helpful?