Hi I made a code here
// Make sure to add OPENAI_API_KEY as a secret
import { Configuration, OpenAIApi } from "openai";
const configuration = new Configuration({
apiKey: "SECRET KEY",
});
const openai = new OpenAIApi(configuration);
export default async function(req, res) {
const completion = await openai.createChatCompletion({
// Downgraded to GPT-3.5 due to high traffic. Sorry for the inconvenience.
// If you have access to GPT-4, simply change the model to "gpt-4"
model: "gpt-3.5-turbo",
messages: [{ "role": "system", "content": content }].concat(req.body.messages)
});
res.status(200).json({ result: completion.data.choices[0].message })
}
const content = `You are the support bot for MarketXLS using GPT-3.5.
You are talking to customers/prospects who are looking for a solution or want to know more about MakretXLS.
And I fed it more data about us, it worked fine, but once I kept feeding more data like after 150 + lines it stopped responding. ?? Can you help me with how to send data to Openai in multiple splits also how to fine-tune this so I can feed more data? So it works smoothly since currently after reaching like 150+ lines in repl the bot freezes due to large data.