Comments (8)
Hello elliot, i have an error error error api/chapter/getInfo 500internal server error {success: false, error: "unknown"} can you suggest me what file need to be check?
Console Log your error
Hello elliot, i have an error error error api/chapter/getInfo 500internal server error {success: false, error: "unknown"} can you suggest me what file need to be check?
Console log your error bro
from learning-journey-yt.
when i genereate the course throw an errror like this "An exception occurred: SyntaxError: Unexpected token H in JSON at position 0
at JSON.parse ()
at strict_output (webpack-internal:///(rsc)/./src/lib/gpt.ts:59:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getQuestionsFromTranscript (webpack-internal:///(rsc)/./src/lib/youtube.ts:43:23)
at async POST (webpack-internal:///(rsc)/./src/app/api/chapter/getInfo/route.ts:43:27)
at async eval (webpack-internal:///(rsc)/./node_modules/next/dist/server/future/route-modules/app-route/module.js:254:37)
Current invalid json format How many components are needed for the application discussed in the transcript?"
from learning-journey-yt.
just info
when i return nextRespone.json "questions" without prisma.questionCreatemany it trow sucess, but when include question.createMany it trow error
const questions = await getQuestionsFromTranscript(
transcript,
chapter.name
);
await prisma.question.createMany({
data: questions.map((question) => {
let options = [
question.answer,
question.option1,
question.option2,
question.option3,
];
options = options.sort(() => Math.random() - 0.5);
return {
question: question.question,
answer: question.answer,
options: JSON.stringify(options),
chapterId: chapterId,
};
}),
});
await prisma.chapter.update({
where: { id: chapterId },
data: {
videoId: videoId,
summary: summary,
},
});
return NextResponse.json({ questions });
from learning-journey-yt.
POST http://localhost:3000/api/chapter/getInfo 500 (Internal Server Error)
https://github.com/wirapramuja/ai-learning/tree/master
from learning-journey-yt.
hello?
from learning-journey-yt.
same error
from learning-journey-yt.
just info when i return nextRespone.json "questions" without prisma.questionCreatemany it trow sucess, but when include question.createMany it trow error
const questions = await getQuestionsFromTranscript( transcript, chapter.name );
await prisma.question.createMany({ data: questions.map((question) => { let options = [ question.answer, question.option1, question.option2, question.option3, ]; options = options.sort(() => Math.random() - 0.5); return { question: question.question, answer: question.answer, options: JSON.stringify(options), chapterId: chapterId, }; }), }); await prisma.chapter.update({ where: { id: chapterId }, data: { videoId: videoId, summary: summary, }, }); return NextResponse.json({ questions });
when i genereate the course throw an errror like this "An exception occurred: SyntaxError: Unexpected token H in JSON at position 0 at JSON.parse () at strict_output (webpack-internal:///(rsc)/./src/lib/gpt.ts:59:31) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async getQuestionsFromTranscript (webpack-internal:///(rsc)/./src/lib/youtube.ts:43:23) at async POST (webpack-internal:///(rsc)/./src/app/api/chapter/getInfo/route.ts:43:27) at async eval (webpack-internal:///(rsc)/./node_modules/next/dist/server/future/route-modules/app-route/module.js:254:37) Current invalid json format How many components are needed for the application discussed in the transcript?"
If your site is deployed on vercel, they have a timeout limit for server functions of about 5-10 seconds. This works terribly with chat pgt since generations can take some time longer than 5-10 seconds. Its possible thats the reason why you're getting a 500
from learning-journey-yt.
can anyone say how to solve this
from learning-journey-yt.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learning-journey-yt.