The structure of the functions
# support
w
Hi ...I'm a bit confused about the structure of the functions. If I create an assistant in the Vapi dashboard and then have it output via postman using “get”, I get a different structure than if I create the assistant via the API documentation. If I go via the API, I find the function structure in the tools array, if I go via the dashboard, the functions end up in an array called functions - the tools array is not created here at all. Do I have a problem understanding this? Thanks a lot!
v
Hi @WDGrimm, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Create Assistant]() * [Function Calling]() * [Setting Server URLs]() * [Get Assistant]() -----------------------------
### Answer It seems you've encountered the distinction between how functions and tools are represented in Vapi when using different methods of creation (dashboard vs API). From the information provided, it's clear that there might be a conceptual difference in how functions are organized and represented depending on the method used to set up or retrieve the assistant's configuration. 1. **Via API**: When creating an assistant via the API method, the functions you're referring to are indeed part of the
tools
array in the assistant's configuration. This is indicated in the structure provided for tool calling, where the
type
can be set to "function" and integrated within the tools array as part of the assistant's configuration [(1)]() . 2. **Via Dashboard**: When setting up an assistant through the Vapi Dashboard, it appears you've observed a direct
functions
array instead of incorporating them within a
tools
array. Unfortunately, there isn't direct documentation in the provided sources that explicitly explains the structural differences between using the dashboard and the API for function setup. The variation you're seeing could be attributed to how Vapi abstracts the complexity when using the dashboard, possibly simplifying the setup process for users by directly presenting a
functions
array. Meanwhile, the API method might offer more flexibility or granularity in configuration, thus presenting functions within a broader
tools
construct. Understanding this distinction is crucial, and it's understandable that it might cause some confusion. The key takeaway is that whether functions are nested within a
tools
array or presented directly as a
functions
array, they serve to extend the capabilities of your Vapi assistant by integrating external functionalities. It's also worth mentioni
ng that the documentation and interface might evolve, so keeping an eye on official Vapi documentation for the latest updates and guides on structuring your assistant's configuration would be beneficial. If you're looking to delve deeper into function and tool calling within Vapi, exploring the provided documentation on tools calling and function setup through the API might offer further insights [(1)]() [(2)]() .
w
ok - that answers part of the question. What would still interest me is the question of whether the API variant produces better results. have you ever tested this?
s
API => Provides you with more customization and we don't expose everything to the dashboard because we don't want to make the website quite complex.
v
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.