Need Help in fine tuning this code for my ChatGPT Support bot

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.

Hello @ShubhamShah16, welcome to the community!

Please edit your post’s code to be formatted like this:

```languagename
Your code here
```

So that it is easier for staff and members of the community to help you with your issue!

Also see this guide on how to share your code:

PS: if you cannot edit your post, please read around a little to increase your trust level and let you access editing your posts.

cc: @QwertyQwerty88 @dragonhunter1 @MattDESTROYER

6 Likes