𝙠𝙝𝙖𝙯𝙙𝙧𝙖𝙜𝙨
05/14/2024, 3:04 PMVapi Support
05/14/2024, 3:04 PMVapi Support
05/14/2024, 3:04 PMjson
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Your response content here...",
"role": "assistant"
},
"logprobs": null
}
],
"created": 1677664795,
"id": "chatcmpl-7QyqpwdfhqwajicIEznoc6Q47XAyW",
"model": "gpt-3.5-turbo-0613",
"object": "chat.completion",
"usage": {
"completion_tokens": 17,
"prompt_tokens": 57,
"total_tokens": 74
}
}
Make sure your response matches this structure [(1)]() .
2. **Server and Streaming**:
If your custom LLM server does not support streaming completions, it may cause issues. Vapi expects the server to support streaming completions [(2)]() . Ensure your server configuration can handle streaming or adjust your integration accordingly.
3. **Error Handling**:
If the assistant stops working after switching to custom LLM, ensure that you have executed a PATCH request to the /assistant endpoint and set model.urlRequestMetadataEnabled to false [(3)]() , [(4)]() .
Please verify these points in your implementation to ensure the responses are correctly formatted and processed by Vapi.Sahil
05/14/2024, 3:08 PM𝙠𝙝𝙖𝙯𝙙𝙧𝙖𝙜𝙨
05/14/2024, 3:11 PMSahil
05/14/2024, 4:30 PM𝙠𝙝𝙖𝙯𝙙𝙧𝙖𝙜𝙨
05/14/2024, 6:13 PMVapi Support
05/15/2024, 1:14 PMSahil
05/15/2024, 2:24 PMAgus
05/15/2024, 3:55 PMSahil
05/15/2024, 3:59 PMAgus
05/15/2024, 5:13 PMSahil
05/15/2024, 5:34 PM𝙠𝙝𝙖𝙯𝙙𝙧𝙖𝙜𝙨
05/16/2024, 7:19 PMSahil
05/16/2024, 7:20 PM𝙠𝙝𝙖𝙯𝙙𝙧𝙖𝙜𝙨
05/16/2024, 7:25 PMSahil
05/16/2024, 7:26 PMSahil
05/16/2024, 7:27 PM𝙠𝙝𝙖𝙯𝙙𝙧𝙖𝙜𝙨
05/16/2024, 7:31 PMSahil
05/16/2024, 7:33 PM𝙠𝙝𝙖𝙯𝙙𝙧𝙖𝙜𝙨
05/16/2024, 7:35 PM𝙠𝙝𝙖𝙯𝙙𝙧𝙖𝙜𝙨
05/16/2024, 7:35 PMSahil
05/16/2024, 7:35 PMSahil
05/16/2024, 7:41 PMdata: ${JSON.stringify(dataChunks[index])}\n\n);
await new Promise((resolve) => setTimeout(resolve, 5000));
}
res.write('data: [DONE]\n\n');
res.end();
req.on('close', () => {
res.end();
});
});
app.post('/', (req, res) => {
console.dir(req.body, { depth: null });
res.json({});
});
app.listen(3030, () => {
console.log('Server is running on port 3030');
});Sahil
05/16/2024, 7:41 PM𝙠𝙝𝙖𝙯𝙙𝙧𝙖𝙜𝙨
05/16/2024, 7:50 PM𝙠𝙝𝙖𝙯𝙙𝙧𝙖𝙜𝙨
05/16/2024, 8:10 PMSahil
05/16/2024, 8:13 PMAgus
05/16/2024, 8:15 PM