Ethan Tan
08/21/2024, 5:32 PMUsing Fine-Tuned OpenAI Models
To set up your OpenAI Fine-Tuned model, you need to follow these steps:
Set the custom llm URL to https://api.openai.com/v1.
Assign the custom llm key to the OpenAI key.
Update the model to their model.
Execute a PATCH request to the /assistant endpoint and ensure that model.metadataSendMode is set to off.
This is my current code:
const vapi = new Vapi("x");
const assistantOptions = {
name: "Vapi’s Pizza Front Desk",
firstMessage: "Vappy’s Pizzeria speaking, how can I help you?",
transcriber: {
provider: "deepgram",
model: "nova-2",
language: "en-US",
},
voice: {
provider: "playht",
voiceId: "jennifer",
},
model: {
provider: "openai",
model: "gpt-4o",
messages: [
{
role: "system",
content: `x`,
},
],
},
};
const startCallButton = document.getElementById('startCallButton');
const voiceAnimation = document.getElementById('voiceAnimation');
let callActive = false;
// Add this line to check if the button is found
console.log('Start/End Call button:', startCallButton);
// Just before attaching the event listener
console.log('About to attach event listener');
startCallButton.addEventListener('click', async () => {
console.log('Event listener triggered');
console.log('Button clicked. Call active:', callActive);
if (!callActive) {
try {
startCallButton.disabled = true;
startCallButton.innerText = 'Connecting...';
voiceAnimation.classList.add('voice-animation-active');
await vapi.start(assistantOptions);Vapi
08/21/2024, 5:33 PMShubham Bajaj
08/21/2024, 10:17 PMjson
{
"model":
{
"provider": "custom-llm",
"metadataSendMode": "off",
"url": "<insert-your-model-url-here>",
"model": "<insert-your-model-name-here>"
}
}Ethan Tan
08/22/2024, 9:14 AMvrancic
08/22/2024, 2:47 PMShubham Bajaj
08/23/2024, 4:50 AM