loforeal
# vapigpt
l
@Vapi I have moved one of my assistants to use 'blocks' for more accurate collection of data (variables). However, I noticed that the end of call report and other messages no longer get passed to my server URL that is defined for that assistant. How can I make sure this happens? Is it not possible with blocks?
v
@Lo Using 'blocks' for data collection should not interfere with the server messages being sent to your server URL. It's possible that the server messages configuration for your assistant might have been changed or reset during the transition. To ensure that the 'end-of-call-report' and other messages are sent to your server URL, you'll need to update the
assistantOverrides.serverMessages
configuration for your assistant. You can include 'end-of-call-report' and any other messages you want to receive, such as 'status-update', 'hang', 'tool-calls', etc. Would you like me to update the server messages configuration for you? If so, please provide me with the list of server messages you want to receive.
l
@Vapi Ah, I think you found my issue, my dynamic assistant routing over-writes/excludes the server I am trying to send to. Could you fix this? print(f"Fetching assistant from URL: {url}") response = requests.get(url, headers=headers) response.raise_for_status() assistant_data = response.json() print(f"Received assistant data: {json.dumps(assistant_data, indent=2)}") return { "name": assistant_data.get("name"), "voice": assistant_data.get("voice"), "model": assistant_data.get("model"), "firstMessage": assistant_data.get("firstMessage", "Welcome to our service!"), "recordingEnabled": assistant_data.get("recordingEnabled", True), "transcriber": assistant_data.get("transcriber"), "silenceTimeoutSeconds": assistant_data.get("silenceTimeoutSeconds", 20), "backgroundSound": assistant_data.get("backgroundSound", "off") }
v
@Lo It seems like the issue is with the dynamic assistant routing configuration which is not including the server messages setup. To fix this, you'll need to ensure that the
serverMessages
configuration is included in the assistant data you're fetching and returning. Here's an updated version of your code snippet that includes the
serverMessages
configuration:
Copy code
python
print(f"Fetching assistant from URL: {url}")
response = requests.get(url, headers=headers)
response.raise_for_status()

assistant_data = response.json()
print(f"Received assistant data: {json.dumps(assistant_data, indent=2)}")

return {
    "name": assistant_data.get("name"),
    "voice": assistant_data.get("voice"),
    "model": assistant_data.get("model"),
    "firstMessage": assistant_data.get("firstMessage", "Welcome to our service!"),
    "recordingEnabled": assistant_data.get("recordingEnabled", True),
    "transcriber": assistant_data.get("transcriber"),
    "silenceTimeoutSeconds": assistant_data.get("silenceTimeoutSeconds", 20),
    "backgroundSound": assistant_data.get("backgroundSound", "off"),
    "serverMessages": assistant_data.get("serverMessages")  # Include server messages configuration
}
Make sure that the
serverMessages
configuration is properly set in the assistant data you're fetching. If it's not present, you'll need to add it to the JSON data at the source URL or handle it appropriately in your code to ensure it's included in the return statement. If you need further assistance with the configuration or have any other questions, please let me know!