This commit is contained in:
lloydzhou 2024-07-05 20:20:21 +08:00
parent 6b1b530443
commit d9758be3ae
2 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@ export async function requestOpenai(req: NextRequest) {
if (isAzure) {
const azureApiVersion = req?.nextUrl?.searchParams?.get("api-version");
baseUrl = baseUrl.split("/deployments").shift();
baseUrl = baseUrl.split("/deployments").shift() as string;
path = `${req.nextUrl.pathname.replaceAll(
"/api/azure/",
"",

View File

@ -157,11 +157,11 @@ export class ChatGPTApi implements LLMApi {
const model = models.find(
(model) =>
model.name == modelConfig.model &&
model?.provider.providerName == ServiceProvider.Azure,
model?.provider?.providerName == ServiceProvider.Azure,
);
chatPath = this.path(
Azure.ChatPath(
model?.displayName ?? model.name,
(model?.displayName ?? model?.name) as string,
useAccessStore.getState().azureApiVersion,
),
);