Golang SDK Broken
# support
b
The Golang SDK fails to list calls / assistants because of unmarshaling errors. for listing assistants I get this error:
Copy code
json: cannot unmarshal string into Go struct field .embed.startSpeakingPlan.smartEndpointingEnabled of type map[string]interface {}
and for calls:
Copy code
{"cost":0,"type":"knowledge-base","model":{"model":"gemini-1.5-flash","provider":"google"},"promptTokens":0,"completionTokens":0} cannot be deserialized as a *api.CallCostsItem
v
Hi there! đź‘‹ I see you're running into unmarshaling errors with the Golang SDK when trying to list assistants and calls. I can't provide information on any fixes released after April 22, 2025, but I can definitely help explain these errors and suggest some solutions based on the information I have. ## Assistant Listing Error For the assistant listing error, the issue is with the
smartEndpointingEnabled
field in the
startSpeakingPlan
configuration. The SDK is expecting this field to be a map (
map[string]interface{}
), but it's receiving a string value instead. According to the [documentation I found](https://docs.vapi.ai/api-reference/calls/create),
smartEndpointingEnabled
should actually be a boolean value (true or false), not a map. The suggested solution is to explicitly set this field to a boolean value in your configuration:
Copy code
json
"startSpeakingPlan": {
  "waitSeconds": 0.8,
  "smartEndpointingEnabled": false
}
or
Copy code
json
"startSpeakingPlan": {
  "smartEndpointingEnabled": true,
  "waitSeconds": 0.8
}
It's also worth noting that
smartEndpointingEnabled
might only work for English transcriptions, so if you're using a different language, setting it to
false
might be necessary. ## Call Listing Error For the call listing error, the issue is with deserializing the call cost information into the
api.CallCostsItem
struct. This might be related to recent changes in the call cost information structure. According to the [changelog](https://docs.vapi.ai/changelog/2024/10/9), there were recent updates to call cost information, including the introduction of
call.costs[type=vapi].subType
to determine if a VAPI cost is
normal
or an
overage
. This change could be affecting the deserialization if the SDK hasn't been updated to handle the new structure. ## General Troubleshooting Steps Here are some general steps to troubleshoot these unmarshaling errors:
1. Check the API documentation to ensure you understand the expected data types for each field 2. Update your SDK to the latest version, as the issue might have been fixed in a newer release 3. Review your configuration to ensure all fields have the correct data types 4. Check server logs for more detailed error messages 5. Consider contacting Vapi support with specific details about the errors you're encountering Would you like me to provide more specific troubleshooting steps for either of these errors? Sources: - [Vapi Golang SDK unmarshaling error listing assistants](https://discord.com/channels/1211482211119796234/1334385998423130174) - [Vapi Golang SDK deserialization error listing calls](https://docs.vapi.ai/changelog/2024/10/9) - [Vapi Golang SDK troubleshooting guide](https://discord.com/channels/1211482211119796234/1328923059905630238) - [Common causes of Golang unmarshaling errors](https://discord.com/channels/1211482211119796234/1328923059905630238)
b
I guess this issue would be a fern issue? It's a little scary to depend on a SDK that is not tested and has the potential to break in a moments notice
v
Hey there, sorry to hear about the trouble you're having with the Go SDK. The errors you're seeing seem related to JSON unmarshaling issues. There might be a mismatch between the API response and the expected Go struct types.
It is related to
embed.startSpeakingPlan.smartEndpointingEnabled
and
api.CallCostsItem
Can you create a GitHub issue for the SDK team to work on this?
Hi, is there any ETA on which this issue will be fixed? I see there’s multiple issues about breaking changes to the API. Can we get some type of confirmation that breaking changes won’t happen to the service?
v
I guess the fern support team has already replied to your issue. Did you get a chance to look into it?
b
Yes, it requires the VAPI team to update the open API spec. From what I understand, they will reach out to you guys to help you fix it?
v
Yes they have informed us about it, and we have merged their PR's can you give it a try again?
b
I don't see any changes in the repo? Regardless, I attempted to try the SDK again, but its still broken with the exact same errors.
Any update on this?…
@User
Is there any intention to fix this issue? It's been 10 days without any serious progress on this?
s
@bsolo The issue has been fixed, we have updated the OpenAI spec which they require.Did you try it again?
b
One issue was fixed and another was added
v
Hey bsolo, could you help me understand which issue you are facing now? If you can share some steps to reproduce it, it will be really helpful.
b
Hi, I switched from VAPI due to the constant API breaks
s
@bsolo I’m sorry to hear you’ve encountered repeated API failures—that’s not the experience we aim for. Our uptime target is 99%, so this is a serious concern. Could you share the specific endpoint calls and error messages you saw? I’ll dive into the logs immediately and work with our engineering team to fix any lingering issues. Thank you for flagging this; your feedback helps us improve.
b
I don’t have the exact errors anymore since I’ve already started working with a new provider. I would say just use the SDK, i don’t think it would be very long until you find an issue with it since it doesn’t seem to be tested at all. I just want to say that it’s sad that I had to drop VAPI for the issue to even be taken seriously. I asked multiple times for updates without any response, and even to this day there are multiple GitHub tickets with issues unanswered.
2 Views