VapiAI/server-sdk-csharp

SDK Example does not seem to work

brocksystems-robb opened this issue · 3 comments

Your example code in the readme does not seem to work.
It never sets the base URI, not does it pass the TOKEN as a header in the API calls.

Do you have any full code examples on how to use this SDK with the Calls.CreateAsync() method to make an outbound call from an assistant setup in the dashboard?

I have encountered this same issue. Had to download src and make change and add dll ref :( This needs to be fixed as no ref to token in this VapiClient.cs class.

public VapiClient(string token, ClientOptions? clientOptions = null)
{
var defaultHeaders = new Headers(
new Dictionary<string, string>()
{
{ "X-Fern-Language", "C#" },
{ "X-Fern-SDK-Name", "Vapi.Net" },
{ "X-Fern-SDK-Version", Version.Current },
{ "User-Agent", "Vapi.Net/0.4.1" },
{ "Authorization", $"Bearer {token}" } <<<<<<<<<< this makes it work as token not used...
}
);

Beside the the bug that @brunskillage mention, you need to add

[JsonPropertyName("provider")]
public string Provider { get; set; } = "openai";

to llm models, transcriber and voice classes (with respective values of course, defined in documentation) because it is mandatory and it is not generated