Different user, Different prompt - Same assistant
# support
s
I want different users on my app have different system and user prompts for their voice agents. For that, I am making a patch call to /assistant and updating both the prompts when my user is about to make the call. I am using a common assistant for the same. There would be an issue if: for 2 users U1 and U2: U1 triggers call --> vapi prompts are updated (as per U1) --> U2 triggers call --> vapi prompts are updated (as per U2) --> U1's call triggers (but vapi config has U2's prompt now) Is there a way out?
v
Thanks for describing your scenario in detail. Based on the information available, I don't have details on whether Vapi supports per-user or per-session prompts with a shared assistant, or if there's a built-in way to prevent prompt overwriting in this situation. If you have any other questions or need clarification on a different aspect, feel free to ask!
Thanks for describing your scenario in detail. Based on the information available, I don't have details on whether Vapi supports per-user or per-session prompts with a shared assistant, or if there's a built-in way to prevent prompt overwriting in this situation. If you have any other questions or need clarification on a different aspect, feel free to ask!
s
@User sorry for tagging here. in bit of a pickle here. have a customer demo in a couple of hours where I want to showcase parallel calls but with different prompts. in case this is not possible, any way out that is recommended? i hope my usecase is clear based on the question.
is
one assistant per user
the only way out of this?
k
Use per-user assistants, create transient ones per call, or pass user-specific prompts via assistantOverrides at call time instead of patching the assistant.
s
thanks @Kings_big💫 !! if possible, can you please lead to the correct place in docs for this? really appreciate it
checking the documentation here: https://docs.vapi.ai/assistants/dynamic-variables
seems like we can override variables. can we update the system and user prompts as well?
k
Yes, you can override system and user prompts dynamically using assistantOverrides in the API call https://docs.vapi.ai/assistants/dynamic-variables
s
Copy code
{
  "assistantId": "your-assistant-id",
  "assistantOverrides": {
    "variableValues": {
      "name": "John"
    }
  },
  "customer": {
    "number": "+1xxxxxxxxxx"
  },
  "phoneNumberId": "your-phone-id"
}
so instead of
name
, I would have
systemPrompt
and
userPrompt
, right?
couldn't see it in the api docs
in the 35 possible inputs
nvm found it, thanks :]
its in models --> openai --> ...