m
I may be able to offer you some advice we only build custom middleware for tools
u
Hi Mason, yes I developed a custom nodejs server
m
what issue are you having with it
u
Lemme copy and paste the whole issue
Hi, I created an API server that does calendar appointments for my application, the bot makes the tool call and I'm outputting the result but the bot keeps saying no timeslots available Assistant ID: The vapi assistant ID is 65a9ad1f-88eb-41b3-93ac-c05de322201b I've modified the response to be test, JSON or stringified JSON Attempt 1: plain text Extracted options: { timeMin: '2023-10-28T00:00:00Z', timeMax: '2023-10-28T23:59:59Z', timeZone: 'America/New_York' } Tool call ID: call_nQgfmNDAIYRJNRNuevym1IR5 SENDING RESPONSE: { "toolCallId": "call_nQgfmNDAIYRJNRNuevym1IR5", "result": "slot available for 2 - 4 PM" } Attempt 2: stringified json SENDING RESPONSE: { "toolCallId": "call_NIASqDZjSFczlpWaZsEvw8LJ", "result": "{\"availableSlots\":[{\"start\":\"2023-11-02T09:00:00-04:00\",\"end\":\"2023-11-02T14:00:00-04:00\"},{\"start\":\"2023-11-02T12:30:00-04:00\",\"end\":\"2023-11-02T14:30:00-04:00\"},{\"start\":\"2023-11-02T13:00:00-04:00\",\"end\":\"2023-11-02T15:00:00-04:00\"},{\"start\":\"2023-11-02T13:30:00-04:00\",\"end\":\"2023-11-02T15:30:00-04:00\"},{\"start\":\"2023-11-02T14:00:00-04:00\",\"end\":\"2023-11-02T16:00:00-04:00\"},{\"start\":\"2023-11-02T14:30:00-04:00\",\"end\":\"2023-11-02T16:30:00-04:00\"}]}" } Attempt 3: normal json SENDING RESPONSE: { "toolCallId": "call_BLMPFIpaWFZSUTZwH6p9yJ8E", "role": "tool", "result": [ { "start": "2023-11-01T09:00:00-04:00", "end": "2023-11-01T11:00:00-04:00" }, { "start": "2023-11-01T13:00:00-04:00", "end": "2023-11-01T15:00:00-04:00" }, { "start": "2023-11-01T13:30:00-04:00", "end": "2023-11-01T15:30:00-04:00" }, { "start": "2023-11-01T14:00:00-04:00", "end": "2023-11-01T16:00:00-04:00" }, { "start": "2023-11-01T14:30:00-04:00", "end": "2023-11-01T16:30:00-04:00" } ] } But I keep getting the same message from the bot, that no slots are available
Im structuring the response as per docs Im including the toolCallId and result keys
And i tried sending json / stringified json and normal text as response
But the ai agent keeps saying 'were having issues with our scheduling system'
I see the bot making the tool call, I see the request coming in, response being sent out but agent just says I'm having trouble with our scheduling system
Hey i figured it out
2 Views