assistantOverrides in web widget
# support
s
How can I add assistantOverrides to the websnippet? https://github.com/VapiAI/html-script-tag
v
@Sangy To add
assistantOverrides
to the web snippet provided by VAPI, you'll need to modify the snippet code in your HTML file. Here's a general guide on how to do it: 1. Locate the VAPI web snippet in your HTML file. It should look similar to the example provided in the GitHub repository you mentioned. 2. Within the snippet, find the
vapiSettings
object. This is where you can add your
assistantOverrides
. 3. Add a new property to the
vapiSettings
object called
assistantOverrides
. The value of this property should be an object containing the specific overrides you want to apply. Here's an example of how you might modify the snippet:
Copy code
html
<script>
  (function(v,a,p,i){
    i = v.createElement("script"); i.async = 1; i.src = a;
    p = v.getElementsByTagName("script")[0]; p.parentNode.insertBefore(i, p);
  })(document, 'https://cdn.vapi.ai/webclient/vapi-client-latest.min.js');

  window.vapiSettings = {
    apiKey: 'your-api-key',
    assistantId: 'your-assistant-id',
    assistantOverrides: {
      // Add your assistant overrides here
      voice: 'en-US_AllisonVoice',
      // ... other overrides
    }
    // ... other settings
  };
</script>
Make sure to replace
'your-api-key'
and
'your-assistant-id'
with your actual API key and assistant ID. Also, replace the
voice
and other overrides with the actual values you want to use for your assistant. If you need further assistance or have specific overrides in mind, please let me know, and I'll be happy to help you configure them!
You can continue this conversation by mentioning me in the message.
@Sangy To add
assistantOverrides
to the web snippet provided by VAPI, you'll need to modify the HTML code where the VAPI script is included. Here's a step-by-step guide: 1. Locate the VAPI script tag in your HTML code. It should look something like this:
Copy code
html
<script src="https://cdn.vapi.ai/webclient/latest/vapi-client.js"></script>
2. Directly after the script tag, you'll want to add a script block where you can define your
assistantOverrides
. For example:
Copy code
html
<script>
  window.vapiConfig = {
    assistantOverrides: {
      // Your custom overrides here
      assistantId: 'your-assistant-id',
      // ... other overrides
    }
  };
</script>
3. Replace
'your-assistant-id'
and other placeholders with the actual values you want to use for your overrides. 4. Ensure that this configuration is placed before the initialization of the VAPI client in your code. Here's a complete example:
Copy code
html
<!-- VAPI script inclusion -->
<script src="https://cdn.vapi.ai/webclient/latest/vapi-client.js"></script>

<!-- VAPI configuration with assistantOverrides -->
<script>
  window.vapiConfig = {
    assistantOverrides: {
      assistantId: 'your-assistant-id',
      // Add other overrides as needed
    }
  };
</script>

<!-- Your existing code where VAPI is initialized -->
<script>
  // Your code to initialize and use VAPI
</script>
Make sure to replace the placeholders with the actual values you need for your application. If you have any further questions or need more assistance, feel free to ask!
You can continue this conversation by mentioning me in the message.
s
@Sahil i got 2 wrong answers and not able to ask for help
s
As per I know, AssistantOverride isn't supported in web-snippet but need to confirm with the team.
s
please check and lmk. I need to update the voices for hte assistant so that it seems like different ppl are answering. the alternative is listen to call reports and manually patch the assistant.
s
Sure, I will let you know but just so you know it is supported in web SDK
It will done by today.
Done.
s
Awesome
23 Views