GithubHelp home page GithubHelp logo

Comments (8)

88um avatar 88um commented on September 4, 2024

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.

wirapramuja avatar wirapramuja commented on September 4, 2024

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.

wirapramuja avatar wirapramuja commented on September 4, 2024

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.

wirapramuja avatar wirapramuja commented on September 4, 2024

POST http://localhost:3000/api/chapter/getInfo 500 (Internal Server Error)

https://github.com/wirapramuja/ai-learning/tree/master

from learning-journey-yt.

wirapramuja avatar wirapramuja commented on September 4, 2024

hello?

from learning-journey-yt.

Amna0099 avatar Amna0099 commented on September 4, 2024

same error

from learning-journey-yt.

88um avatar 88um commented on September 4, 2024

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.

sreehari0914 avatar sreehari0914 commented on September 4, 2024

can anyone say how to solve this

from learning-journey-yt.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.