Add assitantId to tool call
# support
c
Hi All: I am trying to add the assistantId to a tool call. The tool is called from multiple assistants so I need to know on the other end which assistant used the tool so as to return the right information. But I did not find a way to "inject" the assistandId into the tool call. Is there a way to do this? Thanks!
k
Use message.call.assistant.id from the webhook payload no need to manually inject the assistant ID..
c
Thank you for your message. I can get that in the end-of-call message, but the webhook does not include that data... Here is all the input I get when receiving a tool call on my server: GET Parameters: { "api": "vapi_prefetch" } POST Parameters: [] REQUEST Parameters: { "api": "vapi_prefetch" } Raw Input Length: 22 Raw Input: {"from":"017xxxxxxxx"} Raw Input (JSON Decoded): { "from": "017xxxxxxxxx" }
k
The vapi_prefetch webhook doesn’t include assistantId because it runs before the assistant is initialized, use the end-of-call webhook or store the assistantId when creating the call to match it later..
c
Thanks for your reply. The prefetch is actually not running before. Bad name I am afraid. Its a tool which gets called by the assistant. so the assistant is already initialized, but the id does not get sent along.
c
Check your tool and webhook configurations in vapi to ensure assistantId is passed, review logs for missing data..
2 Views