acheong08 / ChatGPT-to-API

Scalable unofficial ChatGPT API for production.
1.11k stars 373 forks source link

Fix GPT-4 model, structural change of access_tokens.json, add har file tutorial to readme #105

Closed xqdoo00o closed 11 months ago

xqdoo00o commented 11 months ago

The structural change of access_tokens.json is a break change

acheong08 commented 11 months ago

Any way for this to be non-breaking?

xqdoo00o commented 11 months ago

Any way for this to be non-breaking?

Trying, find that POSTconversation func return 500, triggers CF challenge, OpenAIAuth also triggers. Maybe because of last night chatgpt upgrade.

bi1101 commented 11 months ago

Yes I also tried it with the reverse proxy but no help

xqdoo00o commented 11 months ago

Any way for this to be non-breaking?

Tried use 2 files access_tokens.json puid.json may non-breaking, but would cause many problems in save and use token&puid. Maybe this breaking change is acceptable?

acheong08 commented 11 months ago
[{token:"access_token1", puid:"puid1"}, {token:"access_token2", puid:"puid2"}...]

This would require every account to be a Plus account?

xqdoo00o commented 11 months ago
[{token:"access_token1", puid:"puid1"}, {token:"access_token2", puid:"puid2"}...]

This would require every account to be a Plus account?

No, if use non Plus account, puid is "", which would not to be used

acheong08 commented 11 months ago

Mind modifying https://github.com/acheong08/ChatGPT-to-API/blob/master/tools/authenticator/tojson.sh to write the correct format?

bi1101 commented 11 months ago

It seems like at curent state, this PR cannot fix GPT-4 right? 500 error due to the lastest ChatGPT update?

Using reverse proxy works for GPT-3.5 in my case but it's no use for GPT-4

xqdoo00o commented 11 months ago

Mind modifying https://github.com/acheong08/ChatGPT-to-API/blob/master/tools/authenticator/tojson.sh to write the correct format?

What is this .sh used for? puid is find in cookies

bi1101 commented 11 months ago

This is for the authenticator tool to convert the access_token.txt to json.

I'm guessing since you changed the json format, he hope you can change the json format for the authenticator tool too

xqdoo00o commented 11 months ago

It seems like at curent state, this PR cannot fix GPT-4 right? 500 error due to the lastest ChatGPT update?

Using reverse proxy works for GPT-3.5 in my case but it's no use for GPT-4

Yes, and I did some fix 500 to avoid CF challenge and now gpt-4 works , fix code from https://github.com/linweiyuan/go-chatgpt-api, not sure if suitable to submit that PR

bi1101 commented 11 months ago

It seems like at curent state, this PR cannot fix GPT-4 right? 500 error due to the lastest ChatGPT update?

Using reverse proxy works for GPT-3.5 in my case but it's no use for GPT-4

Yes, and I did some fix 500 to avoid CF challenge and now gpt-4 works , fix code from https://github.com/linweiyuan/go-chatgpt-api, not sure if suitable to submit that PR

This repo has an old GPT-4 branch, which I think would be suitable to test GPT-4 even with breaking changes

acheong08 commented 11 months ago

I'll implement it myself later then. Merging...