Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • chatgpt error in Stata

    After having successfully installed, set up, and used chatgpt in Stata, after a brief hiatus, I am now getting the following error message: "something required". Sample script is:

    chatgpt, openai_api_key($OPENAI_API_KEY) command("what language is Stata and Mata written in?")

    I tried updating the ado files and Stata (both 17 and 18) and the problem persists.

    Does anyone have any insights or work-arounds?

    Best,
    Saul

  • #2
    The real problem appears to be with a file called: payload-gpt-3.5-turbo.txt. It is not in C:\ado...Any insights would be greatly welcome.

    Comment


    • #3
      Hi Mr Gabriel, did you manage to solve the issue? I have the same problem

      Comment


      • #4
        The first error "something required" is probably a syntax error. The line in the OP is missing the associated keyword for the command (e.g. "talk").

        Code:
        chatgpt test
        If the above line gives you the error "file [...]/payload-gpt-3.5-turbo.txt not found" then there are a few possible causes. The python script "chatgpt_script.py" generates the file "payload-gpt-3.5-turbo.txt" and this command invokes python via the console using the ! symbol rather then via the python prefix, so you will not necessarily get a meaningful error if the script doesn't run correctly. Make sure you have python installed. Then you might try running the python script yourself directly from the command line with:

        Code:
        python "PATH/TO/FILE/chatgpt_script.py" "gen" "gpt-3.5-turbo" "PATH/TO/FILE/"
        for me, PATH/TO/FILE/ is "c:/ado/plus/c/", but your path may be different. You can also try to invoke this same command from Stata with the python prefix.

        Code:
        python: "PATH/TO/FILE/chatgpt_script.py" "gen" "gpt-3.5-turbo" "PATH/TO/FILE/"
        This should give you a more meaningful error to work with. Finally, please keep in mind that this is a user written command and still in active development. According to the help file:

        Code:
            This command is currently undergoing continuous development, and the
            features presented in this sthlp file will be further updated as the
            command program is refined. We welcome you to try out this command in
            advance and provide valuable suggestio he next phase of command
            development.
        So problems like this are to be expected.

        Comment


        • #5
          Daniel Schaefer Mario Amato Meno , I was able to get the program to run by updating python, chatgpt-Stata, and chatgpt. However, the program now instructs me that I have reached my quota and need to update my subscription to chatgpt. However, when I run chatgpt outside of Stata, I get no such message. I spoke with the authors of chatgpt-Stata and they confirmed the subscription issue.
          ​​​​​​​

          Comment

          Working...
          X