ltd-scarletL
VAPI8mo ago
ltd-scarlet

Custom LLM endCall tool call

Hi,

I'm using the custom LLM integration and it's working great.

I'm trying to invoke the endCall tool at the end of the conversation. I'm streaming back the result which looks like

`data: ${JSON.stringify({
  id: ...,
  object: "chat.completion.chunk",
  created: Math.floor(Date.now() / 1000),
  model: modelName,
  choices: [
    {
      index: 0,
      delta: {
        tool_calls: [
          {
            index: 0,
            id: toolCallId,
            type: "function",
            function: { name: "endCall", arguments: "{}" },
          },
        ],
      },
    },
  ],
})}\n\n`


This seems to be correctly recorded on the VAPI side since I see Model called tool: endCall() in the call log. However, the call continues.

Any help would be appreciated! Call ID: ce04b053-b250-4ebc-a202-53acd21a9c50
Screenshot_2025-05-18_at_4.13.05_AM.png
Was this page helpful?