Skip to content

Commit

Permalink
feat: added optional parameter in OpenAIClientSettings to control the…
Browse files Browse the repository at this point in the history
… Url scheme i.e. http or https
  • Loading branch information
gunpal5 authored and HavenDV committed Apr 22, 2024
1 parent 0773b39 commit 2a709ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/OpenAI/Client/Authentication/OpenAIClientSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public OpenAIClientSettings()
/// </summary>
/// <param name="domain">Base api domain.</param>
/// <param name="apiVersion">The version of the OpenAI api you want to use.</param>
public OpenAIClientSettings(string domain, string apiVersion = DefaultOpenAIApiVersion)
/// <param name="https">True if Url has SSL security</param>
public OpenAIClientSettings(string domain, string apiVersion = DefaultOpenAIApiVersion, bool https = true)
{
if (string.IsNullOrWhiteSpace(domain))
{
Expand All @@ -55,7 +56,7 @@ public OpenAIClientSettings(string domain, string apiVersion = DefaultOpenAIApiV
ApiVersion = apiVersion;
DeploymentId = string.Empty;
BaseRequest = $"/{ApiVersion}/";
BaseRequestUrlFormat = $"https://{ResourceName}{BaseRequest}{{0}}";
BaseRequestUrlFormat = https?$"https://{ResourceName}{BaseRequest}{{0}}": $"http://{ResourceName}{BaseRequest}{{0}}";
UseOAuthAuthentication = true;
}

Expand Down

0 comments on commit 2a709ce

Please sign in to comment.