Skip to content

Commit

Permalink
switched to native request web api
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutlope committed Jan 31, 2023
1 parent 2e3a187 commit 8779514
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pages/api/generate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { NextRequest } from "next/server";
import { OpenAIStream, OpenAIStreamPayload } from "../../utils/OpenAIStream";

if (!process.env.OPENAI_API_KEY) {
Expand All @@ -9,7 +8,7 @@ export const config = {
runtime: "edge",
};

const handler = async (req: NextRequest): Promise<Response> => {
const handler = async (req: Request): Promise<Response> => {
const { prompt } = (await req.json()) as {
prompt?: string;
};
Expand Down

0 comments on commit 8779514

Please sign in to comment.