Tool calling and usage
# support
t
I am not really sure how to use a tool I created through the frontend with an api call, i have a tool to send SMS, it has 3 parameters: name, number, content, how do I call this tool while on a call? and attach the parameters to it? or all I need is to specifiy the paramters while on the call ? I am using make. thanks
v
@TheSnowguru To use your SMS tool through an API call while on a call, you'll need to make an HTTP request to the appropriate endpoint provided by Make (formerly Integromat). Here's a general outline of the steps you should follow: 1. **Identify the Endpoint**: Find the specific endpoint URL for your SMS tool. This should have been provided to you when you set up the tool in Make. 2. **Prepare the Parameters**: Gather the
name
,
number
, and
content
parameters that your SMS tool requires. 3. **Make the API Call**: While on the call, you can make an HTTP request to the endpoint. This can be done programmatically if you're using a backend service or directly from your frontend if it supports HTTP requests. 4. **Attach the Parameters**: Include the parameters in the body of your HTTP request. The exact format will depend on the API's requirements, but it's typically a JSON object. Here's an example of how you might structure your HTTP request in JSON format:
Copy code
json
{
  "name": "John Doe",
  "number": "+1234567890",
  "content": "Hello, this is your message content!"
}
5. **Send the Request**: Use the appropriate method (usually POST) to send the request to the endpoint. 6. **Handle the Response**: After making the call, handle the response from the API. If successful, the SMS should be sent. If there's an error, you'll need to troubleshoot based on the error message received. If you're using a programming language or a platform that supports HTTP requests, you would typically use a library or built-in functionality to make the request. For example, in Python, you might use the
requests
library, and in JavaScript (Node.js), you might use
axios
or the
fetch
API. If you need more specific guidance on how to make the API call using Make, or if you encounter any issues, please ask support for more info on this.
You can continue this conversation by mentioning me in the message.
s
t
@Vapi In vapi create call endpoint how to attch files from the knowledge base ?
v
@TheSnowguru To attach files from the knowledge base when creating a call using the VAPI (Voice API), you would typically need to include a reference to the file within the API call request. However, after reviewing the documentation available at the provided URL (https://docs.vapi.ai/api-reference/calls/list-calls), it seems that there is no explicit mention of attaching files directly through the "Create Call" endpoint. In general, attaching files to a call would involve using a media or file management API endpoint that allows you to upload and manage files. Once a file is uploaded to the knowledge base or media library, you would receive a unique identifier or URL for that file. If VAPI supports file attachments during calls, you would then reference this identifier or URL in your "Create Call" API request, likely within the payload that defines the call's parameters. If this functionality is available, it would be documented in the API reference under the endpoint for creating calls or managing media. Since the explicit method to attach files from the knowledge base is not provided in the current context, I recommend checking the complete API documentation for a media management or file upload endpoint. If such an endpoint exists, follow the instructions to upload your file and then reference it in your call creation. If the documentation does not provide the necessary information or if you are unsure how to proceed, please reach out to VAPI support for further assistance. They will be able to provide you with specific instructions on how to attach files from the knowledge base when creating a call.
t
Example of this @Vapi
v
@TheSnowguru I apologize for any confusion, but without direct access to the specific API documentation for VAPI that details how to attach files from the knowledge base during call creation, I can only provide a hypothetical example based on standard practices. Typically, APIs that allow attaching files to calls have an endpoint for uploading files to a knowledge base or media library. Once uploaded, the file is usually accessible via a URL or an identifier. You would then include this reference in your API call to create a new call. Here's a hypothetical example of how this process might look: 1. Upload the File to the Knowledge Base - You would use an API endpoint provided by VAPI to upload your file. This might return a file ID or URL upon success. 2. Create the Call with the File Attachment - When creating a call, you would reference the file ID or URL in the payload of the request. Here's a hypothetical JSON payload for creating a call with an attached file:
Copy code
json
{
  "to": "+1234567890",
  "from": "+0987654321",
  "file_attachment": "https://knowledgebase.vapi.ai/files/example-file-id"
}
In this example,
file_attachment
is a hypothetical field where you would place the URL or ID of the file you uploaded to the knowledge base. Please note that this is a generic example and the actual implementation details, including the field names and the process for uploading and referencing files, will depend on VAPI's specific API documentation. If VAPI provides a method for attaching files from the knowledge base during call creation, you should find the exact details in their API documentation. If you cannot find this information or if you need further assistance, please reach out to VAPI support for more detailed guidance.
t
I want to use a create agent to call onto an incoming call how can I do that? @Vapi
v
@TheSnowguru To create an agent and have it handle an incoming call using VAPI, you would typically follow these steps: 1. **Create an Agent**: Define an agent with the necessary attributes, such as a script or behavior that the agent should follow when handling calls. This is usually done through a separate endpoint or configuration in the VAPI platform. 2. **Set Up Inbound Call Handling**: Configure your VAPI account to handle incoming calls. This often involves setting up webhooks or specifying behavior for when calls are received. 3. **Assign the Agent to Handle Calls**: Once the agent is created, you need to assign it to handle incoming calls. This could be done by specifying the agent's ID or name in the inbound call configuration. Here's a hypothetical example of how you might set up an agent to handle incoming calls:
Copy code
json
{
  "agent": {
    "name": "SupportAgent1",
    "script": "Hello, this is your virtual assistant. How can I help you today?"
    // Additional agent configuration...
  },
  "inboundCallConfig": {
    "onIncomingCall": {
      "action": "assignAgent",
      "agentName": "SupportAgent1"
    }
    // Additional call handling configuration...
  }
}
In this example, an agent named
SupportAgent1
is created with a predefined script. The
inboundCallConfig
specifies that when an incoming call is received, the action to take is to
assignAgent
, and the agent to be assigned is
SupportAgent1
. Please note that the actual implementation will depend on the specific capabilities and configuration options provided by VAPI. The above example is a generic representation and may not directly apply to VAPI's API. If VAPI supports creating agents and assigning them to handle incoming calls, you should find the exact details in their API documentation. If you cannot find this information or if you need further assistance, please reach out to VAPI support for more detailed guidance.
t
@Shubham Bajaj this doesn't sound like there's such feild invoundcallconfig....right?
s
yeah there is no such field, what's your use case btw? if possible create a new support ticket for it.
t
Just trying to add webhook reaponse to generate an agent but it doesnt work.... @Shubham Bajaj
Can you share a json that would work of a webhook reaponse.
s
t
create assistant? i need to send a webhook response, of get assistants resopnse from what i saw in [yt ](

https://www.youtube.com/watch?v=tT21SqcxDeQ

) from what I seen, can you just send me a very basic response json that will work?
@Shubham Bajaj
s
did you tried creating the assistant using the above shared url?
t
Found the problem was not setting the customer phone number
6 Views