From 8d29eb7c63015c15a31fbafa24a247381b14121f Mon Sep 17 00:00:00 2001 From: Richard C Lim <61879224+richardclim@users.noreply.github.com> Date: Sat, 1 Feb 2025 03:22:50 -0500 Subject: [PATCH] Update constant.ts --- app/constant.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) =>