Old version url - https://nextgpt-old-xyz.vercel.app/auth/login
================================================
FILE: actions/chat.ts
================================================
"use server";
import { getUser } from "@/lib/auth";
import { generateRandomId } from "@/lib/utils";
import prisma from "@/prisma/client";
import { JsonMessagesArraySchema } from "@/types";
import { revalidatePath } from "next/cache";
import { redirect } from "next/navigation";
import OpenAI from "openai";
export type Message = {
message: string;
apiKey: string;
conversationId: string;
};
export type NewMessage = Omit{message.answer}
)}OpenChat redefines the chat experience by seamlessly integrating the robust capabilities of the OpenAPI. This platform takes conversational AI to new heights, offering you a dynamic and intelligent chat companion designed for a wide array of applications.
Get started