feat: support google multiple keys

This commit is contained in:
Hk-Gosuto
2024-05-28 21:26:54 +08:00
parent 11f063fd9e
commit fe9a17693c
7 changed files with 13 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import { auth } from "../../auth";
import { getServerSideConfig } from "@/app/config/server";
import { GOOGLE_BASE_URL, ModelProvider } from "@/app/constant";
import { GEMINI_BASE_URL, ModelProvider } from "@/app/constant";
async function handle(
req: NextRequest,
@@ -17,7 +17,7 @@ async function handle(
const serverConfig = getServerSideConfig();
let baseUrl = serverConfig.googleUrl || GOOGLE_BASE_URL;
let baseUrl = serverConfig.googleUrl || GEMINI_BASE_URL;
if (!baseUrl.startsWith("http")) {
baseUrl = `https://${baseUrl}`;