Bug in function calling, not saving the function +...
# support
i tried to save a fucn few times, its refuses to save it, and also i wasn't able to call the fname paramter in the first msg the ai says.
Hi @TheSnowguru, I'm an AI assistant for Vapi. While a team member reviews this question, I'll look through relevant sources and see if I can provide suggestions. Please tag @Vapi Support with any follow-up questions.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Vapi iOS SDK]() * [List Assistants]() * [Call Functions]() * [Get Call]() -----------------------------
### Answer To address the issue of a function not saving, ensure you follow the correct format and steps outlined in the Vapi documentation for defining and updating assistants. Custom functions need to be defined within the
property of your assistant's configuration with specific
, and
fields. Use the Update Assistant endpoint to save any changes to your assistant configuration [(1)]() . Regarding integrating a parameter like
into the first message the AI says, Vapi's current documentation does not explicitly detail dynamic insertion of parameters such as
into messages directly. Typically, dynamic content involves server-side logic where the assistant's response is tailored based on the input or context provided during the call setup or via custom function calls that manipulate the conversation flow. You might need to handle such logic on your server and adjust the assistant's configuration or responses accordingly, leveraging the server URL feature for dynamic interaction handling [(2)]() . If these steps don't resolve your issue, double-check your implementation against the Vapi documentation and ensure your requests are correctly formatted as per the API references.
Can you provide me with the network tab request response?
agent id?
Can you share the error screenshot?
no error, it just grey out the publish button
and when i go to another tab, it disappers
i tried to test the end point and it was successful
but then it not letting me save it
iam using the web widget
Did you click the "Save and Add" button, and then press the "Publish" button on the dashboard?
you mean add?
i will try the add , didn't really see it
and how should i call the name in the first msg
if my param is firstname
i should use [ ] . () or what?
ok the add button worked 🙂
its unseen, and not clear (add), maybe call it save function
Can you elaborate on what you mean by how I should call the name?
my first msg : hello firstname how are you?
but the ai says hello firstname instead of the name of the user
You need to add that programmatically. Do you want it for inbound or outbound calls?
i use the webwidget, progmaticlly isn't a problem
By web widget you mean Web SDK?
i use your fronetend
and your webwidget code
You mean this right? https://github.com/VapiAI/web
voice widget
Copy code
const assistant = {
  model: {
    provider: "openai",
    model: "gpt-3.5-turbo",
      "You're a versatile AI assistant named Vapi who is fun to talk with.",
  voice: {
    provider: "11labs",
    voiceId: "paula",
  firstMessage: `Hello ${firstname} how are you?`,
Get the user's first name and place it in the 'firstname' variable. It will work.
but i don't use code, i user the web interface
like this?
no won't work.....
You cannot have dynamic variables from the dashboard itself right now. It is on our feature list and will be added very soon.
ok lmk
is it possible to use the web widget to initiate a create agent api call? this way I can createa an agent that knows the first $firstname @Sahil @User
Yes. It is you just need to provide the first name and all that in the prompt and mention about it. Note: For this, you will need little bit of coding knowledge.
yes i am trying to fix it, but really hard, is there a good example of a web widget with create agent example? cause tried it and didn't really work
@Sahil dm
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.