[FIX] Remove Azure URL validation ()

remove azure url validation
This commit is contained in:
Sean Hatfield 2024-06-25 12:10:51 -07:00 committed by GitHub
parent 88a0335fd2
commit dde8bc238b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,7 +15,7 @@ const KEY_MAPPING = {
// Azure OpenAI Settings
AzureOpenAiEndpoint: {
envKey: "AZURE_OPENAI_ENDPOINT",
checks: [isNotEmpty, validAzureURL],
checks: [isNotEmpty],
},
AzureOpenAiTokenLimit: {
envKey: "AZURE_OPENAI_TOKEN_LIMIT",
@ -622,17 +622,6 @@ function validChromaURL(input = "") {
: null;
}
function validAzureURL(input = "") {
try {
new URL(input);
if (!input.includes("openai.azure.com") && !input.includes("microsoft.com"))
return "Valid Azure endpoints must contain openai.azure.com OR microsoft.com";
return null;
} catch {
return "Not a valid URL";
}
}
function validOpenAiTokenLimit(input = "") {
const tokenLimit = Number(input);
if (isNaN(tokenLimit)) return "Token limit is not a number";