Example: I've created several assistants
# general-english
a
Example: I've created several assistants - they are interchangeable based on the client I am working with. They generally understand how they will interact with the user. I call the assistant-request which looks up the user and handles context that way great - i.e. who's calling, membership expiration date, etc. Now, I need to actually provide context for the client - for example: description of a business, hours of operation, parking, etc. These are more loose and not "variable" driven. So, I create a json that includes all of this information in a nice clean package. I can deliver this package great in a toolcall, but I would rather deliver that information as part of the call context so that the call isn't interrupted to get something I could have sent during the assistant-request.
a
yes still adding this in context inside the prompt is the best way, then secondarily would be RAG where you dynamcially load the a KB item with that information but that would not be ideal. How is your prompt structured? using a tool to call it async in the background is an ok idea but causes latency
you could def do what you want to do best with a transient/dynamic agent that contains the caller details and company details in context 🙂
a
Can I update the prompt during assistant request?
a
yes 🙂
get assistant then override the prompt 🙂 or even better make a transient agent
a
which field do i use? I tried to send a json sample but it denied it.
a
here is a sample JSON structure for a transient agent you could just pass this to VAPI and it will run this agent...
a
... can you show me how to override the prompt? I can't see a "prompt" item in the json example.
c
Here is an example. { "assistant": { "name": "Lisa", "voice": { "voiceId": "en-AU-KimNeural", "provider": "azure" }, "model": { "model": "gpt-3.5-turbo", "messages": [ { "role": "system", "content":"You are bot. Get ready to be a conduit of transformational energy, insight, and inspiration. Client information: -Name:() information you gathered from the client during your previous call, about the client (Name: , Last call conversation Summary:{{12.fields.summary}} ). your first question needs to be regarding the conversation you had with them last time from checking the last call conversation Summary:{{12.fields.summary}} . You need to ask them a question from the last call summary and then continue the conversation. If it's your first conversation then ask for the name." } ], "provider": "openai", "functions": [ ], "maxTokens": 250, "temperature": 1 }, "recordingEnabled": false, "firstMessage": "Hello, this is Lisa from NoCodePrenuers", "voicemailMessage": "You've reached NoCodePrenuers. Please leave a message after the beep, and we'll get back to you as soon as possible.", "endCallFunctionEnabled": true, "endCallMessage": "Thank you for contacting NoCodePrenuers. Have a great day!", "transcriber": { "model": "nova-2", "language": "en", "provider": "deepgram" }, "clientMessages": [ "transcript", "hang", "function-call", "speech-update", "metadata", "conversation-update" ], "serverMessages": [ "end-of-call-report", "function-call" ], "dialKeypadFunctionEnabled": false, "endCallPhrases": [ "goodbye", "talk to you soon" ], "hipaaEnabled": false, "backgroundSound": "off", "serverUrl": "Enter the same webhook that started this automation", "serverUrlSecret": "" } }
check mine there
c
You can use a variable to replace the entire prompt.
Does that VM detection work for you?
a
its ok
nothing perfect yet 😛
c
Do you put a VM message there when it runs or no?
a
but looks like you may have something!
I would if i want it not to hang up
a
Ok, so you would put the entire prompt in the "content" : "PROMPT_HERE" block?
c
Ohh yea I know two ways for it to be 100 percent now.
a
otherwise leaving it blank hangs up
and you can customize that prompt 🙂
so it would cntain the specifics for your call, no need for dynamic vars at that point 🙂
Whats the other way? I know you said you were using the VAPI tool, whats the other way?
c
Just leaving a VM message with no tool. Tested over 100 calls and for some reason (even with a tool) it will detect VM without running the tool.
Then I found with the tool i had it worked 100 percent. But need to add a complete message with end call on success. and 100 percent
a
yea thats whats hard about the middle tier comps like VAPI 🙂 you dont have full access to what is happening behind the scenes
you mean the VAPI VM tool right?
c
Maybe i will get the answer i bit later from the team from a ticket. But that one is weird.
Yep.
a
@awf did that help answer your question btw?
a
I am going to try it .... I hope that's the answer I'm looking for.
a
feel free to ping me if you get stuck etc
a
Thank you!!!