Web Call Assistant Override
# support
b
Can I have a web assistant overrided with a new voice?
v
@Brian Absolutely! To override the voice settings for your web assistant, you can pass the new voice configuration as part of the
assistantOverrides
argument. Could you please provide me with the details of the new voice you'd like to use, such as the voice provider and voice ID?
You can continue this conversation by mentioning me in the message.
b
@Vapi Eleven Labs And the voice ID IS Qy12wuGOtvKPVgCREzXh
v
@Brian Great choice! To update your web assistant with the new voice from Eleven Labs with the voice ID
Qy12wuGOtvKPVgCREzXh
, you'll need to integrate this change into your system settings or pass the appropriate parameters if you're using an API. If you're working with an API or a specific platform, you would typically send a request with the new voice settings. However, since I'm here to assist with VAPI, could you clarify if you're looking to update the voice settings through VAPI or another method? This will help me provide you with the most accurate guidance.
b
@Vapi Well I want it to always change so its going to have to be thru webcall sdk not settings
v
@Brian Understood! If you want the voice to change dynamically through the WebCall SDK, you'll need to implement logic in your application that sets the voice parameters before each call is made. Here's a general approach on how you might do this: 1. Retrieve the desired voice ID from your database or configuration file. 2. Set the voice ID in the call parameters before initiating the call with the WebCall SDK. 3. Initiate the call with the new voice settings. Since you're using the WebCall SDK, you would typically have a function or method where you configure the call parameters. You would insert the new voice ID there. Here's a pseudo-code example:
Copy code
javascript
// Function to initiate a call with dynamic voice settings
function makeCallWithDynamicVoice(voiceID) {
  // Set up your call parameters, including the dynamic voice ID
  let callParams = {
    // ... other call parameters ...
    voice: {
      provider: 'ElevenLabs',
      voiceID: voiceID
    }
  };

  // Use the WebCall SDK to initiate the call with these parameters
  webCallSDK.makeCall(callParams);
}

// Retrieve the voice ID from your configuration and make the call
let dynamicVoiceID = 'Qy12wuGOtvKPVgCREzXh'; // This would be dynamically retrieved
makeCallWithDynamicVoice(dynamicVoiceID);
Please ensure that you replace
webCallSDK.makeCall
and other placeholders with the actual methods and variables from your implementation. If you need further assistance with the code or have any other questions, feel free to ask!
b
@Vapi this is what i have currently Qy12wuGOtvKPVgCREzXh
@Vapi function(instance, properties) { const assistantOverrides = { voice: { provider: "11labs", voiceId: properties.voiceId || "burt" }, variableValues: properties.variables ? JSON.parse(properties.variables) : {} }; return instance.data.vapi.start(properties.assistantId, assistantOverrides) .then(response => { console.log("Call started successfully:", response); if (response && response.id) { instance.publishState("currentCallId", response.id); console.log("Call ID set to:", response.id); } }) .catch(error => { console.error("Error starting call:", error); throw error; }); }
v
@Brian It seems like there might have been a bit of confusion. You've provided the voice ID
Qy12wuGOtvKPVgCREzXh
twice, which is the identifier for the new voice from Eleven Labs that you want to use. To proceed with setting this voice ID for your web assistant through the WebCall SDK, you would need to incorporate this voice ID into your call setup. If you have existing code where you configure your web assistant's voice settings, you would update that section with the new voice ID. If you're unsure how to do this or if you need specific instructions on where to place this voice ID in your code, please provide me with more details about your current setup or the SDK you are using. This will allow me to give you more precise guidance. If you're ready to implement the change and need assistance with the code, please share the relevant part of your code where you set up the voice for your web assistant.
@Brian The function you've provided looks like it's designed to start a call with an assistant using the VAPI, and it includes the ability to override the assistant's voice settings. To use the new voice ID
Qy12wuGOtvKPVgCREzXh
from Eleven Labs, you'll need to ensure that the
properties.voiceId
passed to the function contains this new voice ID. Here's how you can modify the function to use the new voice ID:
Copy code
javascript
function(instance, properties) {
    // Ensure the voiceId property is set to the new Eleven Labs voice ID
    const assistantOverrides = {
        voice: {
            provider: "11labs",
            voiceId: properties.voiceId || "Qy12wuGOtvKPVgCREzXh" // Default to the new voice ID if not provided
        },
        variableValues: properties.variables ? JSON.parse(properties.variables) : {}
    };

    // Start the call with the assistant using the provided or default voice ID
    return instance.data.vapi.start(properties.assistantId, assistantOverrides)
        .then(response => {
            console.log("Call started successfully:", response);
            if (response && response.id) {
                instance.publishState("currentCallId", response.id);
                console.log("Call ID set to:", response.id);
            }
        })
        .catch(error => {
            console.error("Error starting call:", error);
            throw error;
        });
}
Make sure that when you call this function, you pass the
voiceId
property with the value
Qy12wuGOtvKPVgCREzXh
if you want to use that specific voice. If you don't pass the
voiceId
property, it will default to the new voice ID you've set as the fallback. If you need further assistance or have any other questions, feel free to ask!
b
@Vapi You've changed nothing?
v
@Brian Apologies for any confusion. It appears that the function you've provided already has the capability to override the voice settings for the web assistant. If you want to use the new voice ID
Qy12wuGOtvKPVgCREzXh
from Eleven Labs, you should ensure that the
properties.voiceId
that is passed to the function is set to this value. If you are calling this function and want to use the new voice ID, you should pass it like this:
Copy code
javascript
// Example of how you might call the function with the new voice ID
var instance = /* your instance */;
var properties = {
    assistantId: /* your assistant's ID */,
    voiceId: "Qy12wuGOtvKPVgCREzXh", // The new voice ID from Eleven Labs
    variables: /* your variables in JSON string format if needed */
};

// Call the function with the properties including the new voice ID
yourFunction(instance, properties);
Make sure to replace
yourFunction
,
your instance
,
your assistant's ID
, and
your variables
with the actual function name, instance object, assistant ID, and variables you are using in your application. If you are already passing the correct
voiceId
when calling the function and it's not using the new voice, please ensure that the
provider
is correctly set to match Eleven Labs' provider name as recognized by the VAPI. If the issue persists, please ask support for more info on this.
b
@Vapi This isnt working if it was i wouldnt be asking for help. i run it and it just ends immediately
v
@Brian I'm sorry to hear that the call is ending immediately. This could be due to a variety of reasons, including misconfiguration of the voice settings, issues with the VAPI, or other errors in the setup. To troubleshoot this issue, we can start by checking the following: 1. Confirm that the
provider
name matches exactly with what the VAPI expects. It's possible that "11labs" should be "ElevenLabs" or another string that the API recognizes. 2. Ensure that the
voiceId
is valid and correctly recognized by the provider. 3. Verify that the
assistantId
is correct and that the assistant is properly configured to handle calls. 4. Check if there are any error messages being logged that could provide more insight into why the call is ending immediately. 5. Make sure that all other parameters and configurations required to start a call are correctly set. If you have access to error logs or any additional debugging information, please review them to see if they offer any clues. If the problem persists and you're unable to resolve it with the information available, it may be best to reach out to the VAPI support team for further assistance. Since I'm here to help you with VAPI, if you can provide any error messages or logs, I can try to assist you further. Otherwise, if you need direct support from the VAPI team, please ask support for more info on this.
b
@Vapi can you tell me if this is in the way its being expected?
s
@Brian Yes, it's possible to use assistant overrides for web calls as well. If you're using the web SDK, then you have to pass the assistant overrides as the second parameter.
Copy code
vapi.start(assistantId, assistantOverrides)
Reference: https://github.com/VapiAI/client-sdk-web/blob/fce9720d0b14e90f19b571966876efa0f8ec02b8/vapi.ts#L192