Marco Falcone
01/17/2025, 4:41 PMVapi
01/17/2025, 4:43 PMVapi
01/17/2025, 4:43 PMMarco Falcone
01/17/2025, 4:48 PMjson
{
"id": "indigoai-1",
"object": "chat.completion.chunk",
"created": 63904351243,
"model": "ndg",
"system_fingerprint": "fp_ndg",
"choices": [
{
"delta": {
"tool_calls": [
{
"function": {
"arguments": "{}",
"name": "endCall"
},
"id": "call_84934067-e51f-4380-a76e-0dfb8f32ff8a_0",
"index": 0
}
]
},
"finish_reason": "function_call",
"index": 0,
"logprobs": null
}
]
}
Is this correct?Vapi
01/17/2025, 4:48 PMendCall
, and it's being called with an empty arguments object {}
.
However, I don't have the exact specifications for the endCall
function or other related functions like transferCall
or dial
in the context provided. If endCall
is indeed the correct function name and it requires no arguments, then your chunk should work as intended.
If you're not sure about the function names or the required arguments, please refer to the Vapi documentation or ask support for the correct specifications. If endCall
is not the correct function name or if there are specific arguments needed, you'll need to adjust the chunk accordingly.
If you need further assistance with the correct function names or arguments, please let me know, and I'll be glad to help!Marco Falcone
01/17/2025, 4:50 PMVapi
01/17/2025, 4:50 PMMarco Falcone
01/17/2025, 4:51 PMShubham Bajaj
01/18/2025, 4:00 AMpy
if request_payload.function_name == "transferCall" and request_payload.destination:
function_call_payload = {
"function_call": {
"name": request_payload.function_name,
"arguments": {
"destination": request_payload.destination
},
}
}
yield f"data: {json.dumps(function_call_payload)}\n\n"
Shubham Bajaj
01/18/2025, 4:01 AMShubham Bajaj
01/18/2025, 4:01 AMMarco Falcone
01/20/2025, 9:30 AMMarco Falcone
01/20/2025, 9:31 AMendCall
, transferCall
and dtmf
tools and they are provided in the request to my LLM.
My LLM responses are in chunks. If I try to return a chunk like the one you suggest Vapi crashes.
If I wrap the function call in a chunk structure, Vapi play the text provided but doesn't execute the function.
I'm trying the behavior from dashbord web preview with the endCall
tool. I don't know if this can be relevant.
Here is an example of returned chunkes:
data: {"choices":[{"delta":{"content":"Goodmorning! Ask me anything.","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":63904584257,"id":"indigoai-5fc61008-5310-4b97-98d3-09b9d12fc19d","model":"ndg","object":"chat.completion.chunk","system_fingerprint":"fp_ndg"}
data: {"choices":[{"delta":{"content":null,"tool_calls":[{"function":{"arguments":{},"name":"endCall"},"id":"call_5fc61008-5310-4b97-98d3-09b9d12fc19d_0","index":0}]},"finish_reason":"function_call","index":0,"logprobs":null}],"created":63904584257,"id":"indigoai-5fc61008-5310-4b97-98d3-09b9d12fc19d","model":"ndg","object":"chat.completion.chunk","system_fingerprint":"fp_ndg"}
data: {"choices":[{"delta":{},"finish_reason":"stop","index":0,"logprobs":null}],"created":63904584257,"id":"indigoai-5fc61008-5310-4b97-98d3-09b9d12fc19d","model":"ndg","object":"chat.completion.chunk","system_fingerprint":"fp_ndg"}
Is there something wrong in the chunks I produce?
Thanks for your help 🙏Marco Falcone
01/22/2025, 8:26 AMShubham Bajaj
01/22/2025, 4:56 PMMarco Falcone
01/22/2025, 4:59 PMShubham Bajaj
01/22/2025, 4:59 PM