gpt4free icon indicating copy to clipboard operation
gpt4free copied to clipboard

Update gpt4free/usesless/__init__.py

Open enganese opened this issue 1 year ago • 1 comments

Added:

request.encoding = request.apparent_encoding

Now, code must look like this:

url = "https://ai.usesless.com/api/chat-process"
request = requests.post(url, headers=Completion.headers, json=json_data)
request.encoding = request.apparent_encoding # <--- Fix is here
content = request.content

My prompt in russian (cyrillic): Привет!

Usesless's answer WITHOUT my fix:

ÐÑивеÑ! Чем Ñ Ð¼Ð¾Ð³Ñ Ðам помоÑÑ?

Usesless's answer WITH my fix:

Привет! Чем я могу Вам помочь?

enganese avatar May 22 '23 06:05 enganese

I think you should do this too for aiassist

ezerinz avatar May 22 '23 08:05 ezerinz

I think you should do this too for aiassist

Thanks! By the way, here is a new PR for aiassist/__init__.py: https://github.com/xtekky/gpt4free/pull/595

enganese avatar May 23 '23 10:05 enganese