lloydzhou hai 1 ano
pai
achega
d9758be3ae
Modificáronse 2 ficheiros con 3 adicións e 3 borrados
  1. 1 1
      app/api/common.ts
  2. 2 2
      app/client/platforms/openai.ts

+ 1 - 1
app/api/common.ts

@@ -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/",
       "",

+ 2 - 2
app/client/platforms/openai.ts

@@ -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,
           ),
         );