didalgolab / chatgpt-intellij-plugin

Yet another JetBrains extension that enables you to use ChatGPT within your favorite IDE.
Apache License 2.0
22 stars 11 forks source link

ChatGPT encountered an error when using the custom API, resulting in a "Failed to json" message. #25

Closed jixishi closed 4 days ago

jixishi commented 1 month ago

Version: 1.0.1-231 The previous version 0.2.12-231 was working fine. image image

didalgolab commented 1 month ago

It's unfortunate, but the interpretation of custom server addresses indeed changed between versions. In v0.2.12, a full URL like https://api.openai.com/v1/chat/completions was required. However, in v1.0.1, only the base URL (e.g., https://api.openai.com/) is needed, as the path (v1/chat/completions) is added automatically.

However, the error message displayed is strange enough that I'm not convinced it's solely a connection issue. It's possible the API returns a response that the plugin can't parse.

Questions:

  1. What was your custom server address in v0.2.12? I suspect it wasn't just https://api.nextapi.fun, correct?
  2. Is the API endpoint api.nextapi.fun publicly accessible for testing purposes?
didalgolab commented 4 weeks ago

@jixishi, have you had the opportunity to look over my questions?

jixishi commented 2 weeks ago

@didalgolab In the old version 0.2.12, it was https://api.nextapi.fun/v1/chat/completions. In the new version 1.0.1, when adding /v1/chat/completions at the end, it will throw an error indicating duplicate removal, then display the error message with the image.

jixishi commented 2 weeks ago

Using the same proxy address in other programs is fine, I suspect there may be an issue with the JSON parsing that is not extracting the information correctly.

didalgolab commented 2 weeks ago

@jixishi Please attach the full IDEA log for the period when the chat error occurred.

jixishi commented 1 week ago

Hi, how do I go about getting the log files?

didalgolab commented 1 week ago

https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files

jixishi commented 4 days ago

Just updated the plugin and everything seems to be working fine now image