Bug in function calling, not saving the function +...
# support
t
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.
v
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
model
property of your assistant's configuration with specific
name
,
description
, and
parameters
fields. Use the Update Assistant endpoint to save any changes to your assistant configuration [(1)]() . Regarding integrating a parameter like
firstname
into the first message the AI says, Vapi's current documentation does not explicitly detail dynamic insertion of parameters such as
firstname
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.
s
Can you provide me with the network tab request response?
t
what
agent id?
s
Can you share the error screenshot?
t
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
s
Did you click the "Save and Add" button, and then press the "Publish" button on the dashboard?
t
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
s
Can you elaborate on what you mean by how I should call the name?
t
my first msg : hello firstname how are you?
but the ai says hello firstname instead of the name of the user
s
You need to add that programmatically. Do you want it for inbound or outbound calls?
t
i use the webwidget, progmaticlly isn't a problem
s
By web widget you mean Web SDK?
t
i use your fronetend
and your webwidget code
sec
s
You mean this right? https://github.com/VapiAI/web
t
voice widget
s
Copy code
json
const assistant = {
  model: {
    provider: "openai",
    model: "gpt-3.5-turbo",
    systemPrompt:
      "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.
t
but i don't use code, i user the web interface
like this?
no won't work.....
s
You cannot have dynamic variables from the dashboard itself right now. It is on our feature list and will be added very soon.
t
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
s
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.
t
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
v
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.