mattvr / ShellGPT

Upgrade your terminal with GPT-4. Ask questions, automate commands, pipe I/O, etc. Made with Deno.
MIT License
228 stars 11 forks source link

Error 'gpt-4' does not exist - MacOS #2

Closed jhavens12 closed 1 year ago

jhavens12 commented 1 year ago

When I set up the program and export my openAI key via the install instructions, I get the following message when trying to use the program:

Failed to parse message TypeError: Failed to parse message:
"{
    "error": {
        "message": "The model: `gpt-4` does not exist",
        "type": "invalid_request_error",
        "param": null,
        "code": "model_not_found"
    }
}
"

TypeError: Cannot read properties of undefined (reading '0')
    at Object.next (https://deno.land/x/shellgpt@0.2.1/lib/ai.ts:179:31)
    at async https://deno.land/x/shellgpt@0.2.1/mod.ts:311:30`

I see the other closed issue and used the install line from there via deno, but issue persists. Using MacOS and installed deno via brew

mattvr commented 1 year ago

Hey @jhavens12, thanks for the report. I believe this may be because you haven't run gpt --config to change the model and selected gpt-3.5-turbo.

I've just pushed a new version, which you can update to with deno install -rfA --name gpt https://deno.land/x/shellgpt/mod.ts which should help as well. Now, the configuration wizard runs automatically if you haven't run it yet.

Let me know if these work for you or not.

maiteko commented 1 year ago

Using the latest version on windows, and went through the auto config. Same issue:

Failed to parse message TypeError: Failed to parse message:
"{
    "error": {
        "message": "The model: `gpt-4` does not exist",
        "type": "invalid_request_error",
        "param": null,
        "code": "model_not_found"
    }
}
"

TypeError: Cannot read properties of undefined (reading '0')
    at Object.next (https://deno.land/x/shellgpt@0.2.2/lib/ai.ts:179:31)
    at async https://deno.land/x/shellgpt@0.2.2/mod.ts:324:30
mattvr commented 1 year ago

@maiteko are you entering gpt-3.5-turbo on the config prompt? And can you double check your ~/.gpt/config.json file to see if it’s set in there?

I will take a look soon to see if I made a mistake and also improve the handling for this case.

You can also apply for GPT-4 access via: https://openai.com/waitlist/gpt-4-api

maiteko commented 1 year ago

Ah, I get what you were trying to say now.

I would suggest a few things

  1. Make it clear in the read me that you need to apply for GPT 4 access separately
  2. default to gpt-3.5-turbo in the config until gpt-4 is accessible without the separate application.
  3. watch the error output when gpt-4 is selected, and provide an explanation and link to the signup if "model_not_found" is returned.
mattvr commented 1 year ago

Thanks @maiteko, I've made the 3 changes you've suggested in the latest update 45b5b57

maiteko commented 1 year ago

Thanks :)

It doesn't make any difference to me at this point, but it's a good idea so people don't keep bugging you when it doesn't work :)