Cleanup unused stuff

This commit is contained in:
Jared Palmer 2023-06-02 14:32:46 -04:00
parent 01527d450b
commit 9f4ef62961
9 changed files with 13 additions and 558 deletions

View file

@ -1,10 +1,20 @@
import { auth } from "@/auth";
import { chats, db } from "@/lib/db/schema";
import { openai } from "@/lib/openai";
import { OpenAIStream, StreamingTextResponse } from "ai-connector";
import { Configuration, OpenAIApi } from "openai-edge";
export const runtime = "edge";
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
if (!process.env.OPENAI_API_KEY) {
throw new Error("Missing env var from OpenAI");
}
export const POST = auth(async function POST(req: Request) {
const json = await req.json();
// @ts-ignore