How To Use OpenAI ChatGPT API with React JS

Поділитися
Вставка
  • Опубліковано 18 гру 2024

КОМЕНТАРІ • 16

  • @Androiski
    @Androiski Рік тому +3

    Hi, I tried to follow your example. I am new to Javascript. I installed the latest njs build 18.17.1 with this project.
    > const { Configuration, OpenAIApi } = require("openai");
    breaks the server.js file. I get an error that "Configuration" is not a constructor.
    When I do not use the destructor and write
    > const Configuration= require("openai");
    > const OpenAIApi = require("openai");
    It runs fine. Is this some minor change? I could not find any documentation about it. And I was not able to figure out which njs version you had.

    • @worldoptics
      @worldoptics Рік тому

      yes there were changes ,as the newer version V4 does not have configuration constructor. I also faced the same issue ,can you tell me if the rest of the code shown in this video working fine?

    • @pashamayba7483
      @pashamayba7483 8 місяців тому

      You need to download the version of openai 3.2.1 as in the video, this is what you need to enter in the terminal npm install openai@3.2.1

  • @msh104utube
    @msh104utube Рік тому +1

    Hey, if you overlay your head shot in the lower left corner, it covers up a lot of the inputs, so it makes the video hard to follow. Just for future reference :)

    • @NorbertWebDev
      @NorbertWebDev  Рік тому

      Thanks, I’m only showing my self in the intro for some time because of this issue :)

    • @msh104utube
      @msh104utube Рік тому

      @@NorbertWebDev Oh no problem. I know some instructors like to use it as a watermark, because some people have taken their videos and streamed it again as their own.

  • @hiiamalyazi9590
    @hiiamalyazi9590 4 місяці тому +1

    its not working or the module being responsive i got this error param: null,
    code: 'model_not_found'
    },
    code: 'model_not_found',
    param: null,
    type: 'invalid_request_error'
    }

    • @NorbertWebDev
      @NorbertWebDev  4 місяці тому

      Hi, did you use the type of model for your JavaScript file ?

  • @PostcardsFromJapan
    @PostcardsFromJapan Рік тому

    Fantastic tutorial, very easy to follow. Subscribed!

  • @KcClips
    @KcClips Рік тому

    please Update App.css file
    (giving error)

    • @NorbertWebDev
      @NorbertWebDev  Рік тому

      Strange, will take a look at it

    • @some_idiot83
      @some_idiot83 Рік тому +1

      @@NorbertWebDev It's just missing a curly bracket after .form-group

    • @Bob65001
      @Bob65001 11 місяців тому

      The error occurs here
      .form-group input,
      .form-group select {
      border: 1px solid rgba(238, 238, 238, 0.9333333333);
      border-radius: 5px;
      padding: 0.5rem;
      }
      it is missing the curly bracket at the end