Inbound assistant is not speaking when it picks up...
# support
s
Hi, I provide the firstMessage parameter when returning the assistant config to vapi on an inbound call. The call shows no errors, but I do not hear the agent speak until I speak first. I also set : firstMessageMode: "assistant-speaks-first", and this still doesn't have the agent speek first. SO despite: firstMessageMode: "assistant-speaks-first", firstMessage:
${script.first_message ? script.first_message : "Hello how can i assist you?"}
, I still have to say the first words to get a response. This is the case on outbound calls as well. Again, VAPI doesn't return an error, which indicates to me that the config was structured correctly. Plz help.
v
@SlaviSavanovic I'm sorry to hear that you're experiencing issues with the
firstMessageMode
and
firstMessage
parameters. It sounds like you've set everything correctly, but the assistant is not initiating the conversation as expected. To assist you better, I would need to check a few details: 1. Can you confirm that the
firstMessage
parameter is being passed correctly in the API request? 2. Is there any specific condition or logic in your code that might be preventing the
firstMessage
from triggering? 3. Have you tested this with different
firstMessage
texts to see if the issue persists? 4. Are there any other configurations or settings that might be conflicting with the
firstMessageMode
? If everything seems to be in order on your end, this might require a deeper investigation. In that case, please reach out to our support team with the details of your implementation, and they will be able to help you troubleshoot this issue further.
You can continue this conversation by mentioning me in the message.
s
@Vapi firstMessage: "Hello how can i assist you today?", Even when i simplify it to this I still hear nothing when i call the agent.
v
@SlaviSavanovic It's clear that the issue persists even with a simplified
firstMessage
. Since the configuration seems correct and there are no errors reported by VAPI, this might be an issue that requires direct support intervention to investigate system logs or potential bugs. Here's what you can do next: 1. Double-check that the
firstMessageMode
is set to
"assistant-speaks-first"
in the same configuration scope as the
firstMessage
. 2. Ensure that there are no conditions or overrides in your code that might affect the execution of the
firstMessage
. 3. Test the functionality in a different environment or with a minimal setup to rule out any environmental issues. 4. If possible, enable detailed logging and review the logs for any clues as to why the
firstMessage
is not being spoken. If after these steps the issue remains unresolved, please reach out to our support team with specific details about your configuration, the steps you've taken to troubleshoot, and any relevant logs or information. They will be able to provide more targeted assistance.
s
@Vapi return { assistant: { model: { provider: agent.llm_provider, model: agent.llm_model, messages: [{ role: "system", content: `Your description: ${agent.description}\n\nYour instructions: ${agent.instructions}${ script?.instructions ?
\n\nContext: You are answering the phone. This is an inbound call. Here is the script to follow: ${script.instructions}
: '' }` }], ...(knowledgebase?.vapi_file_id ? { knowledgeBase: { provider: "canonical", fileIds: [knowledgebase.vapi_file_id], topK: 3 } } : {}) }, voice: { provider: agent.voice_provider, voiceId: agent.voice_id }, firstMessageMode: "assistant-speaks-first", firstMessage: "Hello how can i assist you today?", backgroundSound: "off" } }; this is what I am returning, is anything here overriding?
v
@SlaviSavanovic The configuration you've provided looks correct and there doesn't seem to be anything that would override the
firstMessage
settings. The
firstMessageMode
is set to
"assistant-speaks-first"
and the
firstMessage
is clearly defined. Given that the configuration appears to be in order, the issue might be related to something outside of the provided configuration. Here are a few additional steps you can take: 1. Verify that the
agent.llm_provider
,
agent.llm_model
,
agent.voice_provider
, and
agent.voice_id
values are correctly set and that they correspond to valid and active configurations on the VAPI platform. 2. Ensure that the
knowledgebase
conditional block is functioning as expected and that it's not causing any unintended side effects. 3. Check if there are any platform-specific requirements or known issues with the
firstMessage
feature that you might have missed. 4. Test the configuration with a hardcoded
provider
,
model
, and
voiceId
that are known to work, to rule out any issues with dynamic values. If the issue persists after these checks, it would be best to contact support with the details of your configuration and the steps you've taken to troubleshoot. They may need to look into the system more deeply or escalate the issue to the technical team for resolution.
d
How can Vapi say the {{contact.first_name}}, so that the call is personalized?
s
@Vapi It works, the agent speaks and follows all of the instructions, but no first message. That's my main issue
v
@SlaviSavanovic To personalize the call with VAPI and have the agent say the contact's first name, you would typically use a variable placeholder in the
firstMessage
string that gets replaced with the actual first name of the contact when the call is made. However, the exact method to implement this will depend on how your system passes the contact's first name to VAPI. Here's a general example of how you might structure the
firstMessage
to include a placeholder for the contact's first name:
Copy code
javascript
firstMessage: `Hello ${contact.first_name}, how can I assist you today?`
In the above example,
${contact.first_name}
is a placeholder that should be replaced with the actual first name of the contact when the call is initiated. Regarding the issue with the
firstMessage
not being spoken, since the configuration seems correct and the agent is able to speak and follow instructions after the initial message, it's possible that there might be a delay or a condition preventing the
firstMessage
from being triggered immediately. Here are a few additional troubleshooting steps: 1. Check for any delays in the system that might cause the
firstMessage
to be skipped or not played immediately. 2. Review the documentation for any additional parameters or settings that might affect the
firstMessage
behavior. 3. Test with a very basic
firstMessage
to rule out any issues with the content of the message itself. 4. If you have access to any logs or debugging tools, use them to see if the
firstMessage
is being processed and if there are any errors or warnings. If none of these steps resolve the issue, it would be advisable to contact VAPI support with detailed information about your implementation and the specific problem you're facing with the
firstMessage
. They may need to investigate further to determine the cause and provide a solution.
s
What's the context? Are you building this in vapi or your own program?
d
I am using Go High Level directly with Vapi, however when I have the Voice Agent make a few calls, it does not call the person by their name. 🤔
s
In your vapi configurations, in the system prompt or first message you need to provide their first name {{firstname}} like "Their first name is {{firstname}}." From go highlevel you need to pass that as a variable. -> I would have to see the go high level set up in order to help you https://cdn.discordapp.com/attachments/1330719239082086492/1330723619860381726/image.png?ex=678f0472&is=678db2f2&hm=00d898a4f5b551c6ed764accc54a41f3efb2114312792fe6020a0861e7c5881a&
@Dwayne
d
In Go Highlevel, the first name variable (custom value) is: {{contact.first_name}}. Should I try this anyway with {{firstname}}?
s
I see what you're saying
d
Here is the JSON in Go Highlevel { "assistantId": "a71f051f-16d6-4bc1-8446-814f2a6c2fc5", "assistantOverrides": { "variableValues": { "number": "{{contact.phone_raw}}", "name": "{{contact.first_name}}", "email": "{{contact.email}}", "address": "{{contact.full_address}}", "service": "{{contact.service_requested}}" } }, "phoneNumberId": "bbf3a0c3-c36b-49fc-9b97-487feb4a6d79", "customer": { "number": "{{contact.phone_raw}}", "name": "{{contact.first_name}}" } }
s
This looks possibly correct, to verify that vapi is recieving the values in the variables you should use the variable in the system prompt or the first message like this: Hi, my name is {{name}}. and see if it can tell you what it's name is. I can't tell if this is passed correctly, because right now what I see is a json object with the variable value as {{contact.firstname}}. Would it be possible if you show me a screenshot of the set up?
@Dwayne
d
Ok I can try that right now and let you know
"name" or {{name}}?
s
there is a chance that gohighlevel is literally sending the name as {{contact.first_name}} and so the agent probably doesn't understand that. This looks like it should say "name": "John" not {{contact.first_name}}
In Vapi system prompt it will be {{name}}
vapi will replace {{name}} With the name from GHL
d
ok, so change the JSON, or just change in the prompt? @SlaviSavanovic
s
From the json you sent me, it shows that what vapi is recieving is literally this: {{contact.first_name}} vapi will read that exactly as it is. This is why i asked for a screen shot of the set up
d
The tests work perfectly, just the AI Agent does not say the first name 🙂
s
@Dwayne Please delete that image because it shows youraccess token
this is a public forum
people could use that
give me a second - if everything works correctly but the agent does not say the name
check this
Is this how you have it set up?
not exactly but the variable
@Dwayne
d
Oh, let me show you ....
@SlaviSavanovic
s
@SlaviSavanovic could you share the recent call id so I can take a look?
s
@Shubham Bajaj "id": "d18cde09-074a-4c31-8249-b5dc009f436a",
@Dwayne it needs to be {{name}} not {{contact.first_name}}
s
@SlaviSavanovic This is the issue with realtime models - they are currently in beta and you can expect things to look good at surface level but work differently in practice. You know how these things work, try using other models.
s
@SlaviSavanovic Shoot you are right - I forgot about that. Sorry my friend let me check. Thank you
@Shubham Bajaj You were correct. It was realtime. Thanks again. Maybe we can send an update to the team once this is fixed? This should be an easy fix I imagine
@Vapi Store this in your memory for future use
v
@SlaviSavanovic Absolutely, I'll keep this in mind for future reference. If you encounter any more issues or have further questions, feel free to reach out. I'm here to help! If there's anything else you need assistance with right now, just let me know.
m
hi. i am not clear on how variable names work in the prompt. if i have the following line: Ask the name of the caller, {{_callerName}} will the agent automatically store the name in that variable? if the above is wrong, please tell me the correct way to store values in vars thanks!!!
s
@mansoor50 No, not how that works, but that's a great question. The variables are for when you are using vapi somewhere else. Lets say a customer fills out your form on your website, and their name was "James" On the form, they would put: Firstname = James So if you want vapi to call the people once they fill out that form, you would need to pass their firstname to vapi so that the agent knows who they are. Let me know if that makes any sense, kinda hard to explain in a discord chat
@mansoor50 @Dwayne https://www.skool.com/ai-wizard If you guys want to join my community I have Q&A's every Thursday at 5PM ET on Zoom with everyone. I'd be happy to answer any other questions that you have
It's also free (:
m
i just joined...waiting for approval
d
Ok it is working now my brother using this JSON. Thanks for your help. { "assistantId": "a71f051f-16d6-4bc1-8446-814f2a6c2fc5", "assistantOverrides": { "firstMessage": "May I speak to {{contact.first_name}}?", "variableValues": { "name": "{{contact.first_name}}", "email": "{{contact.email}}", "number": "{{contact.phone_raw}}" } }, "phoneNumberId": "99029af4-441a-4500-9cd2-5de55336b06c", "customer": { "number": "{{contact.phone_raw}}", "name": "{{contact.first_name}}" } }
19 Views