Simatwa / WebChatGPT

Python SDK/API for ChatGPT Web-Version
GNU General Public License v3.0
86 stars 21 forks source link

List of Models available #12

Open zeronyk opened 5 months ago

zeronyk commented 5 months ago

Hi, thank you for creating this Tool.

I think the model parameter recently broke, or they changed the model names. I was using ChatGPT with model="gpt-4" like one week ago and it worked just fine, however i just found that using model="gpt-4" returns now.

I assume there was a change from OpenAI, a list of all models would be usefull, but i have no idea how to get them.

from WebChatGPT import ChatGPT

bot = ChatGPT(
    "[...]",
    model="gpt-4"
)
response = bot.chat("hello")

print(response)

File [....]utils.py:243, in get_message(response) 241 # print(json.dumps(response,indent=4)) 242 assert isinstance(response, dict), "'response' should be of 'dict' data-type" --> 243 return response["message"]["content"]["parts"][0]

TypeError: 'NoneType' object is not subscriptable



When i read the post request from OpenAI it still sends 
`{"server_request_id":"84b130e05d9a6a73-TXL","model":"gpt-4","preflight_time_ms":20,....}`

I am pretty sure that there is no response returned, but i am not sure how to fix it.
zeronyk commented 5 months ago

Whoopsi nevermind, i found the the problem;

After printing the complete response. {'message': None, 'conversation_id': '651646f0-b71d-446a-ba92-a5065d867db0', 'error': 'Our systems have detected unusual activity from your system. Please try again later.'}

It seems that they detect the botting somehow. But interestingly only when using this module and only when using model=gpt-4 text-davinci-002-render-sha works fine.

Also "normal chatting" via the webApplication (chat.openai.com) also works.

Simatwa commented 5 months ago

Thanks for raising this concern. Hoping to get a fix soon.

Simatwa commented 2 months ago

Hi, thank you for creating this Tool.

I think the model parameter recently broke, or they changed the model names. I was using ChatGPT with model="gpt-4" like one week ago and it worked just fine, however i just found that using model="gpt-4" returns now.

I assume there was a change from OpenAI, a list of all models would be usefull, but i have no idea how to get them.

from WebChatGPT import ChatGPT

bot = ChatGPT(
    "[...]",
    model="gpt-4"
)
response = bot.chat("hello")

print(response)

File [....]utils.py:243, in get_message(response) 241 # print(json.dumps(response,indent=4)) 242 assert isinstance(response, dict), "'response' should be of 'dict' data-type" --> 243 return response["message"]["content"]["parts"][0]

TypeError: 'NoneType' object is not subscriptable


When i read the post request from OpenAI it still sends 
`{"server_request_id":"84b130e05d9a6a73-TXL","model":"gpt-4","preflight_time_ms":20,....}`

I am pretty sure that there is no response returned, but i am not sure how to fix it.

Could you please confirm whether this exception is still raised.