Robitx / gp.nvim

Gp.nvim (GPT prompt) Neovim AI plugin: ChatGPT sessions & Instructable text/code operations & Speech to text [OpenAI]
MIT License
537 stars 49 forks source link

Stopped working for me a few days ago. The chat immediately returns an empty response. Where are the logs? #115

Open EvanDaley opened 3 months ago

EvanDaley commented 3 months ago

I've been absolutely loving this plugin and use it all the time but it stopped working for me a few days ago.

How can I get diagnostic info about why it returns an empty response every time? I dont see any mention of logging output in the readme.

Thank you

Robitx commented 3 months ago

@EvanDaley OpenAI recently switched to prepaid billing https://help.openai.com/en/articles/8264644-what-is-prepaid-billing

If this is the case, after you buy some credits, the original API key may still not work immediately (you could speed things up by making a new key and switching to it).

Try running the following with the same API key you're using for Gp.

curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ],
    "stream": true
  }'
Robitx commented 3 months ago

And concerning the logs, there is :GpInspectPlugin command which responds with the state of the plugin including most recent _queries.

EvanDaley commented 3 months ago

Ah shoot, yeah the prepaid thing got me. Its working now. Thanks robitx!