diff --git a/app/constant.ts b/app/constant.ts index 888ef38ec..6fa00a28b 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -174,7 +174,13 @@ export const OpenaiPath = { }; export const Azure = { - ChatPath: (deployName: string, apiVersion: string) => + ChatPath: (deployName: string, apiVersion: string) => { + // Check if it's an AI Foundation endpoint + if (deployName.includes(".models.ai.azure.com")) { + return "chat/completions"; + } + return `deployments/${deployName}/chat/completions?api-version=${apiVersion}`; + }, ``, // https://.openai.azure.com/openai/deployments//images/generations?api-version= ImagePath: (deployName: string, apiVersion: string) =>