Forge.OpenAI
Forge.OpenAI copied to clipboard
Support for Azure Open AI
Hi there,
I'm attempting to swap over to Azure Open AI and have come up against two problems.
-
the example here seems incomplete. It appears we have to provide the BaseAddress and AzureApiVersion. Is this correct?
-
A bigger issue seems to be how you are handling AuthenticationInfo
public AuthenticationInfo(string apiKey)
{
if (string.IsNullOrWhiteSpace(apiKey)) throw new ArgumentNullException(nameof(apiKey));
if (!apiKey.Contains("sk-"))
{
throw new ArgumentException($"{apiKey} parameter must start with 'sk-'");
}
ApiKey = apiKey;
}
As far as I'm aware Azure does not prefix their API keys with sk-. Without adding the "sk-" I'm getting argument exception and if I add "sk-" to my Azure key I'm getting a 404. Are you able to provide some guidance.
Cheers -Rob
Hello, Looks like the protocol changed in the last months as always. I will give it a look.
Hi there,
I'm attempting to swap over to Azure Open AI and have come up against two problems.
- the example here seems incomplete. It appears we have to provide the BaseAddress and AzureApiVersion. Is this correct?
- A bigger issue seems to be how you are handling AuthenticationInfo
public AuthenticationInfo(string apiKey) { if (string.IsNullOrWhiteSpace(apiKey)) throw new ArgumentNullException(nameof(apiKey)); if (!apiKey.Contains("sk-")) { throw new ArgumentException($"{apiKey} parameter must start with 'sk-'"); } ApiKey = apiKey; }
As far as I'm aware Azure does not prefix their API keys with sk-. Without adding the "sk-" I'm getting argument exception and if I add "sk-" to my Azure key I'm getting a 404. Are you able to provide some guidance.
Cheers -Rob
Please have a look to the latest release