From 2a709ce6763c0a178d954932306370ee27e14977 Mon Sep 17 00:00:00 2001 From: Gunpal Jain Date: Mon, 22 Apr 2024 07:55:44 +0530 Subject: [PATCH] feat: added optional parameter in OpenAIClientSettings to control the Url scheme i.e. http or https --- .../OpenAI/Client/Authentication/OpenAIClientSettings.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/OpenAI/Client/Authentication/OpenAIClientSettings.cs b/src/libs/OpenAI/Client/Authentication/OpenAIClientSettings.cs index da1a0fcb..2f445dd8 100644 --- a/src/libs/OpenAI/Client/Authentication/OpenAIClientSettings.cs +++ b/src/libs/OpenAI/Client/Authentication/OpenAIClientSettings.cs @@ -33,7 +33,8 @@ public OpenAIClientSettings() /// /// Base api domain. /// The version of the OpenAI api you want to use. - public OpenAIClientSettings(string domain, string apiVersion = DefaultOpenAIApiVersion) + /// True if Url has SSL security + public OpenAIClientSettings(string domain, string apiVersion = DefaultOpenAIApiVersion, bool https = true) { if (string.IsNullOrWhiteSpace(domain)) { @@ -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; }