I have tried a bunch of the different unofficial api’s for nextjs, and while the example works fine, as I expand it to handle a different prompt setup the API fails to work right. Could really use your help, anyone at all, hopefully I’m just being foolish and not seeing the forest thru the trees.
i also tried const instead of let, both failed to produce results, all the code right up til this line works, but fails still. any help would be massively appreciated.
async function summarizeStructure(**object,** objType) {
// Generate a prompt for GPT-3 based on the structure
let StructurePrompt = generateStructurePrompt(**object**);
let prompt = `Please provide a detailed and explicit description of the following structure in a single paragraph:\n\n${StructurePrompt}`;
// Generate a summary of the structure using the GPT-3 API
let summary = await generateSummary(prompt);
// Print the summary to the console
console.log("Summary:", summary);
}
async function generateSummary(prompt) {
// Call the GPT-3 API to generate a summary of the folder structure
console.log("calling GPT");
const response = await openai.completions.create({
engine: "text-davinci-002",
prompt: prompt,
max_tokens: 1024,
n: 1,
stop: "\n",
temperature: 0.5,
});