gemini using real sse format response #3677 #3688

This commit is contained in:
lloydzhou
2024-07-01 13:24:01 +00:00
parent c359b30763
commit 69974d5651
2 changed files with 89 additions and 66 deletions

View File

@@ -63,7 +63,9 @@ async function handle(
);
}
const fetchUrl = `${baseUrl}/${path}?key=${key}`;
const fetchUrl = `${baseUrl}/${path}?key=${key}${
req?.nextUrl?.searchParams?.get("alt") == "sse" ? "&alt=sse" : ""
}`;
const fetchOptions: RequestInit = {
headers: {
"Content-Type": "application/json",