mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 19:52:27 +08:00
feat: add export to .md button
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { OpenAIApi, Configuration } from "openai";
|
||||
import { ChatRequest } from "./typing";
|
||||
|
||||
const isProd = process.env.NODE_ENV === "production";
|
||||
const apiKey = process.env.OPENAI_API_KEY;
|
||||
|
||||
const openai = new OpenAIApi(
|
||||
@@ -16,16 +15,7 @@ export async function POST(req: Request) {
|
||||
const completion = await openai!.createChatCompletion(
|
||||
{
|
||||
...requestBody,
|
||||
},
|
||||
isProd
|
||||
? {}
|
||||
: {
|
||||
proxy: {
|
||||
protocol: "socks",
|
||||
host: "127.0.0.1",
|
||||
port: 7890,
|
||||
},
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return new Response(JSON.stringify(completion.data));
|
||||
|
Reference in New Issue
Block a user