Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pages/api/openai.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// file: /pages/api/openai.js
import { ConversationalRetrievalQAChain } from "langchain/chains";
import { SupabaseVectorStore } from "langchain/vectorstores/supabase";
import { OpenAIEmbeddings } from "langchain/embeddings/openai";
import { OpenAI } from "langchain/llms/openai";
import { Configuration, OpenAIApi } from "openai";
import { Configuration } from "openai";
import { supabase } from "@/utils/supabase";

// Create a configuration object with the OpenAI API key
Expand Down Expand Up @@ -31,7 +30,9 @@ export default async function (req, res) {
// Extract the payload from the request body
const question = req.body.payload || "";

// Set up the model with a specific model name
const model = new OpenAI({
modelName: "gpt-3.5-turbo", // Explicitly set the model name here
temperature: 1,
openAIApiKey: process.env.OPENAI_API_KEY,
streaming: false,
Expand Down