Merge remote

This commit is contained in:
Hk-Gosuto
2023-12-25 12:40:09 +08:00
parent da29a94714
commit fa2e046285
16 changed files with 47 additions and 31 deletions

View File

@@ -1,7 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import { auth } from "../../auth";
import { getServerSideConfig } from "@/app/config/server";
import { GEMINI_BASE_URL, Google, 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 || GEMINI_BASE_URL;
let baseUrl = serverConfig.googleBaseUrl || GEMINI_BASE_URL;
if (!baseUrl.startsWith("http")) {
baseUrl = `https://${baseUrl}`;
@@ -63,7 +63,7 @@ async function handle(
);
}
const fetchUrl = `${baseUrl}/${path}?key=${key}`;
const fetchUrl = `${baseUrl}/${path}?key=${key}&alt=sse`;
const fetchOptions: RequestInit = {
headers: {
"Content-Type": "application/json",