Pythagora-io / gpt-pilot

The first real AI developer
Other
29.06k stars 2.91k forks source link

[Bug]: #1000

Open bhagatsameer opened 3 weeks ago

bhagatsameer commented 3 weeks ago

Version

VisualStudio Code extension

Operating System

Ubuntu Linux

What happened?

Since the new update yesterday 0.2.3 we are getting below error. Even though the OpenAPI key is correctly updated in the config.json file, Pythagora is giving below error.

API check for openai failed with: [BricksLLM] key sk-bk** has been revoked API check for openai failed with: [BricksLLM] key sk-bk** has been revoked Pythagora cannot start because the LLM API is not reachable.

If i run python3 main.py on Terminal it works properly.

senko commented 3 weeks ago

Sounds like the VSCode extension didn't pick up the fact that you're using your own key, and tries to use the (expired) trial key. You can verify if that's the case by going to Settings and checking whether it days "You're using your own key".

If you haven't already, try closing vscode completely and restarting it, which should force the extension to re-check this. Please let me know if that works around the issue for you.

EyeSeeThru commented 3 weeks ago

I am having the same problem. Closing and re-opening VS Code did not resolve it, nor did disabling and enabling the extension again.

senko commented 3 weeks ago

@EyeSeeThru thanks for confirming. When you go to Pythagora Settings panel, does it say "You're using your own key" or "Your free trial has expired" ?

EyeSeeThru commented 3 weeks ago

Said expired, but I found info in the Discord that actually explains that there is a new config.json file replacing the .env file. Had to go in there and re-enter my API stuff, so it has changed to say I am using my own API Keys. It has now successfully started a new project and is in the planning phase.

Should update the info at: https://github.com/Pythagora-io/gpt-pilot/wiki/Using-GPT%E2%80%90Pilot-with-Local-LLMs#local-llm-routers

senko commented 3 weeks ago

Should update the info at: https://github.com/Pythagora-io/gpt-pilot/wiki/Using-GPT%E2%80%90Pilot-with-Local-LLMs#local-llm-routers

Good callout, updated, with some extra info on how to tweak the prompts (we've made it easier now).

livingstonlarus commented 3 weeks ago

Hi, you should update this too: https://github.com/Pythagora-io/gpt-pilot/wiki/Using-Pythagora-with-your-own-OpenAI-key

livingstonlarus commented 3 weeks ago

Also you may give more details, like:

At the top of config.json, you'll find:

{
  "llm": {
    "openai": {
      "base_url": null,
      "api_key": null,
      "connect_timeout": 60.0,
      "read_timeout": 10.0
    }
  },

For base_url, replace null with https://api.openai.com/v1

And for api_key, replace null with your own API key that you can create at https://platform.openai.com/api-keys

senko commented 3 weeks ago

@livingstonlarus :+1: thanks for the prod, I dropped the ball on that one too; updated

Jim-Kay commented 2 weeks ago

I ran into a similar issue where my OpenAI key wasn't being recognized. I removed the helpful comments that were in the config.json file, and then everything worked.

quloos commented 1 week ago

I ran into a similar issue where my OpenAI key wasn't being recognized. I removed the helpful comments that were in the config.json file, and then everything worked.

Your answer saved me! THX