PATCH using server SDK doesn't enable tool in the ...
# support
m
@User @Shubham Bajaj Not sure if this is a bug but I made a PATCH request to my assistant in order to enable a new assistant with my tool (after creating the onlineSearch tool), however it seems like it just created a new transcient tool instead because it's not passing arguments nor using my phrases and just defaults to hold on a sec when searching. How can I enable an existing tool when updating my assistants? // Update Assistant (PATCH /assistant/:id) const response = await fetch("https://api.vapi.ai/assistant/d7569941-...e644eeb", { method: "PATCH", headers: { "Authorization": "Bearer 7d5636a4-...34c6c6", "Content-Type": "application/json" }, body: JSON.stringify({ "model": { "provider": "openai", "model": "gpt-3.5-turbo", "tools": [ { "type": "function", "function": { "name": "onlineSearch" } } ] }, "voice": { "provider": "openai", "voiceId": "alloy" }, "transcriber": { "provider": "assembly-ai" }, "firstMessage": "yo" }), }); const body = await response.json(); console.log(body);
s
@Mistermanu#000 When submitting a PATCH request, it is imperative to include all existing tools, as well as any new or updated tools. Additionally, all fields of property model must be included. This is because it is not feasible to implement nested level field protection and mutability verification for deep or 2nd level nested properties.
m
@Shubham Bajaj ok yes I remember hearing that in one of your looms but that wasn't my issue. I actually just figured it out. I was trying to add the tool using the tool name but I needed to use toolID to enable the tool otherwise it just creates a new transcient tool. All good now. thanks!
c
I am happy you figured it out, closing this ticket.