-
-
Notifications
You must be signed in to change notification settings - Fork 13.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error code: 422 - UnprocessableEntityError - As of g4f v0.3.6.6 and above, been getting this error! #2420
Comments
Same problem
|
Same problem DDG: ConnectionTimeoutError: Connection timeout to host https://duckduckgo.com/duckchat/v1/status <style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style> 500Internal Server Error.OpenaiChat: NoValidHarFileError: No .har file found |
Hmm...the error with 422 has been fixed! But now I'm getting error 500 internal server errors despite ChatGPT, ChatGptEs and Blackbox being available... This is after upgrading to 0.3.7.4 @hlohaus Here's what G4F says:
And here's what DazedMTL says as well, same as above:
I re-downgraded back to 0.3.6.5 and G4F started working again with DazedMTL like before. If you want to, I can provide my copy of DazedMTL with an sample .csv file for translation in case you want to see if something is not accounted for in the project or understand why the error is happening. Just ask and I'll upload it with instructions! |
Hello, I'm not sure if you're using the Docker image or Python package, but it's possible that you're on Cloudflare's blacklist. Many websites use this to protect their services. Additionally, you're only testing providers from the model list. I recommend using Microsoft Copilot, as it's both fast and effective. Let me know if you have any other questions. Best regards |
I’m using the python pip package and when I downgraded to 0.3.6.5, chatgpt/blackbox/chstgptes started working again. About the rate limittd providers, that’s because I was using DazedMTL for a bit before upgrading to the newest version so it’s not a cloudflare blacklist issue. Despite that, normally the available providers that aren’t rate-limited respond but some reason they aren’t! I’m also able to visit the sites and do the cloudflare captcha without any issue as well. It’s just that the last newest versions of g4f broke somehow with working with DazedMTL so if you can, please help and look into this! Thank you @hlohaus Also If copilot can provide quality translations like gpt-4o then I’ll consider trying it out but only until this issue is somehow fixed. (It also has to be openai api compatible too) |
Here's a copy of my DazedMTL python project for testing in case you're curious what's causing the errors. It includes an slightly modified csv.py module to make it so the json output is properly extracted from the api by the way. I've included a sample untranslated .csv file (formatted in Translator++ format) for bug-testing with the api. If you're curious what VN (Visual Novel) it's from, it's this one. The .env file has already been modified to work with g4f on the local machine but in-case you need to adjust anything, you can edit it. The minimum required python version is Python 12 and up, you can either manually install the requirements using the requirements.txt file or by running the "start.bat", "start.sh" which has the command to run the requirements installation and then starting the project. If you installed the requirements already, you can skip "start.bat" or "start.sh" and manually start DazedMTL itself with "python start.py" to start up the program. Once it starts up, if no error shows up you should be shown two options which you can select with 1 or 2. Once G4F is started, switch to DazedMTL and press 1 for "translations", then press 4 for "csv (Translator++)", then press 1 again for "Translator++" to start translating the .csv file in the "files" folder. You'll then encounter potentially the same issues as I have with the latest versions of G4F. If you want to manually modify the python project, you can do so with the csv.py module in case you want to add debug printing or such. I hope this helps and sorry for bothering with such a chore...thank you. @hlohaus |
The Microsoft Copilot utilizes the GPT-4o model. pip install -U curl_cffi |
Oh really? That's interesting to know about copilot! I'll test it out! Also I'm already using the latest version of curl_cffi so that's not the issue with the DazedMTL not working with G4F. I again re-upgraded to the newest version, now v0.3.7.5, and haven't used any api in the last couple of hours including chatgpt! So when I tried DazedMTL with G4F using my chatgpt account, I got the nodriver's browser as usual and made a new chat in chatgpt, the browser closes like usual and at this point the translations should go through and return with responses 200...but even so...I kept on getting 500 internal errors and nothing worked. I then re-downgraded back to 0.3.6.5 and Chatgpt, Blackbox, and such all worked again with no error! Have you tested my DazedMTL with the newest version of G4F yet? If you have, did it work? Is this a Python version compatibility issue? I have the last version of python 11 (I modified DazedMTL to use it with python 11 in my case, plan on upgrading to either python 12 or 13 soon) so I'm just curious if something in G4F changed that requires a newer version...otherwise nevermind. As for copilot...is copilot coded to work with g4f api? I don't see it in models.py...should I manually add it to the gpt-4o models.py list or wait until it's ready? |
It appears that you need to pass the provider separately in the request body or you add ?provider=Copilot to the chat completions URL. I am not sure why the providers are not working for you. I have not made any changes that would explain this. @Linden10 |
Pass the provider separately in the request body or add the ?provider=copilot? Interesting to know! I'll uh...wait until Copilot is officially added to the models.py api section since it'll be easier for me to use g4f api with. Still thanks for helping on that! As for the changes that would explain the errors, it has to be one of the changes since v0.3.6.6 (ignoring the 422 error that was fixed) that's causing this problem. I would have to download each version, then applying the error 422 fix patch to see if I can found out which particular version starts throwing the 500 internal server error. Yup! |
Just updated from v0.3.6.4 to the latest version of g4f, that being 0.3.7.1 (updates happening in the past few hours!) and I've been getting this error whenever I try to translate my files in DazedMTL:
openai.UnprocessableEntityError: Error code: 422
Here's the full output of the error from DazedMTL:
On G4F, it reports this:
I have no idea what this missing "field" is but it's causing me these issues, I had to downgrade to 0.3.6.5 just to get this to work again. Hope there's a way to fix this if possible!
The text was updated successfully, but these errors were encountered: