gp.nvim icon indicating copy to clipboard operation
gp.nvim copied to clipboard

Gp: OpenAI query response is empty

Open nitaicharan opened this issue 1 year ago • 0 comments

Hello guys, I'm finding this issue an issue when I submit my question using GpChatNew. It was working like a charm but know it is outputting the following message:

Gp: OpenAI query response is empty: 
"{
    "error": {
        "message": "We could not parse the JSON body of your quest. (HINT: This likely means you aren't using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)",
        "type": "invalid_request_error",
        "param": null,
        "code": null
    }
}"

Following the GpInspectPlugin:

  _queries = {
    ["548ec979_c813_4989_993e_c272c99ae06a"] = {
      buf = 597,
      first_line = -1,
      handler = <function 29>,
      last_line = -1,
      on_exit = <function 30>,
      payload = {
        messages = <1>{ {
            content = "You are a general AI ...",
            role = "system"
          }, {
            content = "how can i test it?",
            role = "user"
          }, {
            content = "",
            role = "assistant"
          }, {
            content = "Summarize the topic of our conversation above in two or three words. Respond only with those words.",
            role = "user"
          } },
        model = "gpt-3.5-turbo-1106",
        stream = true,
        temperature = 1.1,
        top_p = 1
      },
      raw_response = "{\n    \"error\": {\n        \"message\": \"We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)\",\n        \"type\": \"invalid_request_error\",\n        \"param\": null,\n        \"code\": null\n    }\n}\n",
      response = "",
      timestamp = 1710716802
    },
    ["574fc242_86d5_439a_8709_826e4ab7c05f"] = {
      first_line = -1,
      handler = <function 31>,
      last_line = -1,
      on_exit = <function 32>,
      payload = {
        messages = <table 1>,
        model = "gpt-3.5-turbo-16k",
        stream = true
      },
      raw_response = "{\n    \"error\": {\n        \"message\": \"We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)\",\n        \"type\": \"invalid_request_error\",\n        \"param\": null,\n        \"code\": null\n    }\n}\n",
      response = "",
      timestamp = 1710716802
    },
  },

Following checkhealth:

gp: require("gp.health").check()

gp.nvim checks ~
- OK require('gp') succeeded
- OK require('gp').setup() has been called
- OK config.openai_api_key is set
- OK curl is installed
- OK grep is installed
- OK ln is installed
- WARNING sox is not installed
- OK no deprecated config options

nitaicharan avatar Mar 17 '24 23:03 nitaicharan