j178 / chatgpt

An elegant interactive CLI for ChatGPT
693 stars 52 forks source link

error: error, unexpected end of JSON input #73

Closed brucmao closed 5 months ago

brucmao commented 1 year ago

用的azure ,对话时报错 C:\Users\brucm.config\chatgpt\config.json 配置如下

{
  "api_type": "AZURE",
  "api_key": "xxxx",
  "endpoint": "https://xxx.openai.azure.com",
  "engine": "gpt-35-turbo",
  "api_version": "2023-03-15-preview",
  "prompts": {
    "default": "You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible.",
    "shell": "Return a one-line bash command with the functionality I will describe. Return ONLY the command ready to run in the terminal. The command should do the following:",
    "translator": "I want you to act as an English translator, spelling corrector and improver. I will speak to you in any language and you will detect the language, translate it and answer in the corrected and improved version of my text, in English. I want you to replace my simplified A0-level words and sentences with more beautiful and elegant, upper level English words and sentences. The translation should be natural, easy to understand, and concise. Keep the meaning same, but make them more literary. I want you to only reply the correction, the improvements and nothing else, do not write explanations."
  },
  "conversation": {
    "prompt": "default",
    "context_length": 6,
    "model": "gpt-3.5-turbo",
    "stream": true,
    "max_tokens": 1024
  }
}
j178 commented 1 year ago

抱歉,由于我没有 Azure OpenAI 的接口权限,没法调试这部分…从错误信息来看可能是网络问题,可以贴一下完整的错误吗?或者多试几次呢?

brucmao commented 1 year ago

应该不是网络问题,Azure OpenAI 时可以正常访问的,我将apikey 用在OpenAI Translator 是正常 image

xavierskip commented 1 year ago

@j178 我来测试一下 azure 接口,结果发现不会build了。

这个项目咋build来着?我 clone 下来,发现项目根目录没有找到 main.go 以及 main 函数,go install 没有效果。

但是我进入 cmd 目录再 go install 似乎可以,或者go install ./cmd,但是生成的文件名字是cmd.exe. 文件倒是可以运行。

还有如何指定 config.json 呢?一个是 openai 的,一个是 AZURE 的。

j178 commented 5 months ago

不好意思各位,回复晚了:) 最近才试了一下 Azure OpenAI,发现确实有些兼容上的问题,我发布了新的 v1.3.3,现在应该可以正常使用了,谢谢大家~