DollarD
09/04/2024, 9:17 PMVapi
09/04/2024, 9:19 PMVapi
09/04/2024, 9:19 PMassistantOptions
during the initialization of your Vapi assistant. You can set up a custom tool to be called as part of the assistant's startup sequence.
Here's a general idea of how you can configure this:
1. Define a custom tool that fetches the caller's context from your API.
2. Include this custom tool in the assistantOptions
when you start your Vapi assistant.
If you need assistance with the specific code or setup, please provide more details about your custom tool and how you've structured your assistant, and I'll be happy to help you integrate it.
If this is something that isn't currently supported directly through the Vapi Dashboard or API, I would recommend reaching out to the support team for more information on potential workarounds or upcoming features that might meet your needs.DollarD
09/04/2024, 9:27 PMDollarD
09/04/2024, 9:29 PMVapi
09/04/2024, 9:29 PMChowderr
09/04/2024, 9:47 PMDollarD
09/04/2024, 10:00 PMChowderr
09/04/2024, 10:40 PMDollarD
09/04/2024, 10:41 PMDollarD
09/04/2024, 10:42 PMChowderr
09/04/2024, 10:56 PMDollarD
09/04/2024, 11:13 PMend-of-call-report
, i would love that it could call my service when a call is started to so that I can inject context.Chowderr
09/04/2024, 11:28 PMDollarD
09/04/2024, 11:28 PMChowderr
09/04/2024, 11:29 PMDollarD
09/04/2024, 11:30 PMDollarD
09/04/2024, 11:30 PMChowderr
09/04/2024, 11:30 PMChowderr
09/04/2024, 11:30 PMChowderr
09/04/2024, 11:31 PMDollarD
09/04/2024, 11:33 PMChowderr
09/04/2024, 11:34 PMDollarD
09/04/2024, 11:55 PMChowderr
09/04/2024, 11:56 PMChowderr
09/04/2024, 11:57 PMDollarD
09/04/2024, 11:59 PMChowderr
09/05/2024, 12:00 AMDollarD
09/05/2024, 12:01 AMDollarD
09/05/2024, 12:01 AMDollarD
09/05/2024, 12:01 AMChowderr
09/05/2024, 12:02 AMDollarD
09/05/2024, 12:03 AMDollarD
09/05/2024, 12:03 AMChowderr
09/05/2024, 12:03 AMChowderr
09/05/2024, 12:03 AMChowderr
09/05/2024, 12:03 AMDollarD
09/05/2024, 12:04 AMChowderr
09/05/2024, 12:04 AMDollarD
09/05/2024, 12:04 AMChowderr
09/05/2024, 12:06 AMDollarD
09/05/2024, 12:07 AMDollarD
09/05/2024, 5:27 PMShubham Bajaj
09/05/2024, 8:37 PMDollarD
09/05/2024, 8:39 PMShubham Bajaj
09/05/2024, 8:39 PMDollarD
09/05/2024, 8:43 PMDollarD
09/05/2024, 8:47 PMDollarD
09/05/2024, 9:01 PMGET https://api.vapi.ai/assistant/:id
as the response body, but it doesn't seem to work appropriately at the moment (i have indeed wrapped it in the assistant
object as shown in the documentation). will continue to debug in a bit, have a meeting to attend. but this is definitely the right track.Shubham Bajaj
09/05/2024, 9:09 PMDollarD
09/05/2024, 9:12 PMpython
def handle_assistant_request(request):
url = "https://api.vapi.ai/assistant/<my assistant id>"
headers = {"Authorization": "Bearer <token>"}
assistant_response = requests.request("GET", url, headers=headers)
response = {
'assistant': json.loads(assistant_response.text),
}
return JsonResponse(response, safe=False)
I am retrieving an assistant by ID from the VAPI api, wrapping it in the assistant
json object key (as per the specification on the document you linked me) and returning that as the response to the assistant-request
server message.
VAPI tells me it failed to get the assistant when i do thisDollarD
09/05/2024, 9:14 PMDollarD
09/05/2024, 9:14 PMassistant-request
would work out of the box, but it seems not.DollarD
09/05/2024, 9:16 PMDollarD
09/05/2024, 9:29 PMpython
def handle_assistant_request(request):
url = "https://api.vapi.ai/assistant/<my assistant id>"
headers = {"Authorization": "Bearer <token>"}
assistant_response = requests.request("GET", url, headers=headers)
response = {
'assistant': json.loads(assistant_response.text),
}
del response['assistant']['orgId']
del response['assistant']['id']
del response['assistant']['createdAt']
del response['assistant']['updatedAt']
del response['assistant']['name']
del response['assistant']['voice']
del response['assistant']['endCallFunctionEnabled']
del response['assistant']['transcriber']
del response['assistant']['clientMessages']
del response['assistant']['serverMessages']
del response['assistant']['dialKeypadFunctionEnabled']
del response['assistant']['serverUrl']
del response['assistant']['maxDurationSeconds']
del response['assistant']['backgroundSound']
del response['assistant']['isServerUrlSecretSet']
return JsonResponse(response, safe=False)
I went through and manually deleted every entry. other than what was in that sample response in the docs. seems to kind of work now, it at least accepts the assistant response.
I am going to comment one by one and see which of these are causing the failureDollarD
09/05/2024, 9:33 PMDollarD
09/05/2024, 9:40 PMpython
def handle_assistant_request(request):
url = "https://api.vapi.ai/assistant/:id"
headers = {"Authorization": "Bearer <token>"}
assistant_response = requests.request("GET", url, headers=headers)
response = {
'assistant': json.loads(assistant_response.text),
}
# must delete
del response['assistant']['orgId']
del response['assistant']['id']
del response['assistant']['isServerUrlSecretSet']
del response['assistant']['createdAt']
del response['assistant']['updatedAt']
del response['assistant']['name']
return JsonResponse(response, safe=False)
by deleting those keys from the response of the VAPI endpoint, things seem to work as expected.DollarD
09/05/2024, 9:40 PMShubham Bajaj
09/05/2024, 10:01 PMDollarD
09/05/2024, 10:12 PMdel
commands in my previous code, that vapi will not understand my response. it seems like the bare minimum to get things to work.DollarD
09/05/2024, 10:13 PMShubham Bajaj
09/05/2024, 10:22 PMDollarD
09/05/2024, 10:23 PMShubham Bajaj
09/06/2024, 6:21 AMAlozie | AI Voice Developer
09/24/2024, 2:23 AMDollarD
09/24/2024, 5:54 AMShubham Bajaj
09/24/2024, 1:51 PM