Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After updating to latest 0.3.8, gpt command doesn't return any response #21

Closed
soderluk opened this issue Mar 11, 2024 · 6 comments
Closed

Comments

@soderluk
Copy link
Contributor

soderluk commented Mar 11, 2024

I upgraded ShellGPT to the latest version just now, and now when running gpt "<anything here>" I just get an empty response. gpt "tell me a joke" just, nothing. I also uninstalled and re-installed, as well as made sure deno is at latest version. Any guidelines to perhaps get some logs to debug the issue?

@nicobrenner
Copy link
Contributor

Hi @soderluk, here's a few suggestions:

  • what does which gpt return on your machine?
  • what does echo $PATH print on your machine?

For example in my Mac, there's a gpt command that comes with the computer, so if I don't properly set the PATH to include ShellGPT's gpt binary, my terminal runs the default system one, which is a completely different thing

Alternatively, try running cloning the repo and running it this way:

deno run -A mod.ts (see #20)

That command is essentially what gpt runs under the hood

If that works, you could create your own script:

#!/bin/sh
# ~/.bin/gpt
deno run -A path/to/your/cloned/repo/mod.ts

Then put it in ~/.bin/gpt and include it in your PATH: export PATH=~/.bin/:$PATH and make it executable: chmod +x ~/.bin/gpt

At this point running which gpt should print ~/.bin/gpt

Hope that helps

@mattvr
Copy link
Owner

mattvr commented Mar 11, 2024

One other thing to try could be resetting your config file

mv ~/.gpt/config.json ~/.gpt/config.bak.json # Back up config
gpt --help # Verify gpt command works, trigger setup
gpt "tell me a joke" 

@soderluk
Copy link
Contributor Author

soderluk commented Mar 12, 2024

I've checked that the command really being run is the correct gpt command, everything is good in ${PATH} -> /home/user/.deno/bin, and which gpt -> /home/user/.deno/bin/gpt.
I removed the config and re-run gpt, but still nothing. The config file:
{"lastUpdated":"2024-03-12T07:02:13.797Z","version":"0.3.8","autoUpdate":"prompt","latestName":"2024-03-12_09-07-54","model":"gpt-3.5-turbo"}.

Running the module straight from the repo root, using --debug:

deno run -A mod.ts --debug "tell me a joke"
Request to OpenAI {
  model: "gpt-3.5-turbo",
  messages: [ { role: "user", content: "tell me a joke" } ]
}

And the answer, an empty line in the cli. I'm so confused now. I'll try to checkout the old version and see if that broke everything.

@soderluk
Copy link
Contributor Author

OK, I checked out the older version, and again, same issue, so it seems the issue lies somewhere else. Wonder if my OPENAI_API_KEY has some limits that are getting hit.

@soderluk
Copy link
Contributor Author

I got to the root cause of this. Debugging the responses, the response from openai, is:

{
    "error": {
        "message": "You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.",
        "type": "insufficient_quota",
        "param": null,
        "code": "insufficient_quota"
    }
}

This is the buffer on line 258 of lib/ai.ts. I'll add a new issue for this, and close this one. Thanks for your input @nicobrenner @mattvr

@nicobrenner
Copy link
Contributor

Thank you for the follow up @soderluk, very glad to know you figured it out. I had the same issue with the gpt api, but I got the error directly in the console when it happened

It must be happening to quite a few people as OpenAI currently changed their billing workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants